You are on page 1of 5

Definitions

schematic of the hard drive geometry

CHS addressing is the process of identifying individual sectors (aka. physical block of data) on a disk by
their position in a track, where the track is determined by the head and cylinder numbers. The terms are
explained bottom up, for disk addressing the sector is the smallest unit. Disk controllers can introduce
address translations to map logical to physical positions, e.g., zone bit recording stores fewer sectors in
shorter (inner) tracks, physical disk formats are not necessarily cylindrical, and sector numbers in a track
can be skewed.

Sectors

Floppy disks and controllers use physical sector sizes of 128, 256, 512 and 1024 bytes (e.g., PC/AX),
whereby formats with 512 bytes per physical sector became dominant in the 1980s.[3][4]

The most common physical sector size for hard disks today is 512 bytes, but there have been hard disks
with 520 bytes per sector as well for non-IBM compatible machines. In 2005 some Seagate custom hard
disks used sector sizes of 1024 bytes per sector. Advanced Format hard disks use 4096 bytes per physical
sector (4Kn)[5] since 2010, but will also be able to emulate 512 byte sectors (512e) for a transitional
period.[6]

Magneto-optical drives use sector sizes of 512 and 1024 bytes on 5.25-inch drives and 512 and 2048
bytes on 3.5-inch drives.

In CHS addressing the sector numbers always start at 1, there is no sector 0,[1] which can lead to
confusion since logical sector addressing schemes typically start counting with 0, e.g., logical block
addressing (LBA), or "relative sector addressing" used in DOS.

For physical disk geometries the maximal sector number is determined by the low level format of the
disk. However, for disk access with the BIOS of IBM-PC compatible machines, the sector number was
encoded in six bits, resulting in a maximal number of 111111 (63) sectors per track. This maximum is still
in use for virtual CHS geometries.
Tracks

The tracks are the thin concentric circular strips of sectors. At least one head is required to read a single
track. With respect to disk geometries the terms track and cylinder are closely related. For a single or
double sided floppy disk track is the common term; and for more than two heads cylinder is the
common term. Strictly speaking a track is a given CH combination consisting ofSPT sectors, while a
cylinder consists ofSPT×H sectors.

Cylinders

A cylinder is a division of data in a disk drive, as used in the CHS addressing mode of a Fixed Block
Architecture disk or the cylinder–head–record (CCHHR) addressing mode of a CKD disk.

The concept is concentric, hollow, cylindrical slices through the physical disks (platters), collecting the
respective circular tracks aligned through the stack of platters. The number of cylinders of a disk drive
exactly equals the number of tracks on a single surface in the drive. It comprises the same track number
on each platter, spanning all such tracks across each platter surface that is able to store data (without
regard to whether or not the track is "bad"). Cylinders are vertically formed by tracks. In other words,
track 12 on platter 0 plus track 12 on platter 1 etc. is cylinder 12.

Other forms of Direct Access Storage Device (DASD), such as drum memory devices or the IBM 2321
Data Cell, might give blocks addresses that include a cylinder address, although the cylinder address
doesn't select a (geometric) cylindrical slice of the device.

Heads

A device called a head reads and writes data in a hard drive by manipulating the magnetic medium that
composes the surface of an associated disk platter. Naturally, a platter has 2 sides and thus 2 surfaces on
which data can be manipulated; usually there are 2 heads per platter, one per side. (Sometimes the term
side is substituted for head, since platters might be separated from their head assemblies, as with the
removable media of a floppy drive.)

The CHS addressing supported in IBM-PC compatible BIOSes code used eight bits for - theoretically up to
256 heads counted as head 0 up to 255 (FFh). However, a bug in all versions of Microsoft DOS/IBM PC
DOS up to and including 7.10 will cause these operating systems to crash on boot when encountering
volumes with 256 heads[2]. Therefore, all compatible BIOSes will use mappings with up to 255 heads
(00h..FEh) only, including in virtual 255×63 geometries.

This historical oddity can affect the maximum disk size in old BIOS INT 13h code as well as old PC DOS or
similar operating systems:

(512 bytes/sector)×(63 sectors/track)×(255 heads (tracks/cylinder))×(1024 cylinders)=8032.5 MB, but


actually 512×63×256×1024=8064 MB yields what is known as 8 GB limit.[7] In this context relevant
definition of 8 GB = 8192 MB is another incorrect limit, because it would require CHS 512×64×256 with
64 sectors per track.

Tracks and cylinders are counted from 0, i.e., track 0 is the first (outer-most) track on floppy or other
cylindrical disks. Old BIOS code supported ten bits in CHS addressing with up to 1024 cylinders
(1024=210). Adding six bits for sectors and eight bits for heads results in the 24 bits supported by BIOS
interrupt 13h. Subtracting the disallowed sector number 0 in 1024×256 tracks corresponds to 128 MB for
a sector size of 512 bytes (128 MB=1024×256×(512 byte/sector)); and 8192-128=8064 confirms the
(roughly) 8 GB limit.[8]

