Download presentation
Presentation is loading. Please wait.
Published byDonna Manning Modified over 9 years ago
1
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department
2
Mass Storage Structure
3
Chapter 10: Mass Storage Structure 1.Overview of Mass Storage Structure 2.Disk Structure 3.Disk Scheduling Algorithms 3
4
OBJECTIVES : To describe the physical structure of secondary storage devices and its effects on the uses of the devices. To explain the performance characteristics of mass-storage devices and it scheduling algorithms 4
5
Overview 5
6
6 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. Moving-head Disk Mechanism
7
7 Magnetic disks provide bulk of secondary storage of modern computers Drives rotate at 60 to 200 times per second Disk speed has two parts. Transfer rate is rate at which data flow between drive and computer Positioning time (/random-access time) consists of : seek time : time to move disk arm to desired cylinder rotational latency :time for desired sector to rotate under the disk head Disks can be removable Overview of Mass Storage Structure
8
8 Disk drive attached to computer via set of wires (I/O bus) The data transfers on a bus are carried out by special electronic processors called controllers. The host controller is the controller at the computer end of the bus. A disk controller is built into each disk drive To perform disk I/O operation >> Host controller uses bus to talk to disk controller. Overview of Mass Storage Structure (cont.)
9
Disk Structure 9
10
10 Disk drives are addressed as large 1-D arrays of logical blocks, where the logical block is the smallest unit of transfer 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
11
Disk Scheduling 11
12
Disk Scheduling 12 The operating system is responsible for using hardware efficiently for the disk drives>> this means having a fast access time and large disk bandwidth Access time has two major components Seek time Rotational latency Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer We can improve both the access time and the bandwidth by managing the order in which disk I/O requests are serviced. Minimize seek time (Seek time ≈ seek distance)
13
Disk Scheduling Algorithms 13 Some algorithms to schedule the servicing of disk I/O requests: FCFS (first-come, first-served): SSTF (shortest-seek-time-first )algorithm SCAN
14
Disk Scheduling Algorithms 14 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 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.
15
Disk Scheduling Algorithms (Cont.) 15 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) SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests SSTF is not optimal
16
Disk Scheduling Algorithms (Cont.) 16 EXAMPLE: SSTF algorithm 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 Head movement sequence : 53 » 65 » 67 » 37 » 14 » 98 » 122 » 124 » 183 The total seek distance = ∑ │ current position- next position│ =236 cylinders….(better than FCFS algorithm)
17
Disk Scheduling Algorithms (Cont.) 17 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. o SCAN algorithm Sometimes called the elevator algorithm o Before applying SCAN to schedule we need to know the direction of head movement
18
Disk Scheduling Algorithms (Cont.) 18 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 Assuming that head direction: from cylinder# 199 to cylinder #0 (C 199 >>C 0 ) Head movement sequence : 53 » 37 » 14 » 0 » 65 » 67 » 98 » 122 » 124 » 183 The total seek distance = ∑ │ current position- next position│ =16+23+14+65+2+31+24+2+59 = 236 cylinders NOTE: if we reverse the direction, the result almost will be different.
19
Thank you The End 19
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.