uiz Space

January 2026 term · Operating Systems · BSCS4022

Operating Systems End Term: 10 May 2026, Set 1-2 (January 2026 term)

The IIT Madras BS Operating Systems (Operating Systems) End Term paper sat on 10 May 2026, in the January 2026 term, set 1-2: 20 questions for 50 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
20
Marks
50
Duration
180 min
MCQ
11
MSQ
4
Numerical
5

Updated

Official paper: OS 10 May 26 · No negative marking.

Question 1

+3 marksOne correct option

Consider that the following commands are executed in a shell with root (/) as the current directory.

What is the absolute path of the file README.md?

  1. A

    /project/src/README.md

  2. B

    /project/docs/README.md

  3. C

    /project/assets/docs/README.md

  4. D

    /README.md

Show answer

Correct answer

  • B

    /project/docs/README.md

Question 2

+3 marksOne correct option

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. A

    Mutual exclusion

  2. B

    Preemption

  3. C

    Circular wait

  4. D

    Time sharing

Show answer

Correct answer

  • C

    Circular wait

Question 3

+3 marksOne correct option

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. A

    0x50002FFE

  2. B

    0x50002FFF

  3. C

    0x50003000

  4. D

    0x50002000

Show answer

Correct answer

  • B

    0x50002FFF

Question 4

+3 marksOne correct option

Consider the following program. Assume execlp succeeds.

Which output order is guaranteed?

  1. A

    parent ready appears before hello

  2. B

    hello appears before parent ready

  3. C

    Only parent ready appears

  4. D

    The order is non-deterministic

Show answer

Correct answer

  • B

    hello appears before parent ready

Question 5

+3 marksOne or more correct options

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.

Select all that apply.

  1. A

    P1 is in the RUNNABLE state.

  2. B

    P2 is in the RUNNING state.

  3. C

    P3 is in the SLEEPING state.

  4. D

    P4 is in the ZOMBIE state.

  5. E

    P3 is in the RUNNABLE state.

  6. F

    P4 is in the RUNNING state.

Show answer

Correct answers

  • A

    P1 is in the RUNNABLE state.

  • B

    P2 is in the RUNNING state.

  • C

    P3 is in the SLEEPING state.

  • D

    P4 is in the ZOMBIE state.

Question 6

+3 marksOne or more correct options

Consider the following solution for the critical section problem using a shared variable turn. Initial value: turn = 1

Which of the following statements are correct?

Select all that apply.

  1. A

    Mutual exclusion is guaranteed.

  2. B

    The solution satisfies the progress condition.

  3. C

    Bounded waiting is guaranteed.

  4. D

    Deadlock can occur if one process is slow.

Show answer

Correct answers

  • A

    Mutual exclusion is guaranteed.

  • C

    Bounded waiting is guaranteed.

Question 7

+3 marksOne or more correct options

Assume that context switches can occur at any time during execution. The variable counter is shared between two concurrent programs. Initial value: counter = 150

Which of the following can be the possible final values of counter?

Select all that apply.

  1. A

    115

  2. B

    135

  3. C

    170

  4. D

    150

  5. E

    155

  6. F

    185

Show answer

Correct answers

  • A

    115

  • B

    135

  • C

    170

Question 8

+3 marksOne or more correct options

Choose all correct statements regarding compiling and linking multiple C source files using gcc.

Select all that apply.

  1. A

    gcc file1.c file2.c -o output produces an executable named output.

  2. B

    gcc -c file1.c file2.c produces file1.o and file2.o.

  3. C

    gcc file1.o file2.o -o output links the object files into an executable named output.

  4. D

    gcc -c file1.c file2.c -o output produces an executable named output.

  5. E

    gcc file1.o file2.o -c -o output produces an executable named output.

Show answer

Correct answers

  • A

    gcc file1.c file2.c -o output produces an executable named output.

  • B

    gcc -c file1.c file2.c produces file1.o and file2.o.

  • C

    gcc file1.o file2.o -o output links the object files into an executable named output.

