Logical Block Addressing - CHS Conversion

CHS Conversion

LBA and CHS equivalence with 16 heads per cylinder
LBA Value CHS Tuple
0 0, 0, 1
1 0, 0, 2
2 0, 0, 3
62 0, 0, 63
945 0, 15, 1
1007 0, 15, 63
1008 1, 0, 1
1070 1, 0, 63
1071 1, 1, 1
1133 1, 1, 63
1134 1, 2, 1
2015 1, 15, 63
2016 2, 0, 1
16,127 15, 15, 63
16,128 16, 0, 1
32,255 31, 15, 63
32,256 32, 0, 1
16,450,559 16319, 15, 63
16,514,063 16382, 15, 63

CHS (cylinder/head/sector) tuples can be mapped to LBA address with the following formula:

where,

  • C, H and S are the cylinder number, the head number, and the sector number
  • LBA is the logical block address
  • HPC is the maximum number of heads per cylinder (reported by disk drive, typically 16 for 28-bit LBA)
  • SPT is the maximum number of sectors per track (reported by disk drive, typically 63 for 28-bit LBA)

LBA addresses can be mapped to CHS tuples with the following formula:

\begin{align}
C &= LBA \div ( SPT \times HPC )\\
H &= ( LBA \div SPT ) \, \bmod \, HPC \\
S &= ( LBA \, \bmod \, SPT ) + 1
\end{align}

where

  • mod is the modulo operation, i.e. the remainder, and
  • is integer division, i.e. the quotient of the division.

According to the ATA specifications, "If the content of words (61:60) is greater than or equal to 16,514,064 then the content of word 1 shall be equal to 16,383." Therefore for LBA 16450559, an ATA drive may actually respond with the CHS tuple (16319, 15, 63), and the number of cylinders in this scheme must be much larger than 1024 allowed by INT 13H.

Read more about this topic:  Logical Block Addressing

Famous quotes containing the word conversion:

    The conversion of a savage to Christianity is the conversion of Christianity to savagery.
    George Bernard Shaw (1856–1950)