ATA Bus Background
MPC5200B Users Guide, Rev. 1
Freescale Semiconductor 11-29
Notes
1. LBA mode is only available in ATA-2 or later specifications.
2. A block mode exists (not to be confused with logical block addressing), in which sectors are grouped into a unit, called a block,
for purposes of data transfer. The number of sectors is set with SET MULTIPLE MODE command and is used by the READ
MULTIPLE and WRITE MULTIPLE commands. When specifying sectors within a block, either CHS or LBA mode may be used.
11.7.3.4 Physical /Logical Addressing Modes
Addressing is done by referencing the sector, head and cylinder for a particular sector. Using a physical addressing mode, there are two
mappings available:
Natural—Sector, head and cylinder numbers represent actual physical sectors, heads and cylinders on the drive.
Logical—Sector, head and cylinder numbers map to different physical sectors, heads and cylinders on the drive.
Most modern hard disks usually have 2, 3 or 4 platters. All platters are connected together on a common spindle to spin as a single assembly.
Each platter has two surfaces and two heads to access each surface. The platter is a collection of concentric circles called tracks, to store data.
Each track is subdivided into sectors. Each sector can hold 540Bytes of information, with 512Bytes being used for data and 28Bytes being
used for error correction code (ECC). A set of tracks under each head at the same track position is called a cylinder. So to get to the disk
read/write data point, a cylinder address, a head address and a sector address is needed. Hence the basic addressing mode is called cylinder
head sector (CHS) addressing.
In this mode, the address is written into the ATA registers as follows:
• Cylinder{Cylinder High ( 0x01F5), Cylinder Low (0x01F4 )}
•HeadDrive/ Head (0x01F6)
•SectorSector Number (0x01F3 )
To most efficiently use the drive for data storage, the physical geometry is translated into logical geometry by the hard disk manufacturers.
The BIOS or overlay software from the disk manufacturer translates the logical geometry to physical geometry to get to the physical location
of the data written/read on/from the disk.
The CHS method is limited to 1024 cylinders, 16 heads and 63 sectors. This limits the hard disk recognition to a maximum of 504MBytes.
This limit is increased for larger disks by enhancing the CHS translation. BIOS limits cylinder size to 1024 (10bits allocated), but allows the
number of heads to be 256 (8bits allocated). Therefore, a 3.1GByte hard disk with 6136 cylinders and 16 heads is translated by dividing the
cylinders by 8 (6136 ÷ 8 = 767). The number of heads is then multiplied by the same number (16 x 8 = 128). This fits well within the limits
set by the BIOS and a larger disk is recognized for its true size (767 x 128 x 63 x 512 = 3.1GBytes).
Another form of addressing is called logical block addressing (LBA). This uses 28bits in the ATA standard to address a particular sector on
a hard disk. A sum total of sectors on a drive is available and each unique sector is addressed using LBA.
Mapping from physical organization to logical block numbers is done using the following formula:
LBA(Cylinder # x HeadCount + Head#) x SectorCount + Sector# – 1
In this mode, the address is written in the ATA Registers as follows:
LBA{LBA [0: 7]( 0x01F3), LBA[ 8:15 ](0x01F4 ), LBA[16 :23] (0x01F5), LBA [24: 27] (0x01F6 )}

Figure 11-4. ATA Sector Format

GAP1 VFO Sync Header Write Splice VFO Sync 512 Bytes data ECC GAP3
Sync Cylinder Head Sector CRC Soft-Sector Format
GAP1 Header Sync 512 Bytes data ECC GAP3
Sync Cylinder Head Sector CRC Hard-Sector Format
GAP2