cs4022_2026T1_ET_FN.pdf
Operating System · End Term · Jan 2026 FN
← Course papers · Start practice / exam
Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
Question 2 MCQ · 3.0 marks
Consider that the following commands are executed in a shell with root (/) as the current directory.
[[IMAGE:fcc8fbbc1708430a_2_2]]
What is the absolute path of the file README.md?

/project/src/README.md
/project/docs/README.md
/project/assets/docs/README.md
/README.md
A published solution is not available for this question yet.
Question 3 MCQ · 3.0 marks
Consider the following resource-allocation situation.
• Process P1 holds resource R1 and waits for R2.
• Process P2 holds resource R2 and waits for R3.
• Process P3 holds resource R3 and waits for R4.
• Process P4 holds resource R4 and waits for R1.
• None of the processes releases its held resource until it acquires the requested one.
Which deadlock condition is most directly illustrated by the waiting pattern above?
Mutual exclusion
Preemption
Circular wait
Time sharing
A published solution is not available for this question yet.
Question 4 MCQ · 3.0 marks
If the memory map for a device starts at address 0x50002000 and has a size of 4096 bytes, what is
the last valid address in the memory map?
0x50002FFE
0x50002FFF
0x50003000
0x50002000
A published solution is not available for this question yet.
Question 5 MCQ · 3.0 marks
Consider the following program. Assume execlp succeeds.
[[IMAGE:fcc8fbbc1708430a_4_3]]
Which output order is guaranteed?

parent ready appears before hello
hello appears before parent ready
Only parent ready appears
The order is non-deterministic
A published solution is not available for this question yet.
Question 6 MSQ · 3.0 marks
Consider the following processes in an xv6-like operating system.
• Process P1 is waiting in the ready queue.
• Process P2 is currently executing on the CPU.
• Process P3 is blocked waiting for keyboard I/O.
• Process P4 has terminated, but its parent has not yet called wait().
Select all correct statements.
P1 is in the RUNNABLE state.
P2 is in the RUNNING state.
P3 is in the SLEEPING state.
P4 is in the ZOMBIE state.
P3 is in the RUNNABLE state.
P4 is in the RUNNING state.
A published solution is not available for this question yet.
Question 7 MSQ · 3.0 marks
Consider the following solution for the critical section problem using a shared variable turn.
Initial value:
turn = 1
[[IMAGE:fcc8fbbc1708430a_5_4]]
Which of the following statements are correct?

Mutual exclusion is guaranteed.
The solution satisfies the progress condition.
Bounded waiting is guaranteed.
Deadlock can occur if one process is slow.
A published solution is not available for this question yet.
Question 8 MSQ · 3.0 marks
Assume that context switches can occur at any time during execution. The variable counter is
shared between two concurrent programs.
Initial value: counter = 150
[[IMAGE:fcc8fbbc1708430a_6_5]]
Which of the following can be the possible final values of counter?

115
135
170
150
155
185
A published solution is not available for this question yet.
Question 9 MSQ · 3.0 marks
Choose all correct statements regarding compiling and linking multiple C source files using gcc.
gcc file1.c file2.c -o output produces an executable named output.
gcc -c file1.c file2.c produces file1.o and file2.o.
gcc file1.o file2.o -o output links the object files into an executable named
output.
gcc -c file1.c file2.c -o output produces an executable named output.
gcc file1.o file2.o -c -o output produces an executable named output.
A published solution is not available for this question yet.
Question 10 NAT · 1.5 marks
A system has 128 MiB of physical memory and uses a page size of 4 KiB. How many page frames
are present in RAM? Assume 1 MiB = 2\(^{20}\) bytes and 1 KiB = 2\(^{10}\) bytes.
A published solution is not available for this question yet.
Question 11 NAT · 1.5 marks
Consider the following processes, all arriving at time 0 and entering the ready queue in the order
shown below.
[[IMAGE:fcc8fbbc1708430a_7_6]]
If the CPU scheduling policy is Round Robin with time quantum 3, what is the average response
time?

A published solution is not available for this question yet.
Question 12 MCQ · 2.0 marks
Consider the code segment (for xv6) given below.
[[IMAGE:fcc8fbbc1708430a_8_7]]
What are the base address and the end address of data_reg?

The base address is 0xE3005018, and the end address is 0xE300501A.
The base address is 0xE3005018, and the end address is 0xE300501B.
The base address is 0xE3005006, and the end address is 0xE3005009.
The base address is 0xE3005024, and the end address is 0xE3005027.
A published solution is not available for this question yet.
Question 13 MCQ · 2.0 marks
When a shell executes a command and then waits for it to finish before printing the next prompt,
which sequence of system calls is most likely used?
exec → fork → wait
wait → fork → exec
fork → wait → exec
fork → exec → wait
A published solution is not available for this question yet.
Question 14 MCQ · 2.0 marks
Consider the following code snippet.
[[IMAGE:fcc8fbbc1708430a_9_8]]
Which of the following statements is correct?

The program creates two threads, each printing OS Lab 40 times, and
Complete is printed only after both threads finish.
The program creates two threads, but Complete may appear before some
thread outputs.
The program prints OS Lab exactly 40 times in total and then prints Complete.
The program executes the two threads sequentially because pthread_create()
blocks.
A published solution is not available for this question yet.
Question 15 MCQ · 2.0 marks
In xv6 on RISC-V, which register contains the system call number when the user process traps into
the kernel?
a0
a7
sp
sepc
A published solution is not available for this question yet.
Question 16 MCQ · 2.0 marks
Given the hexadecimal representation of the first few bytes of different files, identify the
executable ELF file.
7F 45 58 45 01 01 01 00
7F 50 44 46 01 01 01 00
7F 45 4C 46 02 01 01 00
7F 4A 50 47 01 01 01 00
A published solution is not available for this question yet.
Question 17 MCQ · 2.0 marks
In a 64-bit RISC-V system, the scause register stores trap information. What will be the value of
scause for an Environment call from S-mode?
0x8000000000000009
0x0000000000000009
0x0000000000000008
0x8000000000000008
A published solution is not available for this question yet.
Question 18 NAT · 2.0 marks
Consider the following processes scheduled using FCFS.
[[IMAGE:fcc8fbbc1708430a_10_9]]
What is the average waiting time?

A published solution is not available for this question yet.
Question 19 NAT · 2.0 marks
A system uses a 32-bit virtual address space with a page size of 8 KiB and a single-level page table.
How many entries are required in the page table? Assume 1 KiB = 2\(^{10}\) bytes.
A published solution is not available for this question yet.
Question 20 NAT · 3.0 marks
Consider the following processes scheduled using non-preemptive SJF.
[[IMAGE:fcc8fbbc1708430a_11_10]]
What is the average response time?

A published solution is not available for this question yet.
Question 21 MCQ · 4.0 marks
Consider the below plots representing the order in which the requests are serviced by different
disk scheduling algorithms.
[[IMAGE:fcc8fbbc1708430a_12_11]]
Match the above plots with the corresponding disk scheduling algorithm.

(1) – C-LOOK, (2) – C-SCAN, (3) – SCAN, (4) – SSTF
(1) – C-SCAN, (2) – FCFS, (3) – SSTF, (4) – C-LOOK
(1) – SSTF, (2) – SCAN, (3) – C-SCAN, (4) – C-LOOK
(1) – FCFS, (2) – C-LOOK, (3) – SSTF, (4) – SCAN
A published solution is not available for this question yet.