Os 2022

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Roll No..

TCS-502
B. TECH. (CSE/IT) (FIFTH SEMESTER)
END SEMESTER EXAMINATION, Dec., 2022
OPERATING SYSTEMS
Time : Three Hours
Maximum Marks: 100
Note : (i) AH questions are compulsory. "
(ii) Answer any two sub-questions among (a), (b) and (c) in each main
question.
(iii) Total marks in each main question are twenty.
(iv) Each sub-question carries 10 marks.

i. (a) Suppose you try to enforce mutual exclusion as follows :

Process 1 : Process 2 :
while (true) { while (true) {
while (p2_in_crit_secr=true) while (pl_in_crit_sect=true)
;/* do nothing */ ;/* do nothing */
pl _in_crit_sect = true; p2Jn_crit_sect = true;
...critical section... ...critical section...
pl„in_crit_sect = false; p2Jn_crit__sect = false;
} }

Does this code always enforce mutual exclusion ? Justify your answer.

p. r. a
(2) TCS-502

(b) A sequential file is stored in a disk occupying 100 contiguous disk


blocks. The disk has an average rotational day of 2.5 ms. The time taken
to seek the head of the drive the required cylinder is 25 cm and the time
taken to read a block is 0.25 ms. Find the minimum, maximum and
average time to search for a record using a linear search process.
(c) At an instant, the resource allocation state in a system is as follows :
4 processes P1-P4

4 resource types : R1-R4

R1 (6 instances), R2 (4 instances), R3 (3 instances), R4 (3 instances)


Snapshot at time TO : ‘ *

Allocation Request

R1 B2 R3 R4 R1 R2 R3 R4 .

Pl 1 1 0 0 5 1 3 2
P2 2 ; 1 1 1 2 1 0 2
P3 0 0 2 1 2 0 0 1
P4 1 1 0 0 5 2 3 3
----- -—
Run the deadlock detection algorithm and test whether the system is
deadlocked or not. If it is, identify the processes that are deadlocked.

2. (a) What is a race condition in critical section ? Explain how a critical

section avoids this condition. Explain all conditions that satisfy the
solution to critical problem.
(3)
TCS-502

(b) The GEU memory architecture design team has a dilemma. The team is
considering several different memory configuration variations for an
upcoming machine design. Consider the following designs (All memory
accesses are in terms of bytes, and all are using paging techniques) :
p--------- -----------
Characteristic Design 1 Design 2
Physical Memory Address Width 10 bits 24 bits
Logical Address Width 16 bits 24 bits
Page/Frame size in bytes 8 bytes 16 bytes
Page Table Type Singe Double

• For each design, list the maximum number of pages each process
can access in logical address space.

• For each design, list the maximum number of frames in physical


memory..

• Comment on which design is better in terms of les fragmentation


with suitable example.
(c) Consider the following table :

Process i
Arrival Time Burst Time Priority
1 01 10 3
2 03 07 2
3 04 04 4
4 02 09 , 1

P. T, O.
TCS-502
(4)

For each of the following scheduling algorithms, determine the waiting


time and turnaround time for each process along with CPU utilization

for all jobs:


• Shortest remaining time first (SJFS)
• Priority scheduling (with preemption considering lower the number

higher the priority).


What is the difference between process and threads ? Explain different
3. (a)
types of threads with their advantages and disadvantages.
How many page-faults would occur for the following reference string,
(b)
for three page frame using LRU and Optimal algorithms t
1,2, 3,4, 5, 5, 3,4, 6, 7, 8, 7, 3, 9, 7, 6,4, 5,4, 5, 4, 2

(c)
Max
Allocation
Process
A B c D A B c D

0 0 1 2
0 0 1 2
P0
1 7 5 0
1 0 0 0
Pl
2 3 5 6
1 3 5 4
P2
0 6 5 2
0 6 3 2
P3
4 6 5
P4 0 0 1

Let the available number of resources be given AVAIL vector as


(1. 5,2,0). Use Bankers algorithm and answer following:

• What is the “Need Matrix” ?


• Determine whether system is in safe state or not ?
(5)
TCS-502

4. (a) What is the cause of thrashing ? How does the system detect thrashing ?

Once it detects thrashing, what can the system do to eliminate this

problem ?

(b) Consider a memoty management system that uses simple paging

strategy and employs registers to speed up page lookups. The

associative registers have a lookup performance of 5O.ns and a hit ratio


of 90%. The main-memory-page-table lookup takes 750 ns. Compute

the effective memory access time.

(C) A certain moving arm disk storage, with one head, has the following

specifications:

• Number of tracks/recording surface = 200

• Disk rotation speed = 2400 rpm

• Track storage capacity = 62,500 bits

Find the average latency of this device is P ms and the data transfer rate

is Q bits/sec.

5. (a) Draw and explain seven state diagram of process life cycle. Also list the

schedulers used at various transitions with their purposes.

(b) Suppose that a disk drive has 6000 cylinders, numbered 0 to 5999. The

drive is currently serving a request at cylinder 143, and the previous

request was at cylinder 125. The queue of pending requests, in-order is :

86, 1470, 1913, 1774, 948, 1509, 1022, 1750,130, 92,10, 121

P. T. O,
(6) TCS-502

Starting from the current head position, what is the total distance (in
cylinders) that the disk arm moves to satisfy all the pending requests,
for each of the following disk-scheduling algorithms ?

• C-SCAN

• LOOK

(c) Given below the set of reference string, find the number of frames to be
allotted to a process P using working set window algorithm considering
window size and working set is 4.

Ref String : 1, 2, 3, 1, 2, 3, 1, 2, 4, 1, 4, 2, 1, 5, 1, 2, 4, 2, 1, 4, 3, 2, 5, 3,
2,3

TO
TCS-502

You might also like