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 the following solution for the critical section problem using a shared variable
.

Which of the following statements are correct?
Which of the following statements are correct?
Solution
Select all the correct statements.
Solution
Choose all the correct statements regarding compiling and linking multiple C source files using gcc
Solution
Two processes P1 and P2 are competing for two shared R1 and R2.
- P1 holds R1 and waits for R2.
- P2 holds R2 and waits for R1.
Both processes wait indefinitely and none of them can proceed.
Which of the following problem(s) is/are illustrated in the above scenario?
- P1 holds R1 and waits for R2.
- P2 holds R2 and waits for R1.
Both processes wait indefinitely and none of them can proceed.
Which of the following problem(s) is/are illustrated in the above scenario?
Solution
Given the hexadecimal representation of the first few bytes of different files, identify the executable file (ELF file) from the options below. (Hint: The ASCII value of ’E’ = 69, ’L’ = 76, and ’F’ =
70)(Hint: ELF → 45 4C 46)
70)(Hint: ELF → 45 4C 46)
Solution
Consider the below structure of the
register in a RISC-V system and the table showing the values of different exception and interrupt codes (only a subset of the table is given).

The
register is SXLEN bits wide. The MSB (most significant bit) indicates:
-
→ Interrupt
-
→ Exception
- The remaining bits store the corresponding exception/interrupt code.
If the trap was caused by a Supervisor timer interrupt, what is the value of the
register (assuming SXLEN = 64)?
The
-
-
- The remaining bits store the corresponding exception/interrupt code.
If the trap was caused by a Supervisor timer interrupt, what is the value of the
Solution
State True or False: In inter-process communication (IPC) using shared memory, the commonly used system calls are send and receive.
Solution
If the exec system call is invoked as exec("/analyze", "data.txt", "config.json", "log.txt", "result.out");, then what are the values of the argc and argv[3] respectively?
Solution
In the following code snippet, a child process is created to execute the ls -l /home command. Identify the correct system call that should be used at LINE-1.

Solution
Match the following

Solution
What is a major disadvantage of the First Come First Serve (FCFS) scheduling algorithm in operating systems?
Solution
Which of the following statements correctly describes a key difference between the First-Come- First-Serve (FCFS) and Round Robin (RR) CPU scheduling algorithms?
Solution
Assume that context switches can occur at any time during the execution of the following code snippet. The variable counter is shared between two programs. Which of the following can be the possible final values of counter?
Initial value of counter = 200

Initial value of counter = 200
Solution
Inscript
Consider the following code snippet from Bakery Algorithm.

Considering that there are 5 processes, and initially num[0]=3, num[1]=0, num[2]=5,num[3]=2, num[4]=4, If Process 3 (num[2]) starts executing its critical section and then unlocks, what will be the new value of num[2] after P3 finishes execution?
Note: Enter your answer in decimal.
Consider the following code snippet from Bakery Algorithm.
Considering that there are 5 processes, and initially num[0]=3, num[1]=0, num[2]=5,num[3]=2, num[4]=4, If Process 3 (num[2]) starts executing its critical section and then unlocks, what will be the new value of num[2] after P3 finishes execution?
Note: Enter your answer in decimal.
Solution
Inscript
Consider a set of 5 processes with the following arrival and burst times.

If the CPU scheduling policy used is Round Robin with a time quantum of 3 units, what will be the average response time?
Note: Enter your answer in decimal.
Consider a set of 5 processes with the following arrival and burst times.
If the CPU scheduling policy used is Round Robin with a time quantum of 3 units, what will be the average response time?
Note: Enter your answer in decimal.
Solution
Inscript
Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU burst times to complete.

Assuming that the system employs the First-Come-First-Served (FCFS) scheduling algorithm, what will be the average waiting time?
Note: Enter your answer in decimal.
Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU burst times to complete.
Assuming that the system employs the First-Come-First-Served (FCFS) scheduling algorithm, what will be the average waiting time?
Note: Enter your answer in decimal.
Solution
Inscript
Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU burst times:

Assuming that the system employs the Shortest Job First (SJF) scheduling algorithm, calculate the average response time.
Note: Enter your answer in decimal.
Consider a system with four processes, P1, P2, P3, and P4, arriving at different times and requiring the following CPU burst times:
Assuming that the system employs the Shortest Job First (SJF) scheduling algorithm, calculate the average response time.
Note: Enter your answer in decimal.
Solution
Shape
Thickness [ / ]
3
All colors