Magnetic disks provide the bulk of secondary storage for modern computer systems. Conceptually, disks are relatively simple (see Fig. 12.1).
Figure 12.1:
Moving-head disk mechanism.
Each disk platter has a flat circular shape, like a CD.
Common platter diameters range from 1.8 to 5.25 inches.
The two surfaces of a platter are covered with a magnetic material. We store information by recording it magnetically on the platters.
A read-write head ``flies'' just above each surface of every platter.
The heads are attached to a disk arm that moves all the heads as a unit.
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.
There may be thousands of concentric cylinders in a disk drive, and each track may contain hundreds of sectors.
When the disk is in use, a drive motor spins it at high speed. Most drives rotate 60 to 200 times per second.
Execution of a disk operation involves (see Fig. 12.2)
Figure 12.2:
Disk Performance.
Wait time: the process waits to be granted device access;
Wait for device: time the request spend in wait queue.
Wait for channel: time until a shared I/O channel is available.
Positioning time: time hardware need to position the head. Sometimes called the random-access time,
consists of the time to move the disk arm to the desired cylinder, called the seek time (in milliseconds),
the time for the desired sector to rotate to the disk head, called the rotational latency (in milliseconds). Rotational speed, , of 5000 to 10000 rpm.
Transfer rate is the rate at which data flow between the drive and the computer (megabytes of data per second). Transfer time: to transfer bytes, with bytes per track;
Total average access time;
A timing comparison for ms, rpm, 512B sector size, 320 sectors per track, 1.3 MB file size.
At 10000 rpm, one revolution per 6ms
average delay 3ms (=(60 second/10000) &
).
Read a file with 2560 sectors (=(1.3MB/512))
File stored compactly (8 adjacent tracks (=(2560/320))). Read first track;
Average seek
2ms
Rot. Delay
3ms
Read 320 sectors
6ms (
, b=512*320 & N=512*320)
Total
11ms
All sectors
11+7*9=74ms
Sectors distributed randomly over the disk: Read any sector
Average seek
2ms
Rot. Delay
3ms
Read 1 sectors
0.01875ms (=(6/320);
, b=512 , N=512*320 )
Total
5.01875ms
All
2560*5.01875=12848ms
Disk Performance is entirely dominated by Seek and Rotational Delays.
It will only get worse as capacity increases much faster than increase in seek time and rotation speed.
It has been easier to spin the disk faster than improve seek time.
Floppy disks are inexpensive removable magnetic disks that have a soft plastic case containing a flexible platter.
The head of a floppy-disk drive generally sits directly on the disk surface, so the drive is designed to rotate more slowly than a hard-disk drive to reduce the wear on the disk surface.
A disk drive is attached to a computer by a set of wires called an I/O bus.
Several kinds of buses are available, including
enhanced integrated drive electronics (EIDE),
advanced technology attachment (ATA),
serial ATA (SATA),
universal serial bus (USB),
fiber channel (FC),
SCSI buses
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.
To perform a disk I/O operation, the computer places a command into the host controller (memory-mapped I/O ports).
The host controller then sends the command via messages to the disk controller.
The disk controller operates the disk-drive hardware to carry out the command.