Starting from:
$30

$24

Operating System Lab Assignment 10 Solution

Q1) DESCRIPTION : One of the responsibilities of the operating system is to use the hardware efficiently. For the disk drives, meeting this responsibility entails having fast access time and large disk bandwidth. Both the access time and the bandwidth can be improved by managing the order in which disk I/O requests are serviced which is called as disk scheduling. The simplest form of disk scheduling is, of course, the first-come first-served (FCFS) algorithm. This algorithm is intrinsically fair, but it generally does not provide the fastest service. In SSTF (Shortest Seek Time First), after a request, go to the closest request in the work queue, regardless of direction reduces total seek time compared to FCFS. In the SCAN algorithm, the disk arm starts at one end, and moves towards the other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk. At the other end, the direction of head movement is reversed, and servicing continues. The head continuously scans back and forth across the disk. C-SCAN is a variant of SCAN designed to provide a more uniform wait time. Like SCAN, C-SCAN moves the head from one end of the disk to the other,servicing requests along the way. When the head reaches the other end, however, it immediately returns to the beginning of the disk without servicing any requests on the return trip.




Work Queue : 95, 180, 34, 119, 11, 123, 62, 64

There are 200 cylinders numbered from 0 – 199

The disk head stars at number 50







Write a C program to simulate disk scheduling algorithms




a) FCFS b) SCAN c) C-SCAN d) SSTF




Calculate total head movement (THM) of the disk for each algorithm. Assuming a seek rate of 5 milliseconds , compute the seek time using the




formula:







Seek time = THM * 5 ms

More products