Homework

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1.

virtual address is 41423,


page size is 4k = 4*1024 = 4096 bytes
41423 = 10 pages and offset 463 bytes.
Physical address = (7*4096) + 463 = 29135
2. virtual address is 51874,
page size is 4k = 4*1024 = 4096 bytes
51874 = 12 pages and offset 2722 bytes
Physical address = (6*4096) + 2722 = 27298
3. Given queue = 181,39,93,129,14,124,157,59,62

Head starts at 127


a. FCFS and SSTF
FCFS is first come first served algorithm. The cylinder first comes is served first.
127,181,39,93,129,14,124,157,59,62
SSTF is shortest seeking time first algorithm. This algorithm selects the request with the least
seek time from the current head position and serves.
127,129,124,93,62,59,39,14,157,181
b. SCAN algorithm first services all the requests going up and then reversing to service
requests the other way. In this algorithm, the disk arm starts at one end of the disk and moves
toward 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.
127,124,93,62,59,39,14,0,129,157,181
LOOK algorithm is similar to SCAN, here the arm goes as far as the final request in each
direction. Here the requests smaller than head start are serviced first and the requests greater
than head start are serviced next.
127,124,93,62,59,39,14,129,157,181
c. LOOK algorithm is similar to SCAN, here the arm goes as far as the final request in each
direction. Here the requests smaller than head start are serviced first and the requests greater
than head start are serviced next.
127,124,93,62,59,39,14,129,157,181
C-LOOK scheduling algorithm is similar to C-SCAN. Arm only goes as far as the last
request in each direction, then reverses direction immediately, without first going all the way
to the end of the disk. Requests that are greater than head start are serviced first and requests
that are smaller than head start are serviced next.
127,129,157,181,14,39,59,62,93,124
4. Given page reference string:
1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6.
Number of frames
1
2
3
4

FIFO Replacement
Page faults
20
18
16
14

LRU Replacement
Page Faults
20
18
15
10

Optimal Replacement
Page Faults
20
15
11
8

5
6
7

10
10
7

8
7
7

7
7
7

You might also like