MauryaHub PYQ Practice

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?
Source diagram or notation
  1. /project/src/README.md
  2. /project/docs/README.md
  3. /project/assets/docs/README.md
  4. /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?
  1. Mutual exclusion
  2. Preemption
  3. Circular wait
  4. 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?
  1. 0x50002FFE
  2. 0x50002FFF
  3. 0x50003000
  4. 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?
Source diagram or notation
  1. parent ready appears before hello
  2. hello appears before parent ready
  3. Only parent ready appears
  4. 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.
  1. P1 is in the RUNNABLE state.
  2. P2 is in the RUNNING state.
  3. P3 is in the SLEEPING state.
  4. P4 is in the ZOMBIE state.
  5. P3 is in the RUNNABLE state.
  6. 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?
Source diagram or notation
  1. Mutual exclusion is guaranteed.
  2. The solution satisfies the progress condition.
  3. Bounded waiting is guaranteed.
  4. 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?
Source diagram or notation
  1. 115
  2. 135
  3. 170
  4. 150
  5. 155
  6. 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.
  1. gcc file1.c file2.c -o output produces an executable named output.
  2. gcc -c file1.c file2.c produces file1.o and file2.o.
  3. gcc file1.o file2.o -o output links the object files into an executable named output.
  4. gcc -c file1.c file2.c -o output produces an executable named output.
  5. 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?
    Source diagram or notation

      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?
      Source diagram or notation
      1. The base address is 0xE3005018, and the end address is 0xE300501A.
      2. The base address is 0xE3005018, and the end address is 0xE300501B.
      3. The base address is 0xE3005006, and the end address is 0xE3005009.
      4. 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?
      1. exec → fork → wait
      2. wait → fork → exec
      3. fork → wait → exec
      4. 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?
      Source diagram or notation
      1. The program creates two threads, each printing OS Lab 40 times, and Complete is printed only after both threads finish.
      2. The program creates two threads, but Complete may appear before some thread outputs.
      3. The program prints OS Lab exactly 40 times in total and then prints Complete.
      4. 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?
      1. a0
      2. a7
      3. sp
      4. 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.
      1. 7F 45 58 45 01 01 01 00
      2. 7F 50 44 46 01 01 01 00
      3. 7F 45 4C 46 02 01 01 00
      4. 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?
      1. 0x8000000000000009
      2. 0x0000000000000009
      3. 0x0000000000000008
      4. 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?
      Source diagram or notation

        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?
          Source diagram or notation

            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.
            Source diagram or notation
            1. (1) – C-LOOK, (2) – C-SCAN, (3) – SCAN, (4) – SSTF
            2. (1) – C-SCAN, (2) – FCFS, (3) – SSTF, (4) – C-LOOK
            3. (1) – SSTF, (2) – SCAN, (3) – C-SCAN, (4) – C-LOOK
            4. (1) – FCFS, (2) – C-LOOK, (3) – SSTF, (4) – SCAN

            A published solution is not available for this question yet.