Question 9

+1.5 marksNumerical answer

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 = 220 bytes and 1 KiB = 210 bytes.

Show answer

Correct answer: 32768

Question 10

+1.5 marksNumerical answer

Consider the following processes, all arriving at time 0 and entering the ready queue in the order shown below.

If the CPU scheduling policy is Round Robin with time quantum 3, what is the average response time?

Show answer

Correct answer: 4.5

Question 11

+2 marksOne correct option

Consider the code segment (for xv6) given below.

What are the base address and the end address of data_reg?

  1. A

    The base address is 0xE3005018, and the end address is 0xE300501A.

  2. B

    The base address is 0xE3005018, and the end address is 0xE300501B.

  3. C

    The base address is 0xE3005006, and the end address is 0xE3005009.

  4. D

    The base address is 0xE3005024, and the end address is 0xE3005027.

Show answer

Correct answer

  • B

    The base address is 0xE3005018, and the end address is 0xE300501B.

Question 12

+2 marksOne correct option

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. A

    exec → fork → wait

  2. B

    wait → fork → exec

  3. C

    fork → wait → exec

  4. D

    fork → exec → wait

Show answer

Correct answer

  • D

    fork → exec → wait

Question 13

+2 marksOne correct option

Consider the following code snippet.

Which of the following statements is correct?

  1. A

    The program creates two threads, each printing OS Lab 40 times, and Complete is printed only after both threads finish.

  2. B

    The program creates two threads, but Complete may appear before some thread outputs.

  3. C

    The program prints OS Lab exactly 40 times in total and then prints Complete.

  4. D

    The program executes the two threads sequentially because pthread_create() blocks.

Show answer

Correct answer

  • A

    The program creates two threads, each printing OS Lab 40 times, and Complete is printed only after both threads finish.

Question 14

+2 marksOne correct option

In xv6 on RISC-V, which register contains the system call number when the user process traps into the kernel?

  1. A

    a0

  2. B

    a7

  3. C

    sp

  4. D

    sepc

Show answer

Correct answer

  • B

    a7

Question 15

+2 marksOne correct option

Given the hexadecimal representation of the first few bytes of different files, identify the executable ELF file.

  1. A

    7F 45 58 45 01 01 01 00

  2. B

    7F 50 44 46 01 01 01 00

  3. C

    7F 45 4C 46 02 01 01 00

  4. D

    7F 4A 50 47 01 01 01 00

Show answer

Correct answer

  • C

    7F 45 4C 46 02 01 01 00

Question 16

+2 marksOne correct option

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. A

    0x8000000000000009

  2. B

    0x0000000000000009

  3. C

    0x0000000000000008

  4. D

    0x8000000000000008

Show answer

Correct answer

  • B

    0x0000000000000009

Question 17

+2 marksNumerical answer

Consider the following processes scheduled using FCFS.

What is the average waiting time?

Show answer

Correct answer: 4.25

Question 18

+2 marksNumerical answer

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 = 210 bytes.

Show answer

Correct answer: 524288

Question 19

+3 marksNumerical answer

Consider the following processes scheduled using non-preemptive SJF.

What is the average response time?

Show answer

Correct answer: 5.5

Question 20

+4 marksOne correct option

Consider the below plots representing the order in which the requests are serviced by different disk scheduling algorithms.

Match the above plots with the corresponding disk scheduling algorithm.

  1. A

    (1) – C-LOOK, (2) – C-SCAN, (3) – SCAN, (4) – SSTF

  2. B

    (1) – C-SCAN, (2) – FCFS, (3) – SSTF, (4) – C-LOOK

  3. C

    (1) – SSTF, (2) – SCAN, (3) – C-SCAN, (4) – C-LOOK

  4. D

    (1) – FCFS, (2) – C-LOOK, (3) – SSTF, (4) – SCAN

Show answer

Correct answer

  • B

    (1) – C-SCAN, (2) – FCFS, (3) – SSTF, (4) – C-LOOK