TIP: If you wish to skip all the details about hard drive addressing, then try the above Capacity Limits link.
 

 

ATA (EIDE) Drive Capacity and Addressing

Decimal Mega vs. "real" Mega-Bytes

    As units for capacity in the computer industry are based on binary values, one "K" is 1024 Bytes (1 KB = 210 Bytes). And a Mega-Byte or one "MB" is 1024 x 1K, which comes to 1048576 Bytes (1 MB = 220 Bytes). However, when drive manufactures use "Meg" to express capacity, they almost always are giving millions of Bytes (1,000,000 Bytes) as a decimal number. While support documents from other sources (like Microsoft), and operating systems or drive utilities, might express drive capacity using binary based Mega-Bytes.

    So to prevent confusion, I refuse to get into a situation where a Mega-Byte means 1048576 Bytes, except in special cases such as hard drives, where the same term might abruptly change to mean 1000000 Bytes. Thus this document only uses "real" or binary based Mega-Bytes (MB) and Giga-Bytes (GB), with the corresponding "million Bytes" or "billion Bytes" value often also provided. As that is the one way I can see to be perfectly clear about what the value I am giving actually is.

 
 

"There are two different number systems which are used to express units of storage capacity; binary in which a kilobyte is equal to 1024 bytes, and decimal in which a kilobyte is equal to 1000 bytes. The storage industry standard is to display capacity in decimal, but some programs measure the capacity of a drive in binary."

Measurement Binary Decimal
Kilobyte (KB)1,0241,000
Megabyte (MB)1,048,5761,000,000
Gigabyte (GB)1,073,741,8241,000,000,000
Terabyte (TB)1,099,511,627,7761,000,000,000,000
 
 Hitachi Global Storage: Hard Drive FAQs  
 
 
 

How Binary Numbers are Used

    Depending on how the value zero (0) is utilized, there are two methods of interpreting a simple binary number.

    In the first method, the value 0 signifies either nothing or "no value provided", and any count starts with the value 1. For example, 63 Sectors (maximum) is stored in a 6 bit binary number. This permits a total of 64 possible values, including the value 0 (all bits 0). So the possible or remaining values for the Sector number are then 1 to 63.

   In the second method, all the possible values are used as a valid count. For example, when 1024 Cylinders (maximum) is stored in a 10 bit binary number, the possible values for those 10 bits are 0 through 1023. So the first Cylinder is numbered 0 (all bits 0), and the last (1024th) Cylinder is numbered 1023 (all bits 1).

    How this count is then represented as a decimal number will depend on how the binary to decimal conversion is performed; with operating systems often adding one (1) to the binary count, to provide a decimal count that starts at one. As example, for an early IDE drive that is 504MB or smaller, the operating system and the information printed on the drive would show the total Tracks or Cylinders for that drive as a valve between 1 and 1024. While for the same drive, the CMOS settings for the computer BIOS-- which starts the count at zero-- would show the number of drive Tracks or Cylinders as a valve between 0 and 1023.

 

Tracks, Cylinders, Heads, Sectors & Geometry

    A Track is a ring of data or Sectors that moves under a specific Head as the disk rotates. A Cylinder is made up of the vertically in-line or stacked rings of data that are moving under all the drive Heads. So while Cylinders and Tracks are not exactly the same thing, the value or number for Cylinders is the same as the value or number for Tracks.

CHS ...Cylinder/Head/Sector addressing.
 * Cylinder -- how far in or out the drive heads are positioned.
 * Head -- which one of the heads is in use.
 * Sector -- which segment of the disk is accessed, as it rotates underneath the selected drive head.

    Modern hard drives are a complex "black box" which masquerades as a simplistic CHS drive. All EIDE or ATA drives accomplish this by performing an internal translation, which presents the complex internal storage of sectors as the simplistic CHS configuration which is claimed by the drive electronics.

    Due to the universal nature of this internal translation, the drive can actually be configured using any combination of total Cylinders, total Heads and total Sectors, which does not exceed the capacity of the drive. While a specific configuration of Cylinders/Heads/Sectors used to access a drive is called a geometry. (a.k.a. drive geometry or CHS geometry).

 

    Once a drive has been prepared for use (partitioned and formatted), then the same geometry or configuration of Cylinders, Heads and Sectors must always be used to continue accessing the drive. As any change to how the sectors on a hard drive are addressed could prevent all access to the data, or even result in destroying the existing information.

 
 

