Operating System (Minor) (Csmi-301) DR B R Ambedkar National Institute of Technology, Jalandhar Solve All The Questions

You might also like

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

Assignment

OPERATING SYSTEM (MINOR) (CSMI-301)


Dr B R Ambedkar National Institute of Technology, Jalandhar
Solve all the Questions
1. Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is
currently serving a request at cylinder 2,150, and the previous request was at cylinder
1,805. The queue of pending requests, in FIFO order, is:
2,069, 1,212, 2,296, 2,800, 544, 1,618, 356, 1,523, 4,965, 3681
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?
a. FCFS
b. SSTF
c. SCAN
d. LOOK
e. C-SCAN
f. C-LOOK
2. What is disk scheduling ?
3. Explain file allocation table.
4. How Files System are organized with UNIX ? Explain with an example. 5. what is a
Deadlock? How it is detected? What are the necessary conditions for a deadlock to occur?
6. A variable portion memory system has at some point in time the following box sizes in
the order 30k,25k,10k,40k,70k,55k, a new process is to be loaded which block will be
filled using best fit, first fit, worst fit respectively.
7. What are the mechanisms to evaluate an algorithm related to CPU scheduling? Discuss
any one of them.
8. Describe the dining-philosopher’s problem and provide its solution. How will you
handle synchronization problem using hardware? Discuss
9. Discuss banker’s algorithm in detail. Also provide an example for the same. 10. What is
Deadlock Detection? Explain how to recover from deadlock? 11. What is virtual memory?
What hardware supports are needed to implement virtual
memory? Explain with the help of an example that FIFO page replacement algorithm
may encounter more number of page faults encountered by LRU page replacement
algorithm.
12. Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2,
4 and 8 time units. All processes arrive at time zero. Consider the longest remaining
time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to
the process with the lowest process id. Find the average turn around time.
13.
14.
15.
16.
17. An operating system uses Shortest Remaining Time first (SRT) process scheduling
algorithm. Consider the arrival times and execution times for the following processes:
Process Execution time Arrival time
P1 20 0
P2 25 15
P3 10 30
P4 15 45
What is the total waiting time for process P2?

18. An operating system uses shortest remaining time first scheduling algorithm for pre
emptive scheduling of processes. Consider the following set of processes with their
arrival times and CPU burst times (in milliseconds):
Process Arrival Time Burst Time
P1 0 12
P2 2 4
P3 3 6
P4 8 5
Find the average waiting time (in milliseconds) of the processes is.

19. Consider the following processes, with the arrival time and the length of the CPU
burst given in milliseconds. The scheduling algorithm used is preemptive shortest
remaining time first.

The average turnaround time of these processes is ___________ milliseconds.

20. Consider the following CPU processes with arrival times (in milliseconds) and length
of CPU bursts (in milliseconds) except for process P4 as given below: Process Arrival
Time Burst Time
P1 0 5
P2 1 1
P3 3 3
P4 4 x
If the average waiting time across all processes is 2 milliseconds and pre-emptive
shortest remaining time first scheduling algorithm is used to schedule the processes,
then find the value of x ?

21. A system has four processes and five allocatable resources. The current allocation and
maximum needs are as follows:
Allocated Maximum Available
Process A 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1
Process B 2 0 1 1 0 2 2 2 1 0
Process C 1 1 0 1 0 2 1 3 1 0
Process D 1 1 1 1 0 1 1 2 2 1
The smallest value of x for which the above system in safe state is __________.
22. Explain Earliest-Deadline-First Scheduling with proper example. 23. Consider the
following table of arrival time and burst time for three processes P0, P1 and P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried
out only at arrival or completion of processes. What is the average waiting time for the
three processes?
24. Explain Rate-Monotonic Scheduling with proper example.
25. Given six memory partitions of 300 KB, 600 KB, 350 KB, 200 KB, 750 KB, and 125
KB (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes
of size 115 KB, 500 KB, 358 KB, 200 KB, and 375 KB (in order)? Rank the
algorithms in terms of how efficiently they use memory.
26. Compare the memory organization schemes of contiguous memory allocation, pure
segmentation, and pure paging with respect to the following issues:
a. External fragmentation
b. Internal fragmentation
27. Consider a logical address space of 256 pages with a 4-KB page size, mapped onto a
physical memory of 64 frames.
a. How many bits are required in the logical address?
b. How many bits are required in the physical address?
28. Consider the following page reference string: 7, 2, 3, 1, 2, 5, 3, 4, 6, 7, 7, 1, 0, 5, 4, 6,
2, 3, 0 , 1 Assuming demand paging with three frames, how many page faults would
occur for the following replacement algorithms?
a. LRU replacement
b. FIFO replacement
c. Optimal replacement
29. What is the purpose of system calls?
30. What is the main advantage of the layered approach to system design? What are the
disadvantages of the layered approach?
Submission Date: 27/11/2020

You might also like