homework

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

Upload: siva-sagar

Post on 28-Jan-2016

212 views

Category:

Documents


0 download

DESCRIPTION

homework

TRANSCRIPT

Page 1: Homework

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

Page 2: Homework

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.

FIFO Replacement LRU Replacement Optimal ReplacementNumber of frames Page faults Page Faults Page Faults1 20 20 202 18 18 153 16 15 114 14 10 8

Page 3: Homework

5 10 8 76 10 7 77 7 7 7