👁️ 223 views

Department of Computer Science and Engineering

Final Exam

Course Title: System Programming (CSE-4105)

Semester: 7th | Session: 18-19

Time: 120 minutes | Marks: 60.00

Course Teacher: Md. Rashid Al Asif

N.B.: Answer any FOUR questions out of the followings. All parts of each question must be answered consecutively. Right side of the question shows the maximum marks.

1.


a)

Write short notes:
        i) System Programming   ii) Unix Kernel API   iii) Shell Scripting   iv) File Attributes

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
4 Marks
b)

A file whose file descriptor is fd contains the following sequence of bytes: 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5. The following system calls are made:

Iseek(fd, 3, SEEK_SET);
read(fd, &buffer, 4);

where the Iseek call makes a seek to byte 3 of the file. What does buffer contain after the read has completed?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
6 Marks
c)

Depict the control flow of system calls. Do you agree/disagree that the system calls are time consuming? Give your statement. How do you change file permissions in Unix Explain with example.

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
2.


a)

cd [<dir>] means that change pwd to HOME directory, or <dir> if it is supplied. However, "Changing directories" and "being in a directory" are imprecise phrases. When you cd to a directory named dir, you may think of yourself as being "in dir", but this is not true. What is the true meaning for cd [<dir>] in order to resolve the relative pathnames?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
4 Marks
b)

In multi-user operating system, the operating system must protect users from each other and protect itself from users. However, while providing an operating environment for all users, the operating system creates this illusion (permission for read, write, execution, etc.) by creating data paths between user processes and devices and files. How does UNIX create this illusion?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
6 Marks
c)

Each user has a username and a number, the UID, why? Wouldn't it be simpler to record the username of the user as the owner of a file? Why not have a single identifier for each user?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
3.


a)

A system call is like a conventional function call in that it causes a jump to a subroutine followed by a return to the caller. But it is significantly different. Distinguish between system call and function call based on the following keywords: privileged/kernel mode, trap instruction, system dependent.

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
b)

Unix files have a full set of permission bits, including a set-user-ID bit and a set-group-ID bit. If you turn on the set-group-ID bit for a directory, does it have any effect? If so, what and why? If not, could you think of some use for this bit?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
c)

Analyze the following three commands:

i) ps-ax | grep cron

ii) ps-ax | tee processes.txt | more

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
4.


a)

The kernel had to locate a free inode and free disk blocks when it created a new file. How does the kernel know which blocks are free? How does the kernel know which inodes are free? What method does the file system on your machine use to keep track of unused blocks and inodes?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
9 Marks
b)

A directory is just a node in a set of linked nodes. Using the pwd command you can simply know the current directory. Based on the functionalities of pwd answer the following:

i) What repetitive steps are performed to compute its current directory?
ii) How do we know when we read the top of the tree?
iii) How do we print the directory names in the correct order?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
6 Marks
5.


a)

The hypothetical machine of Fig. 1 also has two I/O instructions:

0011 = Load AC from I/O
0111 = Store AC to I/O

In these cases, the 12-bit address identifies a particular I/O device. Show the program execution (using the format of Fig. 2) for the following program:

i) Load AC from device 5
ii) Add contents of memory location 940
iii) Store AC to device 6
 

Assume that the next value retrieved from device 5 is 3 and location 940 contains a value of 2.

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
6 Marks
b)

In UNIX, there is a single file hierarchy and every accessible file is in this single file hierarchy, no matter how many disks are attached. Similar to windows, there is no such thing as the "C" drive" or "E" drive" in UNIX. If any new file system arrive then how UNIX adapt itself? Give example(s).

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
4 Marks
c)

How does ls -1 work? Briefly explain the data flow in who command with figures.

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
6.


a) The stat system call is passed the name of a file and a pointer to a struct and fills the struct with information about the file. Explain, using the directory, inode, and data model, how stat works?

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
b)

How can we design a multithreaded program to count and print the total number of words in three files? Give two use case scenarios for clarification.

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks
c)

Write short notes on the following:

i) pthread_create, pthread_join
ii) pthread_mutex_lock, pthread_mutex_unlock

Please SUBSCRIBE to view full question

Topics: N/A Solution is Coming!
5 Marks

Good Luck!!!

Contributors of this Question:

Role Name Date
Prepared By (Teacher): Md. Rashid Al Asif N/A
Uploaded By: Subrina Jahan Meem Jan. 8, 2025, 2:39 p.m.
Converted By (Img/PDF to Text): Baishakhi Bir Feb. 22, 2026, 4:20 p.m.
Reviewed By: Obaydul Hasan Nayeem Feb. 22, 2026, 10:58 p.m.