Question 1
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

The IIT Madras BS Operating Systems (Operating Systems) Quiz 1 paper sat on 15 Mar 2026, in the January 2026 term: 18 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
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
Correct answer
0x40002FFF
Consider the following memory-mapped register code:
What are the access sizes of the
and
registers, respectively?
is 4-byte, and is 1-byte.
(A figure from the original paper is missing from the source site.)
Both registers are 1-byte.
(A figure from the original paper is missing from the source site.)
Both registers are 4-byte.
(A figure from the original paper is missing from the source site.)
is 1-byte, and is 4-byte.
(A figure from the original paper is missing from the source site.)
Correct answer
is 4-byte, and is 1-byte.
(A figure from the original paper is missing from the source site.)
What will be the output behavior of the following xv6 code snippet?
Only will be printed.
(A figure from the original paper is missing from the source site.)
Only will be printed.
(A figure from the original paper is missing from the source site.)
Both lines will be printed, but the order is non-deterministic.
(A figure from the original paper is missing from the source site.)
Parent always prints first, then child.
(A figure from the original paper is missing from the source site.)
Correct answer
Both lines will be printed, but the order is non-deterministic.
(A figure from the original paper is missing from the source site.)
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)
Correct answer
(i) → (ii) → (iii) → (iv)
Consider image of the page table entry is given below and the code for kvminit in vm.c.
What will be the values of the first 5 bits (from the right) of the page table entry after the execution of
?
01110
00111
10110
10111
Correct answer
00111
Consider the following code snippet for the syscall function in kernel/syscall.c (RISC-V xv6):
Why does xv6 store the system call number in the
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.
Correct answer
To let the kernel identify which system call the user process is requesting.
When a user types the command
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
Correct answer
fork-exec-wait
A system has a virtual memory space of 8 GB and uses a single-level page table with 221 entries. What is the size of each page frame?
2 KB
4 KB
8 KB
16 KB
Correct answer
4 KB
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?
212 frames
213 frames
214 frames
215 frames
Correct answer
214 frames
What could be the possible output of the following program?
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
Correct answer
Parent A: 6 Child A: 4 Child B: 12 Parent B: 14
In RISC-V, during system calls, which register stores the current program counter?
accumulator
exception program counter
mstatus
None of these
Correct answer
exception program counter
Consider the given memory map.
The memory address 0x200003CD corresponds to ________
Mouse
Keyboard
Timers
Interrupt Controller
None of these
Correct answer
Mouse
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
Correct answer
True
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
Correct answer
Running → Runnable
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
Correct answer
Process identifier (PID)
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
Correct answer
Process init
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
Correct answers
userret
trampoline
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
waiting for an I/O event. • Process P4 has exited but its parent has not yet called
. 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.
Correct answers
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.