cs4022_2026T1_Q1_NA.pdf
Operating System · Quiz 1 · Jan 2026
← 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
If the memory map for a device starts from the offset 0x40002000 and has a size of 4096 bytes in a
32-bit addressing scheme, what will be the last address in the memory map?
0x40003000
0x40002EFF
0x40001FFF
0x40002FFF
A published solution is not available for this question yet.
Question 3 MCQ · 3.0 marks
Consider the following memory-mapped register code:
[[IMAGE:dc5f4d3811137c61_3_2]]
What are the access sizes of the [[IMAGE:dc5f4d3811137c61_4_3]] and [[IMAGE:dc5f4d3811137c61_4_4]] registers, respectively?



[[IMAGE:dc5f4d3811137c61_4_5]] is 4-byte, and [[IMAGE:dc5f4d3811137c61_4_6]] is 1-byte.


Both registers are 1-byte.
Both registers are 4-byte.
[[IMAGE:dc5f4d3811137c61_4_7]] is 1-byte, and [[IMAGE:dc5f4d3811137c61_4_8]] is 4-byte.


A published solution is not available for this question yet.
Question 4 MCQ · 3.0 marks
What will be the output behavior of the following xv6 code snippet?
[[IMAGE:dc5f4d3811137c61_4_9]]

Only [[IMAGE:dc5f4d3811137c61_4_10]] will be printed.

Only [[IMAGE:dc5f4d3811137c61_4_11]] will be printed.

Both lines will be printed, but the order is non-deterministic.
Parent always prints first, then child.
A published solution is not available for this question yet.
Question 5 MCQ · 3.0 marks
Which of the following correctly describes the sequence of steps when a new process is forked in
xv6?
(i) Allocate a new proc structure.
(ii) Copy the parent’s memory space to the child.
(iii) Set up the trapframe for the child process.
(iv) Add the child to the ready queue.
(i) → (iii) → (ii) → (iv)
(ii) → (i) → (iii) → (iv)
(i) → (ii) → (iii) → (iv)
(iii) → (i) → (ii) → (iv)
A published solution is not available for this question yet.
Question 6 MCQ · 3.0 marks
Consider image of the page table entry is given below and the code for kvminit in vm.c.
[[IMAGE:dc5f4d3811137c61_5_12]]
[[IMAGE:dc5f4d3811137c61_6_13]]
What will be the values of the first 5 bits (from the right) of the page table entry after the execution
of [[IMAGE:dc5f4d3811137c61_6_14]] ?



01110
00111
10110
10111
A published solution is not available for this question yet.
Question 7 MCQ · 3.0 marks
Consider the following code snippet for the syscall function in kernel/syscall.c (RISC-V xv6):
[[IMAGE:dc5f4d3811137c61_7_15]]
Why does xv6 store the system call number in the [[IMAGE:dc5f4d3811137c61_7_16]] register before invoking the kernel?


To store the return value of the system call.
To indicate the number of bytes to be transferred.
To let the kernel identify which system call the user process is requesting.
To store the stack pointer for the child process.
A published solution is not available for this question yet.
Question 8 MCQ · 3.0 marks
When a user types the command [[IMAGE:dc5f4d3811137c61_7_17]] in a Linux shell, which of the following sequences of
system calls is most likely to occur for executing the command and then returning control to the
shell?

exec-fork-wait
wait-exec-fork
fork-wait-exec
fork-exec-wait
A published solution is not available for this question yet.
Question 9 MCQ · 4.0 marks
A system has a virtual memory space of 8 GB and uses a single-level page table with 2\(^{21}\) entries.
What is the size of each page frame?
2 KB
4 KB
8 KB
16 KB
A published solution is not available for this question yet.
Question 10 MCQ · 4.0 marks
Consider a system with 128 MB of physical memory and a 32-bit virtual address space. Given a
page size of 8 KB, what will be the maximum number of page frames that can be present in RAM?
2\(^{12}\) frames
2\(^{13}\) frames
2\(^{14}\) frames
2\(^{15}\) frames
A published solution is not available for this question yet.
Question 11 MCQ · 4.0 marks
What could be the possible output of the following program?
[[IMAGE:dc5f4d3811137c61_9_18]]

Child A: 4
Parent A: 6
Parent B: 14
Child B: 12
Parent A: 6
Child A: 4
Child B: 12
Parent B: 14
Parent A: 6
Parent B: 8
Child A: 3
Child B: 12
Child A: 2
Parent A: 6
Parent B: 14
Child B: 10
A published solution is not available for this question yet.
Question 12 MCQ · 2.0 marks
In RISC-V, during system calls, which register stores the current program counter?
accumulator
exception program counter
mstatus
None of these
A published solution is not available for this question yet.
Question 13 MCQ · 2.0 marks
Consider the given memory map.
[[IMAGE:dc5f4d3811137c61_10_19]]
The memory address 0x200003CD corresponds to ________

Mouse
Keyboard
Timers
Interrupt Controller
None of these
A published solution is not available for this question yet.
Question 14 MCQ · 2.0 marks
State True or False:
In xv6, after a user process calls fork(), both the parent and child processes have separate copies
of the trapframe, so changes in one do not affect the other.
True
False
A published solution is not available for this question yet.
Question 15 MCQ · 2.0 marks
In xv6, a running process can be preempted by the scheduler due to a timer interrupt. What is the
resulting state transition of the process?
Running → Sleeping
Running → Zombie
Running → Runnable
State remains unchanged
A published solution is not available for this question yet.
Question 16 MCQ · 2.0 marks
When a process invokes the exec system call, which components in the Process Control Block (PCB)
remain unchanged?
Page table entries
Process identifier (PID)
The value of the program counter
File descriptor table and memory information
A published solution is not available for this question yet.
Question 17 MCQ · 2.0 marks
Consider a process A that forks B, B forks C, and C forks D. Processes A and B keep running, but
process C terminates before D finishes. Later, D also terminates. Which process is responsible for
waiting for and reaping process D?
Process A
Process B
Process C
Process init
A published solution is not available for this question yet.
Question 18 MSQ · 2.0 marks
Select the functions present in kernel/trampoline.S, and are responsible for switching from kernel
pagetable to process pagetable and vice versa.
userret
usertrapret
trampoline
usertrap
A published solution is not available for this question yet.
Question 19 MSQ · 3.0 marks
Consider the following processes in an xv6-like operating system:
• Process P1 is ready to run and waiting in the run queue.
• Process P2 is currently executing on the CPU.
• Process P3 has called [[IMAGE:dc5f4d3811137c61_12_20]] waiting for an I/O event.
• Process P4 has exited but its parent has not yet called [[IMAGE:dc5f4d3811137c61_12_21]] .
Select all the correct statements about the states of the processes.


Process P1 is in the RUNNABLE state.
Process P2 is in the RUNNING state.
Process P3 is in the SLEEPING state.
Process P4 is in the ZOMBIE state.
Process P3 is in the RUNNING state.
Process P4 is in the RUNNABLE state.
A published solution is not available for this question yet.