CHS addressing starts at 0/0/1 with a maximal value 1023/255/63 for 24=10+8+6 bits, or 1023/254/63
for 24 bits limited to 255 heads. CHS values used to specify the geometry of a disk have to count cylinder
0 and head 0 resulting in a maximum (1024/256/63 or) 1024/255/63 for 24 bits with (256 or) 255 heads.
In CHS tuples specifying a geometry S actually means sectors per track, and where the (virtual) geometry
still matches the capacity the disk contains C×H×S sectors. As larger hard disks have come into use, a
cylinder has become also a logical disk structure, standardised[citation needed] at 16 065 sectors
(16065=255×63).

CHS addressing with 28 bits (EIDE and ATA-2) permits eight bits for sectors still starting at 1, i.e., sectors
1...255, four bits for heads 0...15, and sixteen bits for cylinders 0...65535.[9] This results in a roughly 128
GB limit; actually 65536×16×255=267386880 sectors corresponding to 130560 MB for a sector size of
512 bytes.[7] The 28=16+4+8 bits in the ATA-2 specification are also covered by Ralf Brown's Interrupt
List, and an old working draft of this now expired standard was published.[10]

With an old BIOS limit of 1024 cylinders and the ATA limit of 16 heads[11] the combined effect was
1024×16×63=1032192 sectors, i.e., a 504 MB limit for sector size 512. BIOS translation schemes known
as ECHS and revised ECHS mitigated this limitation by using 128 or 240 instead of 16 heads,
simultaneously reducing the numbers of cylinders and sectors to fit into 1024/128/63 (ECHS limit: 4032
MB) or 1024/240/63 (revised ECHS limit: 7560 MB) for the given total number of sectors on a disk.[7]

Blocks and clusters

The Unix communities employ the term block to refer to a sector or group of sectors. For example, the
Linux fdisk utility, before version 2.25,[12] displayed partition sizes using 1024-byte blocks.

Clusters are allocation units for data on various file systems (FAT, NTFS, etc.), where data mainly consists
of files. Clusters are not directly affected by the physical or virtual geometry of the disk, i.e., a cluster can
begin at a sector near the end of a given CH track, and end in a sector on the physically or logically next
CH track.

CHS to LBA mapping

Main article: Logical Block Addressing § CHS conversion

In 2002 the ATA-6 specification introduced an optional 48 bits Logical Block Addressing and declared CHS
addressing as obsolete, but still allowed to implement the ATA-5 translations.[13] Unsurprisingly the CHS
to LBA translation formula given below also matches the last ATA-5 CHS translation. In the ATA-5
specification CHS support was mandatory for up to 16 514 064 sectors and optional for larger disks. The
ATA-5 limit corresponds to CHS 16383 16 63 or equivalent disk capacities (16514064 = 16383×16×63 =
1032×254×63), and requires 24 = 14+4+6 bits (16383 + 1 = 214).[14]

CHS tuples can be mapped onto LBA addresses using the following formula:

A = (c ⋅ Nheads + h) ⋅ Nsectors + (s − 1),

where A is the LBA address, Nheads is the number of heads on the disk, Nsectors is the maximum
number of sectors per track, and (c, h, s) is the CHS address.

A Logical Sector Number formula in the ECMA-107[3] and ISO/IEC 9293:1994[15] (superseding ISO
9293:1987[16]) standards for FAT file systems matches exactly the LBA formula given above: Logical
Block Address and Logical Sector Number (LSN) are synonyms.[3][15][16] The formula does not use the
number of cylinders, but requires the number of heads and the number of sectors per track in the disk
geometry, because the same CHS tuple addresses different logical sector numbers depending on the
geometry. Examples:

For geometry 1020 16 63 of a disk with 1028160 sectors, CHS 3 2 1 is LBA 3150=((3× 16)+2)× 63 + (1-1)

For geometry 1008 4 255 of a disk with 1028160 sectors, CHS 3 2 1 is LBA 3570=((3× 4)+2)×255 + (1-1)

For geometry 64 255 63 of a disk with 1028160 sectors, CHS 3 2 1 is LBA 48321=((3×255)+2)× 63 + (1-1)

For geometry 2142 15 32 of a disk with 1028160 sectors, CHS 3 2 1 is LBA 1504=((3× 15)+2)× 32 + (1-1)

To help visualize the sequencing of sectors into a linear LBA model, note that:

The first LBA sector is sector # zero, the same sector in a CHS model is called sector # one.

All the sectors of each head/track get counted before incrementing to the next head/track.

All the heads/tracks of the same cylinder get counted before incrementing to the next cylinder.

The outside half of a whole Hard Drive would be the first half of the drive.

You might also like