You are on page 1of 2

MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY, BHOPAL

DEPARTMENT OF CSE
End Term Exam, 17 Nov 2021
Course: B.Tech Semester: V Branch: CSE-I, II, III
Subject Name: Operating System Subject Code: CSE 312
Time: 02:00 PM – 5:00 PM (submit before 5:15 PM) Max. Marks: 50
Submission email ID: for CSE-1: oscse321manit2021@gmail.com
CSE-2 : oslabcse317@gmail.com
CSE-3: os2021cse3.btech@gmail.com
Note: i. Attempt all questions.
ii. Draw suitable diagram or take example for explanation.
iii. Reply and upload the answer sheet in single pdf file with filename as your scholar number, for example
(191112001.pdf)

S.No. Questions Marks


Q1 Consider the exponential average formula used to predict the length of the next CPU burst. 5
What are the implications of assigning the following values to the parameters used by the
algorithm?
a. α = 0 and τ0 = 100milliseconds
b. α = 0.99 and τ0 = 10milliseconds
Q2 Consider 5 processes A, B, C, D and E with running time of 13, 10, 5, 9 and 1 respectively 5
arrive at computer in the time order 0, 5, 7, 10, 12. If the priority of these jobs is in the
order C, B, E, A and D and the policy used for scheduling is that, a higher priority job
always succeeds in preempting. Context switching takes 1 unit of time.

a) Find the exact number of context switches needed for preemptive priority and Shortest
Remaining Time First (SRTF) CPU scheduling algorithms. (Do not count the context
switches at time 0 and at the end).
b) Compare turn-around time for preemptive priority and shortest remaining time first
CPU scheduling algorithms.

Q3 Suppose you wish to design a virtual memory system with the following characteristics: 5
• Size of page table entry is 4 bytes.
• Each page table must fit into a single page frame.
• System must be able to support virtual address space of 4 GB.
You decide to use a multilevel paging scheme with no more than two levels of page tables.
What is the minimum page size that the system must have?
Q4 Consider a scenario having fixed partition allocation scheme where each partition is of 5
size 100 kB, 500 kB, 200 kB, 300 kB and 600 kB. In these partitions, the processes that
are needed to be placed are 212 kB, 417 kB, 112 kB and 426 kB (in order). How many
partitions and which partitions will remain unallocated after placing the processes in each
of first fit, best fit and worst fit algorithm respectively. Also, which policy(s), if any, will
be successful in placing all these processes? Draw sketch diagram of each policy.

Q5 A processor uses single level page table residing in main memory and a translation look- 5
aside (TLB) for address translation. TLB lookup takes 30 ns and each main memory
access takes 200 ns. Each page transfer to/from the disk takes 4000 ns. Assume that the
TLB hit ratio is 95%, page fault rate is 10%. Assume that for 30% of the total page faults,
a dirty page has to be written back to disk before the required page is read in from disk.
Assume TLB update time is negligible. Calculate average memory access time in ns.
Q6 Explain in details magnetic disk structure. Calculate track movements by R/W head 5
using FCFS, SSTF, SCAN and CSCAN algorithms. The track request are in the sequence
93, 176, 42, 148, 27, 14, and 180. Tracks are numbered from 0 to 199 with current
head position at track number 55. (In case of SCAN, head will first move in directions
of higher track numbers).
Q7 Consider the below resource allocation graph with three processes (P1, P2, P3) and 5
three resources (R1, R2, R3). Is there deadlock or chances of deadlock in the given
graph? Also give reason for your answer.

After some time P3 requests for R3, now again check for deadlock.
Q8 As per given data and using banker’s algorithm give answers to below question, 5
Max Allocation
A B C D A D C D
P0 2 3 4 1 1 1 2 1
P1 1 0 3 3 1 0 1 1
P2 2 6 1 2 2 2 1 2
P3 3 4 0 1 1 2 0 1
Available resources (A=0, B=2, C=2, D=2)
 What are the contents of the Need matrix?
 Is the system in a safe state? If yes write safe sequence.
 How many resources of each type are there?
 Write all the safe sequences, if exists?
Q9 Explain the statement of Dining Philosopher’s problem. Find out the problem or limita- 5
tions of given solution.

Philosopher i:
do {
wait ( chopstick[i] );
wait ( chopStick[ (i + 1) % 5] );
// eat
signal ( chopstick[i] );
signal (chopstick[ (i + 1) % 5] );
// think
} while (TRUE);
Q10 Write best possible solution for producer-consumer problem with detailed steps, pseudo 5
code and explanation.

---***---

You might also like