CSCE 451/851 Operating Systems Principles: Steve Goddard
CSCE 451/851 Operating Systems Principles: Steve Goddard
CSCE 451/851 Operating Systems Principles: Steve Goddard
http://www.cse.unl.edu/~goddard/Courses/CSCE451
» Memory is volatile
➭ disks as long term storage
❖ files
[email protected]
2
Operating Systems Principles
Steve Goddard
Lecture 15
CSCE 451/851
CSCE 451/851
Steve Goddard
CSCE 451/851
Steve Goddard Lecture 15 Page 2
Anatomy of a Disk Anatomy of a Disk
Basic components Example: Seagate 9GB Fast/Wide/Differential SCSI disk
Spindle
3 4
...
s–1 0 1
◆ Read/write the sector as possible to block n
1
» “transfer time”
0
5 6
9 10
13 14
◆ Create a non-data block for each file called the index block
» A list of pointers to file blocks
◆ Directory entry is a pointer to the index block
◆ Multilevel index blocks
◆ Pluses ◆ Minuses
» Easy to create, grow & » Overhead of storing index
shrink files when files are small
» No fragmentation » How to handle large files?
» Supports direct access
15 16
n2
Data
Blocks
2nd Level
Indirection
Block
◆ Medium size files n3
» An indirection block Data
Blocks
3rd Level
Indirection
Block
17 18
Disk
0 25 50 75 100 125 150
CPU
Other
I/O
◆ Greedy scheduling: shortest seek time first ◆ Rearrange queue from: 150 16 147 14 72 83
» Rearrange queue from: 150 16 147 14 72 83 To: 16 14 72 83 147 150
To: 72 83 147 150 16 14
0 25 50 75 100 125 150
0 25 50 75 100 125 150
◆ SCAN scheduling
» Move the head in one direction until all requests have been
◆ SSTF results in the head moving 221 tracks serviced and then reverse
» Can we do better? » Results in the head moving 187 tracks
21 22
1 2 3
◆ LOOK scheduling
» C-SCAN except the head is reset when no more requests exist
between the current head position and the approaching edge of
the disk
23 24