You are on page 1of 2

1) Assume, you are designing a multiprocessor operating system to run many parallel

applications (multiple processors at the same to speed up their computation). Recall that the
default Linux scheduler uses one ready queue per processor, with each processor making
independent scheduling decisions by picking processes to execute from its own ready queue.
How do you change this default design to improve the performance of the system?

2) Look at the set of instructions given below. Which of the following instructions should be
privileged and only allowed to execute in kernel mode? Briefly justify your answer.
a) Load a value from a memory address to a general-purpose register.
b) Halt the CPU.
3)

Consider the following set of jobs. What would be the average waiting time and turnaround
time if the following scheduling policies are used: (i) Shortest- Remaining- Time- First (ii)
Round Robin Scheduling? Show the Gantt chart and all calculations. Assume Time
quantum is 3 units. Ignore the context switch time.

Process Burst Time Arrival Time

P1 9 1

P2 12 0

P3 3 3

P4 8 4

4) Consider there are four students staying in a drawing room. As a part of an assignment,
they need to draw a diagram. For this, they have four resources namely: A pencil, A Pen, A
sharpener and an eraser.

All the students are trying to complete the homework by drawing the diagram. The students
are named as S1, S2, S3 and S4.

S1 holds nothing but wants a Pen


S2 holds a sharpener and wants a pencil
S3 holds an eraser and wants a pencil and sharpener
S4 holds a pencil and wants a sharpener
a. Sketch the resource allocation graph
b. Sketch the wait for graph.
c. Sketch the cycle if any.
d. Determine whether the state is in deadlock or not and show the process and resources
involved in the deadlock.

5) Consider a scenario in which a set of philosophers are waiting for the operations. For
successful completion of operation, every philosopher requires two resources. Develop
pseudocode / algorithm for the following operations.

I. Philosophers can raise a request for the accessible resources.


II. Requested resource will be allocated only if no adjacent philosopher is made request
for the same resource.
III. On completion of the operation, a signal must be given to philosophers who are
waiting for the resources.
IV. Every resource must show its status and along with request details to other
philosophers
6) (I) Consider a reference string: 2, 7, 4, 5, 7, 6, 1, 7, 6, 1, 8, 2, 7, 2, 4 the number of frames
in the memory is 3. Find out the number of page faults respective to:
a) Optimal Page Replacement Algorithm
b) LRU Page Replacement Algorithm

(II) Consider a swapping system in which memory consists of the following block sizes in
memory order: 10 KB, 4 KB, 20 KB, 18 KB, 7 KB, 9 KB, 12 KB, and 15 KB.
For first fit, identify the hole that is taken for successive segment requests of
(a) 8 KB
(b) 12 KB
(c) 7 KB

7) Suppose there are, files named pgm1, stack, count, home, trsh, host, web. Suppose the file
named ‘stack’ is starting from the 12th block and the length of the file is 8. Illustrate it is
with contiguous and indexed allocation scheme.

You might also like