OS PYQ CST 206
OS PYQ CST 206
$)
Course Code: CST206
Course Name: OPERATING SYSTEMS
Max. Marks: 100 Duration: 3 Hours
PART A
(Answer all questions; each question carries S
yy*g Marks
I what are the operations taking place when a system cail is executed? 3
2 what are multiprocessor systems? What are the advantages\of multiprocessor J
systems?
a
J Write the difference between process and thread. J
4 Differentiate between the two common models of interprocess communication. 5
5 Write the three requirements that a solution to critical-section problem must J
satisfo.
6 Explain the priority inheritance protocol for solving the priority inversion
problem.
PART B
(Answer onefull questionfrom each anodule, each question carries 14 molks)
Module -I
ll a) Explain the essential properties of the following types of operating systems: r0
i) Batch operating system
ii) Time sharing operating system
iii) Realtime operating system
iv) Distributed operating system
b) Explain the layered approach of the operating system structure.
Page I of 3
v
't
02000csT2060s2102
Module -2
l3 a) With the help of a diagram, explain the operations taking place when the CPU 7
b) Explain how the logical communication link is established and the messages are 7
system.
14 a) For the following set of processes draw the Gantt chart and find the average 9
Pl. 0 4
P2 1 2
P3 2 5
P4 3 4
I 5 a) Consider a system with four processes Pl, P2, P3, P4 and four types of resources 8
Rl, R2, R3, R4. The maximum number of instances of resources of each type
s a re 5, 7 , 7 and 7 respectively. What will be the order of
processing of jobs if th.e
allocated matrix and the maximum demiilA matrix are as given below.
RI R2 R3 R4 RI R2 R3 R{
PI 2 -) 2 J 5 6 4
P2 0 0 I 2 I J 4 6
I 4
P3 2 I
1 I 1
.P4 I 0 ? J
Page 2 of 3
't
02000csr206052102
l6 a) State dining philosopher's prcblem and give a solution using semaphores. Write 8
structure of philosopher.
b) Explain the methods for deadlock prevention. 6
Module -4
b) With the help of an example explain the concept of shared pages in a paging 5
system.
300K8, 600KB in the order and all these partitions are available. Suppose
Module -5
19 a) Explain FCFS, SSTF and SCAN disk scheduling algorithms, using the given 9
disk queue of requests: 20,89,130,45 and 180. Assume that, the disk has 200
r plaffers ranging from 0 to 199 and the current position of head is at cylinder 100.
b) Explain the different methods used for keeping track of free disk space. 5
20 a) There are 4 domains (Dl ,D2,D3, D4) and 4 objects (files - Fl,F2, F3, F4). A 7
n process executing in Dl can read and write files Fl, F3 and F4. A process in D4
can read Fl, & write F3 and executf,F2. A process inD2/D3can read F2
read
and execute F4. A process in Dl can switch to D2 or D4. A process in }1 can
switch to D3. Draw the access matrix showing all these details.
b) How can we make a new magnetic disk ready for use (to store files)? 7
tr**
Page 3 of 3
D 02000csT206062207
Reg No.:
PART A
Answer all questions, eoch canies 3 marks. Marks
I What are the major activities of an operating system with regard to file management? (3)
2 system.
Write the operations taking place during the booting of a (3)
J Explain the different buffering mechanisms used in message passing systems? (3)
4 Define the parameters for multilevel feedback queue scheduling? How it is better (3)
6 deadlocks?
Explain with an example the improper usage of semaphore causing (3)
8 Explain the terms (i) Dynamic Loading (ii) Dynamic Linking (3)
Module I
I I " (a) What is an Operating System? Explain any 3 types of Operating System. , (7\
(b) What is a system call? What are the different ways to pass parameters to system (7)
Page I of4
02000csT206062207
Module 2
13 (a) Define process. With the help of a neat diagram explain different states of (7)
process.
(b) With an example, illustrate the interprocess communication using Shared (7)
memory
OR
14 (a) Assume you have the following jobs in a system that to be executed with a (8)
single processor. Now,
PI l0 40
P2 l0 25
P3 55 30
P4 95 45
Module 3
15 (a) Explain Dining Philosophers Problem. Give a solution for the problem using (6)
monitors. .
(b) What do you mean by deadlock? WHat are the four necessary conditions for a (8)
deadlock to occur? Describe various deadlock prevention mechanisms.
OR
16 (a) What is a semaphore? Describe how semaphores can be used as a process (7)
synchron isation mechanism?
(b) Consider the following snapshot of the system with five processes Pl. P2, (7)
P3,P4,P5 and four resources A, B, C, D. Using Bankers Algorithm, check
qhether the system is in safe state or not.
Page2 of 4
02000csT206062207
P4 J 0 0 0 5 5 0 7
a
P5 4 2 I J 6 2 I 4
Module 4
17 (a) With the help of a diagram explain how logical address is translated to physical (5)
address in case of segmentation scheme.
" OR* .
l8 (a) Define Demand Paging. Explain Swapping with a neat diagram. (6)
(b) Consider a fixed partitioned memory management scheme with fixed partitions (S)
are 150K,300K,550K,400K,250K and 200K (in order). Five processes are
ready for execution each with memory requirement as Pl(240K), p2(120K),
P3(380K), P4(300K) and P5(350K). Write the allocation in each of rhe
following cases and calculate the internal fragmentation and external
fragmentation (if any) in each case.
(i) First Fit (ii) Best Fit (iii) Worst Fit
Page 3 of4
0200(rcsT2060622W
Module 5
19 (a) List out the logical structtrres of a directory with figures. (5)
(b) With neat sketches illustrate the following disk space allocation algorithms (9)
(i) Contiguous allocation (ii) Linked allocation (iii) Indexed allocation?
OR
20 (a) Discuss Protection. Write notes about the protection strategies provided for (6)
files.
(b) Consider a disk queue with requests for VO to blocks on cylinders 98, 183, (8)
41,122, 14, 124,65,67. The head is initially at cylinder number 53. The
cylinders are numbered from 0 to 199. Find out the total hcad movement
incurred while servicing these requests, if following scheduling algorithms ar€
.I
used-(i) FCFS (iD SSTF (iiD C-SCAN (iv) LooK
Page 4 of4
r EDUn\
c 02000csT206062206 d-J,^r
\,
a
RegNo.: Name:
2 How is distinction of kernel code from user code achieved at hardware level? J
't 3 How many times will 'Forked' get printed by the below code and justiff your a
J
answer.
int main0 {
fork0;
fork0;
print("Forked\n");
return 0;)
4 List and explain the various synchronous and asynchronous methods of message 3
passing in IPC.
a
5 What is meant by race condition? Explain with the help of an example. J
8 Consider a logical address space of 256 pages with a 4-KB page size, mapped onto J
a physical memoqfbf 64 frames. Find the (i) number of bits in the logical address
(ii) number of bits in the physical address (iii) number of bits in the offset part of
logicaladdress - ,*;
9 Define seek time, rotational latency and disk bandwidth of disks. J
PART B
(Answer onefull questionfrom eoch module, each question corries 14 marks)
Module -l
I I a) What is the purpose of a system call? Describe how a system call made by a user
application is handled.
Page 1 of 3
02000csr206062206
b) Explain the micro kernel approach to system design with the help of a diagram. 7
Module -2
13 a) What is meant by context switching? Illustrate the timeline of context switching 6
,l 14 a) Assume you have the following jobs shown in the table to execute with one 9
processor. Draw the Gantt chart and calculate the average waiting time and average
PI 2 5 1
P2 3 I I
P3 4 3 4
b) Explain the different states of a process and transition between them with the help 5
of 6 diagram
Module -3
15 a) What is a critical section? State and'exp*ain the conditions to be satisfied by'a 6
avoid deadlocks.
16 ,a) $rite the algorithm or pseudocode for solving the Dining-Philosophers problem 5
Page 2 of 3
02000csT206062206
r Module _5
l9 a) List and explain the difrerent access methods for files_
4
b) Describe linked ard indeled allocation methods for files
with the help of neat t0
diagrams.
20 " a) suppose that a disk drive has 200 cylindersnupbered
from 0 to 199 and the curent 9
position of the head is at cylinder 100.
For the given disk queue of requests: - 20,
89, 130, 4s, 120 and rg0, draw the head
movement in FCFS, ssrF, GSCAN disk
scheduling algorithms and compute the
total head movements (in cylinders) in
each.
Page 3 of 3
D 02000csr20605210r
Reg No.:
8 Explain the concept of virtual memory. Write one memory management scheme J
PART B
(Answer one full question from each module, eoch question camies 14 marks)
, Module -1
l1 a) Distinguish among the following terminologies associated with the operating 9
b) Explain, how the long-term scheduler directfy affects the system performance. 5
l2 a) systems.
Explain in detail about the various functions of operating 6
Page 1 of 3
02000csT206052t0t
Module -2
l3 a) A writer process like to send some bulk information to a reader process. Explain 8
the IPC mechanism that can be used for this purpose.
b) How many child process will be created for the following code ? 6
void main0 { fork0; fork0; prinr("HELLO\n,,); fork0;
printf("WELCOMEVT); )
How many times HELLO and WELCOME will be printed? Justify your answer.
,,, tO a) FivebatchjobsAthroughEarriveatacomputersystemintheorderAtoEat 12
almost the same time. They have estimated running fimes of 6, 4, 1,3, and 7
\
seconds. Their (externally determined) priorities are 3, 5, 2, l, and 4
respectively, with 5 being the highest priority. For each of the following
scheduling algorithms, determine the average process waiting time. Ignore
process switching overhead.
l\{odule -3
l5 a) Consider the following snapshot of a system with five processes Pl , P2, p3, p4, 8
P5 and fout resources A, B. C. D. \\'hat is the total number of instances of A. B.
C, and D? Using Bankers Algorithm check whether the system is in safe state
or not.
P2 0 2 t _1 4 z
P3 2 4 5 0 ? I 7
P4 '.1 0 0 0 5 5 0 I
I I
F5 4 2 J 6 ? 4
b) What is critical section problem? What are the requirements that need to be 6
satisfied by any solution to critical section problem? Give a solution to a 2
process critical section problem.
16 a) Describe the Bounded - buffer problem and give a solution for the same using 8
semaphores. write the structure of producer and consumer processes.
Page 2 of 3
02000csT206052101
b) why is deadlock state more critical than starvation? Draw the resource
6
allocationgraph(i)withdeadlock(ii)withacyclebutnodeadlock.
Module -4
|7a)Explainwiththehelpofsupportingdiagram,howtranslationlook-asidebufferS
(TLB) improves the performance of a paging system'
-b)Withadiagramwritethestepsinvolvedinhandlingapagefault.6
For a 9
l8\r, a) Consider the page reference string 1,2,3,4,2,1,5,6,2,1,2,3,7'6'3'2'l'2'3'6'
system with 3 frames compute the number of page
faults for the following page
0 L00 400
1 3700
2 700
3 2500 500 I
I
ir
4 15OO 1000
Module -5
' using the given 9
19 a) Explain FCFS, SSTF and scAN disk scheduling algorithms,
the total seek time for
disk queue of requests: 82,170,43,140,24,16,190. Find
0 to 199 and
each case.Assume that, the disk has 200 cyrinders ranging from
themostgeneralschemetoimplementidentitydependentaccess.
***
Page 3 of 3
D 0200ocsT206062204
t+-
?}
RegNo.: ol
t
APJ ABDUL KALAM TECHNOLOGICAL
B.Tech Degree 54 (S, FE) / 52 (PT) (S) Examination January
PART B
(Answer onefall questionfrom each module, each question corries 14 marks)
Mo@le -1 I
II a) Explain the features of single processor, multiprocessor and clustered systems? g
b) What do you understand by system calls? List and explain the system calls used 5
a in process control. c ir .,
12 a) Describe the services provided by an operating systems in d€tail. g
Module -2
l3 a) Draw the Gantt Chart, Calculate the average waiting time and average turnaround g
Page 1 of 3
a-v
02000csT206,062204
. time for the processes given in the table, using the following algorithms:
i) SJF iitSRTF iii) RR (time slice = 4 ms)
PI 0 l0
P2 2 6
a
P3 J 4
P4 6 2
P5 l0 8
Module -3
15 a) Discuss about any two classic problems of synchronization. How producer 8
consumer problem is solved using semaphores?
b) Describe the various methods of recovery from deadlocks. 6
16 a) Consider the following snapshot of a system with five processes pl, p2, p3, p4, I 0
P5 and four rcsources A,B,G,D. using Bankers Algorithm, find the following
Page 2 of 3
0zo(Xrcsr206062204
Module -4
17 a) Explain the First-fit, Best-fit, and Worst-fit algorithms for contiguous memory 8
allocation.
b) With a diagram, write the steps involved in handling a page fault. 6
' l8 a) Considerthereference string: 1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6. 9
Assuming demand paging with 3 frames, how many page faults would occur for:-
Module -5
19 a) Systems?
Discuss the concept of Virtual File 8
20 a) Assume that a magnetic disk has 400 cylinders (numbered 0 to 399). The cunent 9
position of the head is at cylinder 120. The request queue is 80, 130, 60,230,
100, 300, 250, and 170. Draw the head movement in each of the following disk
cheduling algorithms and compute the total head movement in each case:
(i) ssrr (ii) scAN (iiD LooK
t b) What are the different access methods of files? How are they implemented? 5
***
Page 3 of 3
D 0200csT206052402
RegNo.: Name:
Course CaiUsSeST206
Course Name: OP,$R#TING SYSTEMS
Max. Marks: 100 Duration:3 Hours
PART AI..
marks)
(Answer all questions; eucn question canies 3 Marks
4 How many times "hello" will be printed"ifter executing the following code. 3
fo*0;
fork0;
fo*0;
printf("hello\n");
)
'5 Explain the necessary conditions for a deadlock 3
6 What is a monitor? 3
'7 Explain Belady's anomaly with an exalRle? 3
l0 Define the terms seek time, rotational latency and transfer time. 3
PART B
(Answer onefall questionfrom eoch module, eoch qaestion carries 14 morhs)
Modulo-l
ll a) What is a system call? Explain any three different types of system call. 9
Page 1 of 3
9
I
0200csr206052402
Module -2
13 a) Calculate the average waiting time and tumaround time for the processes given in 9
the following table after displaying the Gantt charts for the following scheduling
algorithms
a) Non-pre-emptive SJF b) Pre-emptive SJF c) RR scheduling (time slice:4 ms)
Process Arrival time (ms) CPU burst time (ms)
P1 0 l0
n 2 6
P3 3 4
P4 6 2
P5 t0 8
Module -3
A B c A B C A B c A B c
Po 0 0 7 5 3 3 3 2
Pl 2 0 0 3 2 2
Pz 3 0 2 9 0 2
Pr 2 I I 2 2 2
Pr 0 0 2 4 3 3
Page 2 of 3
?
I
0200csT20ffi52402
b) Describe how test and set instruction can be used to provide a solution to critical 4
section problem. .
b) Explain with an example how wait for'gtrph can be used to detect a deadlock. 6
Mridul'e-4
17 t), Consider the page reference string 7,0,1,2,0,3,0,42,3,0,3,2,1,2,0,1,7,0,1. For a 9
,', system with 3 frames compute the number of page faults for the following page
replacemCnt algorithms (i) FIFO (ii) Optimal (iiD LRU
b) examples.
Differentiate internal and external fragmentqtion with suitable 5
:'.',
18 a) consider:,six memory partitions of siee'200 KB,400 KB, 600 KB, 500 KB, 300 9
KB and 2S0 KB. These partitions need to be allocated in order to four processes
' of size 357 KB, 210 KB, 468 KB, 491 I(8. Perform (i) First fit (iD Best fit (iii)
Worst fit.
b) Explain the concept of paging with TLB using suitable diagrams. 5
Module -5
19 a) Explain linked and indexed file allocation strategies mentioning each method's l0
advantages and disadvantages.
20 4 Suppose that a disk drive has 200 cylinders numbered from 0 to 199 and the cunent 9
position of the head is at cylinder 100. For the given queue of requests: - 20, E9,
, 130, 45, 120 and 180, draw the head movement in FCFS, SSTF and C-SCAN disk
scheduling algorithms and compute the total head movements (in cylinders) in
each.
Page 3 of 3
3
I