Hardware Reference
In-Depth Information
0,1,1; the fourth sector is 0,1,2; and so on until we get to the last sector, which would be 1,1,2.
Now imagine that we could take the eight sectors and—rather than refer directly to the physical
cylinder, head, and sector—number the sectors in order from 0 to 7. Thus, if we wanted to address
the fourth sector on the drive, we could reference it as sector 0,1,2 in CHS mode or as sector 3 in
LBA mode. Table 7.15 shows the correspondence between CHS and LBA sector numbers for this
eight-sector imaginary drive.
Table 7.15. CHS and LBA Sector Numbers for an Imaginary Drive with Two Cylinders, Two
Heads, and Two Sectors per Track (Eight Sectors Total)
As you can see from this example, using LBA numbers is simpler and generally easier to handle;
however, when the PC was first developed, all BIOS and ATA drive-level addressing was done
using CHS addressing.
CHS/LBA and LBA/CHS Conversions
You can address the same sectors in either CHS or LBA mode. The conversion from CHS to LBA is
always consistent in that for a given drive, a particular CHS address always converts to a given LBA
address, and vice versa. The ATA-1 document specifies a simple formula that can be used to convert
CHS parameters to LBA:
LBA = (((C × HPC) + H) × SPT) + S - 1
By reversing this formula, you can convert the other way—that is, from LBA back to CHS:
For these formulas, the abbreviations are defined as follows:
Using these formulas, you can calculate the LBA for any given CHS address, and vice versa. Given a
drive of 16,383 cylinders, 16 heads, and 63 sectors per track, Table 7.16 shows the equivalent CHS
and LBA addresses.
Table 7.16. Equivalent CHS and LBA Sector Numbers for a Drive with 16,383 Cylinders, 16
Heads, and 63 Sectors per Track (16,514,064 Sectors Total)
 
 
 
 
Search WWH ::




Custom Search