Ch9 Mass Storage
Ch9 Mass Storage
Operating Systems
CS 340
1
Term 1 - 1446
Chapter-9
Mass Storage Structure
(covered in chapter 10 of textbook)
Introduction
Chapter 9: Mass Storage Structure
3
OBJECTIVES:
4
Overview
5
Moving-head Disk Mechanism
❑Each disk platter has a
flat circular shape, like a
CD
❑The surface of a platter
is logically divided into
circular tracks, which
are subdivided into
sectors.
❑ The set of tracks that
are at one arm position
makes up a cylinder.
6
Overview of Mass Storage Structure
8
Disk Structure
9
Disk Structure
❑ The 1-D array of logical blocks is mapped into the sectors of the disk
sequentially
➢ Sector 0 is the first sector of the first track on the outermost
cylinder
➢ Mapping proceeds in order through that track, then the rest of
the tracks in that cylinder, and then through the rest of the
cylinders from outermost to innermost
10
Disk Scheduling
11
Disk Scheduling
❑ The operating system is responsible for using hardware efficiently
➢ for the disk drives>> this means having a fast access time and large
disk bandwidth
13
Disk Scheduling Algorithms
❑ Algorithm (1): FCFS (first-come, first-served):
❖ (slowly & simple)
❖ EXAMPLE:
• A disk drive has 200 cylinders,
• The queue of pending requests is:
98, 183, 37, 122, 14, 124, 65, 67
• The current head position= 53
awww
oooo
Head movement sequence: 53 » 98 » 183 » 37 » 122 » 14 » 124 » 65 » 67
The total seek distance = ∑ │ current position- next position│
= 45 +85 + 146 + 85 +108+110 +59+2 =640 cylinders.
14
Disk Scheduling Algorithms
❑ Algorithm (2): SSTF (shortest-seek-time-first) algorithm
❖ Selects the request with the minimum seek time from the
current head position (i.e. service all the requests close to the
current head position before moving the head far away to service
other requests)
15
Disk Scheduling Algorithms (Cont.)
❖ EXAMPLE: SSTF algorithm
• A disk drive has 200 cylinders,
• The queue of pending requests is:
98, 183, 37, 122, 14, 124, 65, 67
u
• The current head position= 53
16
Disk Scheduling Algorithms (Cont.)
➢ Algorithm (3): SCAN algorithm
o The disk arm starts at one end of the disk, and moves toward the
other end, servicing requests until it gets to the other end of the
disk, where the head movement is reversed and servicing
continues.
17
Disk Scheduling Algorithms (Cont.)
❖ EXAMPLE: SCAN algorithm
• A disk drive has 200 cylinders
(0-199)
• The queue of pending requests is:
98, 183, 37, 122, 14, 124, 65, 67
• The current head position= 53
19