MauryaHub PYQ Practice

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?
  1. 0x40003000
  2. 0x40002EFF
  3. 0x40001FFF
  4. 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?
Source diagram or notationSource diagram or notationSource diagram or notation
  1. [[IMAGE:dc5f4d3811137c61_4_5]] is 4-byte, and [[IMAGE:dc5f4d3811137c61_4_6]] is 1-byte.
    Source diagram or notationSource diagram or notation
  2. Both registers are 1-byte.
  3. Both registers are 4-byte.
  4. [[IMAGE:dc5f4d3811137c61_4_7]] is 1-byte, and [[IMAGE:dc5f4d3811137c61_4_8]] is 4-byte.
    Source diagram or notationSource diagram or notation

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]]
Source diagram or notation
  1. Only [[IMAGE:dc5f4d3811137c61_4_10]] will be printed.
    Source diagram or notation
  2. Only [[IMAGE:dc5f4d3811137c61_4_11]] will be printed.
    Source diagram or notation
  3. Both lines will be printed, but the order is non-deterministic.
  4. 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.
  1. (i) → (iii) → (ii) → (iv)
  2. (ii) → (i) → (iii) → (iv)
  3. (i) → (ii) → (iii) → (iv)
  4. (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]] ?
Source diagram or notationSource diagram or notationSource diagram or notation
  1. 01110
  2. 00111
  3. 10110
  4. 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?
Source diagram or notationSource diagram or notation
  1. To store the return value of the system call.
  2. To indicate the number of bytes to be transferred.
  3. To let the kernel identify which system call the user process is requesting.
  4. 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?
Source diagram or notation
  1. exec-fork-wait
  2. wait-exec-fork
  3. fork-wait-exec
  4. 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?
  1. 2 KB
  2. 4 KB
  3. 8 KB
  4. 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?
  1. 2\(^{12}\) frames
  2. 2\(^{13}\) frames
  3. 2\(^{14}\) frames
  4. 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]]
Source diagram or notation
  1. Child A: 4 Parent A: 6 Parent B: 14 Child B: 12
  2. Parent A: 6 Child A: 4 Child B: 12 Parent B: 14
  3. Parent A: 6 Parent B: 8 Child A: 3 Child B: 12
  4. 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?
  1. accumulator
  2. exception program counter
  3. mstatus
  4. 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 ________
Source diagram or notation
  1. Mouse
  2. Keyboard
  3. Timers
  4. Interrupt Controller
  5. 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.
  1. True
  2. 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?
  1. Running → Sleeping
  2. Running → Zombie
  3. Running → Runnable
  4. 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?
  1. Page table entries
  2. Process identifier (PID)
  3. The value of the program counter
  4. 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?
  1. Process A
  2. Process B
  3. Process C
  4. 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.
  1. userret
  2. usertrapret
  3. trampoline
  4. 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.
Source diagram or notationSource diagram or notation
  1. Process P1 is in the RUNNABLE state.
  2. Process P2 is in the RUNNING state.
  3. Process P3 is in the SLEEPING state.
  4. Process P4 is in the ZOMBIE state.
  5. Process P3 is in the RUNNING state.
  6. Process P4 is in the RUNNABLE state.

A published solution is not available for this question yet.