Different BIOS and IDE Limits

    The original BIOS Int 13h system call passed the Cylinder, Head, Sector (CHS) address directly to the IDE hard drive controller. Which requires accepting the lowest of the limits for each value, causing a capacity limit of 504MB (528 million Bytes).

  BIOS Int 13  IDE (ATA)  Combined Limit

Maximum Cylinders  1024 65536 1024
Maximum Heads  256 16 16
Max. Sectors/track  63 256 63


Maximum Capacity  7.88GB 128GB 504MB

 

The Translating or "Enhanced" BIOS
. . .  Logical CHS, Physical CHS and LBA

    An "Enhanced" BIOS has a Int 13h system call, which can translate the Operating System CHS geometry into either a different configuration of CHS values, or a Logical Block Address (LBA). Then this translated address is sent to the hard drive controller.

    So the Cylinder/Head/Sector address that the operating system provides to the BIOS Int 13h system call is now called the Logical CHS (L-CHS). The translated Cylinder/Head/Sector address sent to a hard drive controller is now called the Physical CHS (P-CHS). And LBA is where instead of using CHS, all sectors on the hard drive are numbered sequentially. So data is then addressed only by the single unique number for each sector.

 

Logical CHS to Physical CHS Translation
. . .  or "The bit-shifting method"

    This enables a really simple method for translating the L-CHS address to a P-CHS address, by simply shifting bits from the Heads value into the Cylinders value. That essentially, the total number of Heads is being divided by a multiple of 2. (2, 4, 8 or 16.) And the total number of Cylinders is being multiplied by the same multiple of 2.

 

    Note: For drives over 4GB, this method can require the L-CHS use 256 Heads. But DOS cannot handle 256 Heads. So either the P-CHS Heads, or the Multiply/Divide value, must be limited to 15. Which would correspond to an L-CHS using 240 Heads. Alternately, the L-CHS address space can be limited to 255 Heads, which is appropriate for a drive using LBA.

 
 

Logical CHS to LBA Translation

    LBA is a newer and better way of addressing the individual sectors on a hard drive. However, some older software, such as DOS, only knows how to use CHS addressing. So when a hard drive is addressed using LBA, L-CHS to LBA translation is also made available, to permit backward compatibility.

 

IBM/Microsoft Int 13h Extensions
. . . enabling OS drive access by LBA

    A BIOS with the Int 13h Extensions fully supports both LBA and non-LBA hard drives. Which requires all the above, plus the "Extended Int 13h functions".

Traditional Int 13h functions: Extended Int 13h functions:

    A BIOS with the Int 13h Extensions provides support for at least 4 and sometimes 8 drives, including removable drives. So all but the oldest PC's will have a BIOS that includes these extensions.

 
Next Page: Specific Drive Capacity Limits
 

 

[ChangeDetection.com]TM
Monitor this Webpage

E-mail the Webmaster
Page Content Updated: 1 July 2005
   

    For any translation method, the BIOS is supposed to ensure the sectors are accessed by the translation in the same order that would occur with "un-translated" access. In the real world, that does not always happen. So any change to how the sectors on a hard drive are addressed could prevent all access to the data, or even result in destroying the existing information.

    This can include a BIOS or firmware update, which causes a change related to accessing drive data. Especially a system BIOS update, that happens to update LBA to consistently use 63 sectors/track. Which is the "now standard" method to implement LBA <--> L-CHS translation.