, , , , , , , , , ,

[SOLVED] Assignment 5: disk scheduling simulation csc 139 operating system principles

$25

File Name: Assignment_5:_disk_scheduling_simulation_csc_139_operating_system_principles.zip
File Size: 715.92 KB

5/5 - (1 vote)

In this assignment, you will implement three different algorithms for scheduling the disk head on a hard disk. That is, you will simulate the motion of the disk head by taking a set of requests for cylinders/tracks to read and then determining the order in which they will be read. You will then report the total “distance” the disk head had to travel.The disk scheduling algorithms to implement in this assignment are first-come-first-served (FCFS), shortestseek-time-first (SSTF), and LOOK. The detailed algorithms are already described in class slides and textbook Chapter 10.2.1     Part AWrite a C program called fcfs.c that implements the FCFS disk scheduling algorithm. Assume the disk arm starts at cylinder/track 50. The set of “requests” to the disk (cylinders/tracks to be read) should be provided as command-line arguments to your program (note: it is safe for your program to assume that the inputs are all well-formed integers between 0 and 100). The output of your program should show the order in which the cylinders/tracks are read, and the total distance traveled. For instance, if your program were executed like this:./fcfs 5 28 10 7 39 20 45 67 36 35, then the output should look like this:Reading track 5Reading track 28Reading track 10Reading track 7Reading track 39Reading track 20Reading track 45Reading track 67Reading track 36Reading track 35Total distance: 21912.2     Part BWrite a C program called sstf.c that implements the SSTF disk scheduling algorithm. As in Part A, the set of “requests” to the disk (cylinders/tracks to be read) should be provided as command-line arguments to your program, and the output of your program should show the order in which the cylinders/tracks are read, and the total distance traveled. Assume the disk arm starts at cylinder/track 50.Note: the SSTF algorithm looks for the track closest to where the disk arm currently is positioned, not to where it started. In the case where two tracks are both equally as close to the current position, you can choose either one (the higher one or the lower one), as long as it’s a “local” decision (i.e., you do not consider what you’ll do after that).2.3     Part CWrite a C program called look.c that implements the LOOK disk scheduling algorithm. As in Parts A and B, the set of “requests” to the disk (cylinders/tracks to be read) should be provided as command-line arguments to your program, and the output of your program should show the order in which the cylinders/tracks are read, and the total distance traveled. Assume the disk arm starts at cylinder/track 50.Note: assume that the disk arm is moving down at the start of your program.Make sure your code can be compiled and work on Athena server correctly. Upload to Canvas the following: • All source codes/files that you have added/modified and the demonstrative results.Assuming you are in the directory <ECS username>-asgmt5 do the following:tar -cvf <ECS username>-asgmt5.tar ./<ECS username>-asgmt5tar -tvf <ECS username>-asgmt5.tar2

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] Assignment 5: disk scheduling simulation csc 139 operating system principles
$25