Docsity

Operating system notes and pdf, Cheat Sheet of Operating Systems

Toggle sidebar
bg1
Ex.No: 16a FCFS DISK SCHEDULING
AIM:
To write a program to implement the FCFS disk scheduling algorithm.
Algorithm:&
1. Let Request array represents an array storing indexes of tracks that have been requested
in ascending order of their time of arrival. ‘head’ is the position of disk head.
2. Let us one by one take the tracks in default order and calculate the absolute distance of
the track from the head.
3. Increment the total seek count with this distance.
4. Currently serviced track position now becomes the new head position.
5. Go to step 2 until all tracks in request array have not been serviced
Result :
Thus the FCFS disk scheduling is simulated and the chart is printed.
Ex.No: 16b SSTF DISK SCHEDULING
AIM:
To write a program to implement the SSTF disk scheduling algorithm.
Algorithm:
1. Let Request array represents an array storing indexes of tracks that have been requested.
‘head’ is the position of disk head.
2. Find the positive distance of all tracks in the request array from head.
3. Find a track from requested array which has not been accessed/serviced yet and has
minimum distance from head.
4. Increment the total seek count with this distance.
5. Currently serviced track position now becomes the new head position.
6. Go to step 2 until all tracks in request array have not been serviced. &
Result :
Thus the SSTF disk scheduling is simulated and the chart is printed.

Partial preview of the text

Download Operating system notes and pdf and more Cheat Sheet Operating Systems in PDF only on Docsity!

Ex.No: 16a FCFS DISK SCHEDULING AIM: To write a program to implement the FCFS disk scheduling algorithm. Algorithm:

  1. Let Request array represents an array storing indexes of tracks that have been requested in ascending order of their time of arrival. ‘head’ is the position of disk head.
  2. Let us one by one take the tracks in default order and calculate the absolute distance of the track from the head.
  3. Increment the total seek count with this distance.
  4. Currently serviced track position now becomes the new head position.
  5. Go to step 2 until all tracks in request array have not been serviced Result : Thus the FCFS disk scheduling is simulated and the chart is printed. Ex.No: 16b SSTF DISK SCHEDULING AIM: To write a program to implement the SSTF disk scheduling algorithm. Algorithm:
  6. Let Request array represents an array storing indexes of tracks that have been requested. ‘head’ is the position of disk head.
  7. Find the positive distance of all tracks in the request array from head.
  8. Find a track from requested array which has not been accessed/serviced yet and has minimum distance from head.
  9. Increment the total seek count with this distance.
  10. Currently serviced track position now becomes the new head position.
  11. Go to step 2 until all tracks in request array have not been serviced. Result : Thus the SSTF disk scheduling is simulated and the chart is printed.