"Creating your own Operating System" - by Darren Lapins


Main Menu  :   Bootstrap Tutorial  :   Hard Drives
Previous: The Boot Process   Next: Partitions  

Hard Drives

Hard drives conforming to the ATA standard (IDE, E-IDE, etc) call the smallest addressable unit a sector. Each sector is made up of 512 bytes. Floppy disks can use different sector sizes but the hard drives will always use a sector size of 512 bytes. The sectors are spread around on the medium, for speed, and the electronics of the drive take care of giving you the correct one. In other words, you do not have to know where on the medium the sector is located.

The physical organization of the sectors is of no concern to the operating system. It will just see the disk as a linear stream of sectors. Each sector is addressed as a number starting from zero. This, in hard-drive terminology, is referred to as LBA-addressing or Linear Block Addressing. There is a different scheme called CHS-addressing, which has its origins from the physical layout inside the drive. You will still need to know all about CHS-addressing as it is still in use today.

Briefly, hard drives consist of one or more rotating platters. A read-write head is positioned above the rotating surface and is able to read or write to the area underneath the current head position. The position of the head determines which track is being accessed. These tracks are divided into sectors of 512 bytes each. The "S" in "CHS" stands or 'sectors'. The "C" in "CHS" stands for 'cylinders'. A cylinder is made up of all of the tracks lining up under each other on the surfaces. The "H" in "CHS" stands for 'heads'. A head is one side of a platter. If a hard drive has 3 rotating platters it usually has 6 heads, one for each side of each platter.



Example:
If a drive has 1024 cylinder,16 heads and 63 sectors it is a 504Mb hard drive.
        1024 cylinders x 16 heads x 63 sectors x 512 bytes_per_sector
            = 528,482,304 bytes
            = 516,096 Kbytes
            = 504Mb


Main Menu  :   Bootstrap Tutorial  :   Hard Drives
Previous: The Boot Process   Next: Partitions  
©1999 Darren Lapins