lotus

previous page: 12.01.  Why translation?
  
page up: Enhanced IDE/Fast-ATA/ATA-2 FAQ
  
next page: 12.03.  I'd like to know how translation works in detail.

12.02. How does translation work?




Description

This item is from the Yet Another Enhanced IDE/Fast-ATA/ATA-2 FAQ, by John Wehman and Peter den Haan with numerous contributions by others. (v1.92).

12.02. How does translation work?

There are roughly three ways today's BIOSes can handle translation: standard CHS addressing, Extended CHS addressing, and LBA addressing. Translation does NOT automatically imply LBA, as you will see.

o Standard CHS: no translation at all :-(

Communication between drive, BIOS and operating system goes like this:

        +-------- DRIVE --------+    +- BIOS --+    +---- OS ----+
        |                       |    |         |    |   & APPS   |
        |   physical      T1   logical        logical            |
        | geometry used  ====> geometry ----> geometry           |
        |internally only        (CHS)           (CHS)            |
        |                       |    |         |    |            |
        +-----------------------+    +---------+    +------------+

There is only one translation step, T1, which is internal to the drive ('universal translation'). The drive's actual, physical geometry is completely invisible from the outside---the Cylinders, Heads and Sectors printed on the label for use in the BIOS setup have nothing to do with the physical geometry! The logical geometry, used throughout, is subject to both IDE's limitation to 16 heads and to the BIOS' limitation of 1024 cylinders, which gives the (in)famous 504MB limitation.

o Extended CHS

        +-------- DRIVE --------+    +- BIOS --+    +---- OS ----+
        |                       |    |         |    |   & APPS   |
        |   physical      T1   logical   T2  translated          |
        | geometry used  ====> geometry ====> geometry           |
        |internally only        (CHS)           (CHS)            |
        |                       |    |         |    |            |
        +-----------------------+    +---------+    +------------+

Logical geometry is used to communicate between the drive and the BIOS, while a different, translated geometry is used to communicate between the BIOS and everything else.

There is an additional translation step, T2, performed by the BIOS. This procedure breaks the 504MB barrier because the geometries used are not subjected to the BIOS and IDE limitations simultaneously: the logical geometry is subject to IDE's 16 head limitation, but not to the 1024 cylinder limitation. For the translated geometry, it is just the reverse. Most BIOSes denote extended CHS translation with 'Large'. Note that the geometry usually entered in the BIOS setup is the logical geometry, not the translated one. In case of doubt, consult the BIOS manual.

o Logical Block Addressing (LBA)

Here, the logical geometry is dispensed with entirely and replaced by a single, large, linear block number. This makes far more sense than using a logical geometry that is completely fake anyway.

        +-------- DRIVE --------+    +- BIOS --+    +---- OS ----+
        |                       |    |         |    |   & APPS   |
        |   physical      T1    linear   T2  translated          |
        | geometry used  ====> block no.====> geometry           |
        |internally only        (LBA)           (CHS)            |
        |                       |    |         |    |            |
        +-----------------------+    +---------+    +------------+

This breaks the 504MB barrier in essentially the same way as extended CHS does. Conceptually, using a single linear number to address a sector on the harddisk is simpler than a CHS style address, but it takes more CPU cycles and is sometimes slower on the drive side as well. The differences are pretty insignificant either way.

A translating BIOS can be implemented via the system BIOS or on- board controller BIOS. Basically, this takes the drive's logical default geometry, and if the cylinder count is beyond 1024, will divide the cylinder count by an appropriate factor and multiply the heads by the same. For instance, let's take a 540 Meg drive: it has 1057 cylinders, 16 heads, and 63 sectors per track. Well, the int13 interface used by the BIOS to talk with the world can only handle 1024 cylinders, but it can address up to 255 heads. So, the x- lating BIOS will pass to the OS, via int13 calls, the geometry 528 cylinders (1057/2 (approx)) and 32 heads (16*2). Then, when the OS makes a request to the drive, the BIOS will re-translate the request to the original order, or to an LBA number if LBA is enabled. This allows for capacities of up to 8 gigabytes.

A final word about the 8GB capacity limit, which is inherent in the int13 interface and cannot be solved without ditching the traditional calls. To that purpose, the IBM/Microsoft int13 extensions document specifies a new interface between the BIOS and the operating system or applications. These extended int13 calls are made in terms of LBA addresses and can handle huge disks. Note that the BIOS is required to translate these LBA addresses back to CHS if the drive doesn't support LBA---exactly the reverse of the translation process outlined above.

 

Continue to:













TOP
previous page: 12.01.  Why translation?
  
page up: Enhanced IDE/Fast-ATA/ATA-2 FAQ
  
next page: 12.03.  I'd like to know how translation works in detail.