” UNIVERSITY
Anply Knowledge. Improve Life!"
QUESTION PAPER
Name of the Examination: CAT (FALL 2022-2023)
Course Code: CSE2008 Course Title: Operating Systems
Slot: B1+TB1 Date of Exam: 01.11.2022
Duration: 90 min Total Marks: 50,
Instructions:
Qu.
a
1. Assume data wherever necessary.
2. Any assumptions made should be clearly stated
Answer the following questions on the fork. Draw the process hierarchy to represent the
process creation. (545M)
a. void main be -main(){
td. print("a\n"
inti=0j if{fork() == OXprint("b\n");
for i= 0; fork(i+#)( if{fork() == O}fprint("e\n")
itt== 5 exit()) i
exit())) print{“d\n");print(“e\n")exit();}
print(“f\n");print{“e\n”);exit();)
Hi times fork() Is invoked?
Sr aries tore) Wicked Mention the process. hierarchy
and output.
Four processes, P100, P200, P300 and P400, are executing, and the below-mentioned table
depicts their arrival time and burst time, respectively. (sMssM)
PID ‘Arrival Time (in ms) Burst Time (in ms)
Pain ° 3
Pam 1 6
Pao 4 4
Peo 6 2
Find the average waiting time and average turnaround time of the above processes using :
a. FCFS scheduling
b. Round Robin scheduling with time quantum = 2 ms (Also depict the ready queue).
Q3.
‘a. Five processes, P1, P2, P3, Pé and PS, arrive at the same time at t= 0, with execution times as
Sms, 24ms, 16ms, 10ms and 3ms, respectively, Find the average turn-around time and
average waiting time using Shortest Job First (SIF) scheduling algorithm (in ms). (6M)
b. During the process execution, it was pre-empted due to a timer interrupt. State the logical
process of context switching, handling of interrupt requests and fetching of Interrupt Service
Routine from interrupt Vector Table and resumption of the said process again. (am)
Page 2 of 2O.
‘a Assuming Px and Py are two concurrent processes on a time-sharing OS. Which properties
of synchronization (Mutual Exclusion, Progress and Bounded Wait) are satisfied? Mention,
the violations of properties using suitable reasons. Initially, the value of x and y are False,
(6m)
Px) Pil)
while(1){ while(M
boolean x= True; boolean y= True;
while(y); whiletxls
/**Critical Section**/} /**Critical Section**/
x= False;} y= False;}
b. What is the drawback of the “Strict Alteration” technique using the turn variable resolved In
Peterson’s solution? Explain the significance of the flag variable in Peterson’s solution using
examples. [am]
QS. Provided five processes PO, P1, P2, P3, P& and PS and four types of resources A, B, GD. There are
in total six instances of resource A, seven instances of resource B, twelve instances of resource C
and twelve instances of resource D. The current allocation of resources and maximum
requirement is mentioned in the below table. (10m)
Using Banker’ algorithm, answer the following questions:
Process 1D Allocation Max ‘Available
ABC OD ABC OD ABC
PO oo 1 2 a ee aa aa)
PI 2,0 0 0 275 0
P2 00 3 4 6 6 5 6
P3 23 5 4 43 5 6
Pa Om SE 2 0 52
Tol | 46 2D
1) Compute X and Yin the available mat
Ii Find ifthe system isin a safe state? Find
the need matrix and the safe sequence.
ii) P3is requesting (0,1,0,0). Check whether it can be granted immediately or not. if yes, get
the new snapshot and dey
whether the state is safe or not.
cp MapeING
Q.No. | Module Number | CO Mapped F = PSO Mapped | Marks
a i T 2] hb? Tt 10
@ z 12 23 | bas [33 10
@ 2 T2 33] Ea3 | a8 10 |
a 3 Z3 | 2sa pane] 0234 | 10
Oo 3 23 [3341234] 2254 | 10
Page 2 of 2VIT-AP
UNIVERSITY
‘Apply Knowledge. Dhprove Life!”
QUESTION PAPER
Name of the Examination: CAT (FALL 2022-2023)
Course Code: CSE2008 Course Title: Operating Systems
Slot: C14TC1 Date of Exam: 03/12/2022
Duration: 90 min Total Marks: 50
Instructions:
1. Assume data wherever necessary
2. Any assumptions made should be clearly stated.
Ql. a) Describe differences between hard real-time and soft real-time OS with examples.
(5M)
b) A process executes the following code. What is the output of the executed code?
Hinclude
int mainQ) «M)
ee
ints
for (i
{
if(i%2==0)
fork(;
}
return 0; }
Q2. Assume you have the following jobs shown in the table to execute with one processor.
Calculate the average waiting time and average turnaround time for the following algorithms.
(D Shortest Remaining Time First (ii) Priority Scheduling (lowest number denotes highest
i<10; +4)
priority), om)
Arrival Time | Burst Time Priority
Process (ms) (ms)
Po 2 10 3
Pi T T 1
Pr 0 2 3
Ps 3 1 4
Pa 4 3 2
Q3. (a) Why context switching is considered to be an overhead to the system? Explain with a
suitable example, (SM)
(b) What is the main issue with multilevel queue scheduling? How feedback multilevel
queue scheduling resolving this issue? Explain in detail with a suitable diagram. (SM)
Page Lof2Q4, The P and V operations on counting semaphores, where s is a counting semaphore, are
defined is as follows.
P(s)is= 5-15
if (s <0) then walt;
V(s):5= 544;
if (s <=0) then wake up a process waiting on s;
‘Assume that Pb and Vb the wait and signal operations on binary semaphores are provided. Two
binary semaphores Xb and Yb are used to implement the semaphore operations P(s) and V(s) as
follows:
P(s) : Pb(Xb);,
28-1; Vis): Pb(Xb) ;
if(s<0}t .
Vb (Xb) seni
ceo 3 if (s <=0) Vb(Yb) ;
else Vb(Xb); ‘Vb (Xb) ;
Find out the initial values of Xb and Yb. [10M]
From the RAG given above find the following points:
a. Identify the process which is in running state.
b, Find the processes are in deadlock or not. If not, find the safe sequence. (SM+5M)
)P MAPPING
Module PO PEO
QNo. | Number moe Mapped | Mapped | Mappea | Maris
Qi 1 1 1,2 1,2 1,2 10
@ z 12 33 12,3 2,3 10
3 2 1,2 2,3 1,2,3 2,3 10
Of 3 2,3 23,4 | 234 | 4234 10
Oe 3 2,3 23,4] 234 | 1234 10
Page 2 of 2a VIT-A
UNIVERSITY
“Apply Knowledge. Improve Life™
QUESTION PAPER
Name of the Examination: FALL 2022-2023 - FAT
Course Code: CSE2008 Course Title: Operating Systems
92.12.2022 FN (At)
Set number: 3 Date of Exam:
Duration: 420 min Total Marks: 60
QI. (@) Consider the following set of processes, with the length of CPU burst in milliseconds.
Draw a Gantt chart that illustrates the execution of these processes using the preemptive
shortest job first (SIF) algorithm. Find the average waiting time.
Drew a Gantt chart that illustrate the execution of these processes using preemptive
priority scheduling algorithm, Given priority of each process is PI= 4, P2=3, P3=5, P4=
1 and PS= 2. (Lowest number indicates highest priority), Also find the average waiting
time, [8m]
| —eocess | arrival time. | —auretine |. ae
PL 0 10
me | 2 2
pa 3 “
Pa 6 16
PS 3 5
(b) Explain how time quantum value and context switching time affect each other, in a
round-robin scheduling algorithm. Justify with an example. (4M)
Q2. (@) Explain with the help of supporting diagram how TLB improves the performance of
a demand paging system. What is effective access time? Compute it for 70% hit ratio, 20
1s to search TLB and 100 ns to aovess memory. Observe the difference when itis changed
to 90% hit ratio. om
(b) Why are the logical addtess space anid physical address ‘space are represented in the: ~~~
power of 2 in operating system? Between paging and segmentation which one is faster
and why? [6m]
Page Lof23. (@) Assume the memory is divided into five pastitions with size 250 KB, 400 KB, 360
KB, 500 KB, and 180 KB (in order), Calculate the total internal fragmentation when the
processes with size 315 KB, 221 KB, 135 KB, and 284 KB (in order) are placed with
§) First-Fit algorithm
ii) Best-Fit algorithm (6M)
(©) Consider a machine with 64 MB physical memory and a 32-bit virtual address space.
Ifthe page size is 4KB, what is the approximate size of the page table? [6M]
Qt (@) Consider the following page reference string 2,4,3,5,42,6,7.42,3,4,2,7,143,2,34,7.
Determine the best page replacement algorithm for this string with frame size of 3.
‘Assume the frames are empty initially. [6M]
(6) Describe the different file allocation methods. Explain the linked allocation of file
implementation with merits and demerits. [6M]
5. (@) Consider a disk with a secto’ size of 512 bytes, 50 sectors per track, 2000 tracks per
‘surface, five double sided platters and average seek time is 10 milliseconds. If T is the
capacity of a track in bytes and S is the capacity of each surface in bytes then find the
values of T and S in KB. (om)
(b) Consider the track requests in the disk queue 23, 89, 132, 42, 187, 110, 80, 30, 25
(Assume disk head is at 92). Tracks start from 0 to 200. Explain and compute the total
head movement using the following disk scheduling algorithms. (i) SSTF (li) C-LOOK
(Assume that direction is let wherever necessary). [6M]
MAPPING
Module co PO PEO Mark:
Q.No. | Number | Mapped Mapped Mapped mel Ceoomanre alata
POS, POS, POS, PSOT, PSO2,
a 2 CO4 | pos.poi0, por? | PECL PEOS | __pso4 |
PO3, PO3, POS, | pa PSOI, PSO3,
@ i cos | 905,010, POL2 | PEO! PEO3 | _pso3, psod_|_!?
PO2, PO3, PO4, PSO1, PSO2,
g ‘ cos | por'poi,poti| £03 |_psos,pso4_|_!?
PO2, PO3, PO4
cos, BEOR PSO1, PSO2,
a4 5 C06 Lia hel PEO3, PEO4 PSO3, PSO4 12
PO2, PO3, POS, PSOT, PSO3, | 15 |
& g co7_| polo, Po12 FEO! PSO4 ®
Page 2 of 2‘ay VIT-AP
UNIVERSITY
‘Apply Knowledge. Iniprove Life!”
QUESTION PAPER
Name of the Examination: FALL 2022-2023 - FAT
Course Code: CSE2008 Course Title: Operating System: A
set number: ate of exam 20-12. 202.2 FAV(BD
Duration: 120 Minutes Total Marks: 60
QI. Consider the following processes with their arrival time and length of the burst given in
milliseconds, Calculate the average turnaround time and average waiting time using
(a) Shortest remaining time first (6m)
(b) Preemptive priority scheduling algorithm (em)
Note: Smaller the number, higher the priority
[ Process | arrivaltime | Burst Time | Priority
a | o 10 5
>) 5 2
P3 2 3 1
Pa 5 20 4 s
PS 10 2 3
Q2. (a) Given five memory partitions of 100 kb, 500, Kb, 200 Kb, 300 Kb, 600 Kb (in order).
Perform the first flt, best fit and worst ft for processes with size 212 Kb, 417 Kb, 112 Kb, and 426
kb (In order). Which algorithm makes the efficient use of memory? (em)
(b) What Is internal and external fragmentation? Explain with example (sm)
Q3. (a) Consider a paging system with 16 MB of Physical memory, 256 pages of logical address space
and a page size of 1 KB.
i) How many bits are required in logical address space?
if) How many memories space is required for a frame?
ii) What Is the size of the page table? (6m)
(b) Consider a paging system with Translation lookaside buffer (TLB). Time for searching the entry
in TLB is 50 ns with 80% hit ratlo, and 750 ns to access the main memory. Calculate the effective
access time. (em)
Page 1 of 2Q4. (a) Given reference to the following pages by @ program
0,9,0,1,8, 2,8, 7,8, 7, 4, 2,8 2,7,8 2,383
How many pages fault will occur f optimal page replacement and least recently used algorithms
are used. Consider, 3-page frames are available, (6m)
(b) llustrate how pages are loaded into memory using demand paging. Also, provide the steps in
handling a page fault with the help of diagram. (6m)
Q5. (a) Consider a disk pack with following specifications- 5 platters, 2 surface, 512 track per surface,
128 sectors per track and 256 bytes per sector.
1) What Is the capacity of the 1 platter? Calculate the total number of tracks. Also, find out
how many bits are required to address the sectors in the disk (mM)
il) What is the average access time in millisecond for transferring 512 bytes of data, with
average seek time of 5 ms and disk rotation of 3000 RPM. (5m)
(b) There are 200 tracks on a disk platter and the pending requests have come in the order- 36,
69, 167, 76, 42, 54, 126, 12, and 199, Assume the read/write head is at 100th track and moving
‘towards track 200. If the sequence of the disc access is 126, 167, 199, 12, 36, 42, 51, 69 and 76
then which dise access scheduling policy is used? Explain the answer with representation of the
working of the algorithm. (4m)
cpmarens
cane. | Mette Teo nanped | yay | yZeSay | s0Mapped | — mars
ap [os 25 aes STS
[a 4 5 2,34,7 3 1,2,3, 4 12
a
a4 5 6 2,5,8,10 34 12 12
eee sana iz @
Page 2 of 2@ VIT-AP
ssc: UNIVERSITY
Apply Knowledge. Improve Life!"
QUESTION PAPER
Name of the Examination: FALL 2022-2023 - FAT
‘Course Code: CSE2008 Course Title: Operating System q
Set number 8 bate oftxam: 20: 12.2022. AN (Ba,
‘Duration: 120 Minutes Total Marks: 60
QU. (@) Consider the following arrival time and CPU burst time (in ms) for four processes in a system,
Process Aurival time CPU burst time
PI 8
P2 5
3 x
Pa 4
faverage turnaround time is 11 ms using FCFS scheduling elgorithm, then determine the value
ofx. (6M
(©) A server system uses a round robin scheduling where “s” represents a context switch and
“u” represents time slice of the round robin policy. If" represents the average time a
process executes before blocking on V/O, compute the CPU efficiency for the following
conditions
i, Wr il, ptendsto infinity iii, s