Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT "DEGREE LEVEL : OPERATING SYSTEMS (COMPUTER
BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
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?
What is the absolute path of the file README.md?
Solution
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?
- 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?
Solution
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?
Solution
Consider the following program. Assume execlp succeeds.

Which output order is guaranteed?
Which output order is guaranteed?
Solution
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.
- 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.
Solution
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?
turn = 1
Which of the following statements are correct?
Solution
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?
Initial value: counter = 150
Which of the following can be the possible final values of counter?
Solution
Choose all correct statements regarding compiling and linking multiple C source files using gcc.
Solution
Inscript
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.
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.
Solution
Inscript
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?
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?
Solution
Consider the code segment (for xv6) given below.

What are the base address and the end address of data_reg?
What are the base address and the end address of data_reg?
Solution
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?
Solution
Consider the following code snippet.

Which of the following statements is correct?
Which of the following statements is correct?
Solution
In xv6 on RISC-V, which register contains the system call number when the user process traps into the kernel?
Solution
Given the hexadecimal representation of the first few bytes of different files, identify the executable ELF file.
Solution
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?
Solution
Inscript
Consider the following processes scheduled using FCFS.

What is the average waiting time?
Consider the following processes scheduled using FCFS.
What is the average waiting time?
Solution
Inscript
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.
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.
Solution
Inscript
Consider the following processes scheduled using non-preemptive SJF.

What is the average response time?
Consider the following processes scheduled using non-preemptive SJF.
What is the average response time?
Solution
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.
Match the above plots with the corresponding disk scheduling algorithm.
Solution
Shape
Thickness [ / ]
3
All colors