0% found this document useful (0 votes)
26 views2 pages

UNC501

Uploaded by

cdhananjay7100
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

UNC501

Uploaded by

cdhananjay7100
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Roll Number: Name:

Thapar Institute of Engineering & Technology, Patiala


(Deemed to be University)
Department of Electronics & Communication Engineering
MST- Written Test

BE- ENC / ECE UNC501: OPERATING SYSTEMS


Date- September 26, 2023
Time: 02 Hours; Max. Marks: 35 Name of Faculty: Dr. Shubhra Jain,
Dr .Chandramohan,
Dr. Ashish Soni
NOTE: * Attempt all questions
** Assume any missing information.

Qi. Discuss the need for a system call and explain any four system calls with their functionality. 4

Q2. Justify the expected output of the below program. 5


#include <stdio.h>
#include <unistd.h>
int main()
1
if (fork()) {
if (!fork()) {
fork();
printf(''l '');
1
else {
Printf("2 ");
}
1
else {
printf("3 ");
}
printf("4 ");
return 0;
}
Output:

Q3. Consider a set of five processes, P1, P2, P3, P4, and P5, with the following burst times and 7
time quantum for the round-robin scheduling algorithm:
PI: Burst Time = 24 ms
P2: Burst Time = 8 ms
P3: Burst Time = 12 ms
P4: Burst Time = 10 ms
P5: Burst Time = 16 ms
Time Quantum (TQ) = 6 ms
Assume that processes arrive in the order PI, P2, P3, P4, and 135, and that each process starts
at time 0. Calculate each process's turnaround time, waiting time, and completion time.
Q4. Consider a set of five processes, P1, P2, P3, P4, and P5, with the following burst times and 7
arrival times:
• P1: Arrival Time = 0 ms, Burst Time = 10 ms
• P2: Arrival Time = 1 ms, Burst Time = 5 ms
• P3: Arrival Time = 2 ms, Burst Time = 8 ms
• P4: Arrival Time = 3 ms, Burst Time = 3 ms
• P5: Arrival Time = 4 ms, Burst Time = 6 ms
Using the Highest Response Ratio Next (HRRN) scheduling algorithm, calculate each
process's waiting time, turnaround time, and completion time.

Q5. Illustrate the process of Deadlock and its necessary preventive measures. 5

Q6. Apply Banker's algorithm to avoid deadlock and find the safe sequence. You are 7
given a system with three resource types A, B, and C, and you have the following
information:

• Currently available resources: A = 3, B = 3, C = 2.


• Resource allocation of each process:
o Process P1: A = 0, B = 1, C = 0
o Process P2: A = 2, B = 0, C = 0
o Process P3: A = 3, B = 0, C = 2
o Process P4: A = 2, B = 1, C = 1
o Process P5: A = 0, B = 0, C = 2
• Maximum demand of each process:
o Process PI: A = 7, B = 5, C = 3
o Process P2: A = 3, B = 2, C = 2
o Process P3: A = 9, B = 0, C = 2
o Process P4: A = 4, B = 2, C = 2
o Process P5: A = 5, B = 3, C = 3

************************************ All the Best *****************************************

You might also like