Now IDE disks have their own set of limitations; these disks, no matter if
they're ATA/IDE or ATA-2/EIDE, use
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.
- 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.
- 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.
- 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.
You asked for it :-)
If a drive is less than 504MB, it should have a logical geometry, as
reported in Identify Device words 53-58, of 1024 or less cylinders, 16 or
less heads and 63 or less sectors. Such a drive can be addressed directly
without invoking this algorithm. For drives over 504MB, the CHS address
received by the BIOS from DOS must be converted to an Extended CHS address,
or an LBA address. We'll assume ECHS for now.
First, during BIOS setup, the BIOS must determine the value of N. This
value is used to convert the drive's geometry to a geometry that the BIOS
can support at the int13 interface. This interface requires that Cyl be
less than or equal to 1024. The number of cylinders (Identify Device word
1) is divided by N while the number of heads (Identify Device word 3) is
multiplied by N. N must be 2, 4, 8,..., a power of 2.
Second, in most translating BIOSes, the following algorithm is used
whenever INT 13H is called to perform a read or write:
eCyl = ( Cyl * N) + ( Head / dHead ); /* head DIV dHead */
eHead = ( Head % dHead ); /* head MOD dHead */
eSector = Sector; /* used as is */
By way of example, assume the drive's geometry is 2000 cylinders, 16 heads
and 63 sectors (these numbers are in Identify Words 1, 3, and 6) and that
the BIOS determines the value of N to be 2. The BIOS reports to DOS that
the drive has 1000 cylinders, 32 heads and 63 sectors when int13
ah=08h
function is called. This is 2016000 sectors.
In a standard BIOS, the Fixed Disk Parameter Table (FDPT) contains information
about the geometry of the harddisk(s). It more or less contains the same
information as the drive type entry in the CMOS setup. A program that wants to
use the harddisk on a low level, bypassing DOS, normally uses the BIOS' int13
functions to achieve this.
The Enhanced fixed Disk Parameter Table (EDPT) is an extension of the ordinary
FDPT that makes use of undefined fields to provide information about the
translation mode used. It uses a magic number (A0 in byte 3) and a checksum (in
byte 15) to ensure that software cannot mistake random data for an EDPT. This
practice is more or less standard across various flavors of translating BIOSes,
with differing magic numbers.
On top of this, the Phoenix Enhanced BIOS standard specifies a number of
extended int13 functions and a 16 byte FDPT extension. The latter contains
detailed information about the current PIO or DMA type, block mode used, LBA or
(E)CHS addressing, 32 bit transfer mode, media type (removable, CD-ROM), control
port base and IRQ. In other words, it covers all new features of the ATA family
and is flexible enough to accommodate more than four devices, nonstandard port
addresses and IRQs. Proper support of all this is important to achieve any
degree of Plug'n'Play functionality with ATA hardware. The WD EIDE BIOS lacks
all these features.
Too many. See question
12.4
for a discussion of
some of the differences between a Phoenix EBIOS and a WD EBIOS. For a more
exhaustive discussion of BIOS types, Hale Landis' effort is indispensable---see
the
resource guide
below.
Next Chapter, Previous Chapter
Table of contents of this chapter,
General table of contents
Top of the document,
Beginning of this Chapter