270 likes | 365 Views
Chapter 8. Hard Drives. Inside the Drive. Aluminum platters are coated with a magnetic medium. Platters spin at 3,500 to 10,000 rpm and read/write head “floats across platters.” Never open a hard drive: the littlest bit of dust could cause catastrophic damage. Data Encoding.
E N D
Chapter 8 Hard Drives
Inside the Drive • Aluminum platters are coated with a magnetic medium. • Platters spin at 3,500 to 10,000 rpm and read/write head “floats across platters.” • Never open a hard drive: the littlest bit of dust could cause catastrophic damage.
Data Encoding • Uses tiny magnetic fields to store binary info. • Flux reversals are used to determine a 0 or 1 • Encoding methods are used to keep the read/write head from “getting lost”
Hard Drive Geometry (pictures pg.418-421) • Head--the # of read/write heads used by the drive to store data. • Cylinders—a group of tracks, all of the same diameter, extending through the drive vertically.
Hard Drive Geometry • Sectors—thousands of small “pie slices”on each track-contain 512 bytes. • All three are the important values in geometry– referred to as CHS. • Capacity formula: H x C x S x 512k = drive capacity (estimate)
Interfaces • Two main interfaces for HDD: SCSI & EIDE • Originally only IBM machines had support for hard drives: Western Digital and Compaq created ATA interface in 1989 to include things like CD-ROM drives and others.
IDE Interfaces • Uses 40 pin ribbon cable. However newer ATA66/100 interfaces use a 80 wire 40 pin ribbon cable. • The actual controller is on the drive not the motherboard. • Most PCs can support 4 ATA devices. Two on the primary and two on the secondary channel.
Configuration • Master or Slave? • Drives must be configured to master or slave on each channel using jumpers on the drive. • CMOS setup • CMOS must know the geometry of the drive to work. • You used to have to manually enter the data but now drives will tell the CMOS the geometry for you.
Hard Drive Types IBM thought that dealing with CHS was too hard for most users so they created 15 hard drive types for the 286 AT. • However this table of types had to be updated each time a higher capacity drive was made. • After creating 45 different types AMI crated the “user type” where users entered the geometry. • To solve all this drives today auto detect all the settings for geometry.
LBA/ECHS • Translation modes allowing hard drives larger than 504MB. • LBA-Western Digital; ECHS-Seagate; both are advanced types of sector translation. • Basically the hard drive “lies” about its geometry to the computer. • LBA allows for drives up to 8.4GB.
Sector Translation • The BIOS has a limit of 1,024/16/63 for the CHS equaling 504MB. • Because sectors on the inside of the drive were much shorter than the sectors on the outside it wasted a lot of space.
Physical vs Logical • Physical geometry describes the real layout inside the drive. • Logical geometry describes what the drive tells the CMOS. • The drive simply tells the CMOS it has less sectors than it actually does, and when the drive sends data out it translates it into the physical geometry the BIOS can accept. • This process is called sector translation.
INT 13 Extensions • By the mid 1990s it was obvious that 8.4GB just wasn’t enough. • INT13 is capable of having drives up to 137GB. • INT13 ignores the CHS values and feeds the LBA stream of “addressable sectors.”-still just tricking the BIOS.
PIO Modes • Programmable Input/Output- Transfers data to RAM. • Five modes (PIO modes 0-4): transfer rates are on pg.446 • PIO is older than the newer, faster DMA modes, but is still fairly common.
DMA Modes • Direct Memory Access transfers bypass the CPU.(bus mastering) • 3 modes (0-2) in 16 bit mode; 6 modes (0-5) in 32 bit mode.(pg 447) • In 32 bit mode, 3, 4, and 5 are considered “ultra DMA” • Ultra DMA(ATA/66) and Ultra DMA(ATA/100) use a 80 wire, 40 pin cable.
Partitioning • One physical drive could have from 1-24 logical partitions, named C: to Z: • Three reasons for partitions: • Break up a drive to get around size limits. • Organize your data in a personal way. • Enables the use of more than one OS.
Master Boot Record • When a computer starts up it looks for a master boot record (MBR) • MBR looks a partition w/ a valid OS, by using the Partition Table.
Partition Types • Primary: a HDD may have up to 4, contains OS, must be made active to be able to boot the OS. • Extended: uses primary spot so you could have 1 primary and 3 extended. • An extended partition can have up to 24 logical partitions to break up hard drive into smaller sizes. • In Windows 9x, use FDISK to partition hard drives.
Formatting • Formatting: After partitioning, final step to make the hard drive usable by an OS • Does two things: • Creates the File Allocation Tables (FATs) • Creates the Root Directory
Sector Size • Base storage area for hard drives • Each sector stores 512 bytes • If a file smaller than 512 bytes is stored in a sector, than the rest of the sector is wasted • If a file greater than 512 bytes is stored in a sector, the OS continues to fill unused sectors until the file is stored
File Allocation Tables • Every OS has a FAT • FAT is officially a data structure, but is more like a 2-column spreadsheet • Left column gives each sector a number, from 0000 to FFFF • Therefore, there are 65,536 (64k) sectors • Because the left column contains 16 bits, this is called a “16-bit FAT” or FAT16
FAT • The right column contains information on the status of the sectors • All drives have bad sectors, and the OS must mark these • After the format program creates the FAT, it maps the bad sectors on the drive, and if the sector is bad, it stores FFF7 to that sector’s FAT location, making it unavailable to use
FAT • Using FAT to track sectors creates a problem: • The 16-bit FAT has a maximum of 64k (2^16) locations • Therefore, the partition size is limited to 64k*512 bytes per sector, or 32mb • When FAT16 was first used, this was no problem, because hard drives were usually less than 32mb in size
FAT • To break this 32mb limitation, Microsoft invented clustering • Clustering enabled partitions larger than 32mb by grouping sectors together in clusters, and giving each cluster an address in the FAT instead of each sector • This enabled partitions up to 2.1gb
FAT • Although this increased the size of partitions, it also increased the wasted drive space • Like a sector, if a file didn’t completely fill a cluster, the rest went to waste • But, because clusters are larger than sectors, if a file only filled half of a cluster, more space would go to waste
FAT • Because the new FAT was also 16-bit, it was still called FAT16 • If anybody refers to FAT16 now, this is what they’re talking about
Storing Data • When storing data in the FAT, an open cluster is first located • If this cluster is all that is needed to store the file, FFFF is entered for that cluster, indicating the end of the file