From: [email protected]
Subject: New FAQ: ATA/IDE, Part 1 of N, Version 0
Message-ID: <[email protected]
Date: Thu, 15 Sep 94 15:07:13 GMT
Part 1 of ? -- The Basics
Version 0 -- 15 Sep 94
by Hale Landis -- [email protected]
First the "legal" stuff...
1) This FAQ is not intended to replace any other FAQ on this
subject but is an attempt to provide historical and technical
information about the ATA interface.
2) This FAQ is not an indorsement of any vendor's product(s).
3) This FAQ is not a recommendation to purchase any vendor's
4) Every effort is made to insure that all of the information
presented here is not copyrighted, not proprietary and
4) When opinions are stated they are clearly identified,
including the person's name and email address. Such opinions
are offered as long as they contribute to the understanding of
the subject being discussed. No "flames" allowed.
This is the first version of this FAQ. It will take some time to
get all the significant information into it so it will be rapidly
growing and changing during the next several weeks or months. I
don't even know how many parts there will be yet! Versions will
be numbered with simple integer numbers (no 1.1, 1.2, etc)
starting at 0.
If you have a question that is not answered here or if you have
unrestricted material that you would like to contribute, please
email it to [email protected]
DO NOT send material that is
copyrighted, proprietary or otherwise restricted in any way -- I
can't use such material in this document.
I don't have FTP access to anything at this time so I leave it to
others to put this at the appropriate FAQ FTP sites.
About myself: Until recently I worked for Seagate where I was
one of several people that attended the ATA, ATA-2, PCMCIA and
SFF meetings for Seagate. I was also the manager of a software
development group that created much of the engineering test
software for ATA hard disk drives. I am now a consultant and I
still attend the ATA-2 meetings.
Table of Contents
Part 1 - The Basics
Part 2 - BIOS and Drivers
Read and understand these terms. You will be lost and confused
if you don't!
ATA or AT Attachment
ATA is the proper and correct name for what most people call
IDE. In this document, ATA refers to all forms of ATA (ATA-1,
ATA-2, etc, IDE, EIDE, etc). The ATA interface uses a single
40-conductor cable in most desktop systems.
ATA-1 is the common name of the original ATA (IDE)
specification. ATA-1 is not an official standard yet. Final
approval is pending.
ATA-2 or ATA Extensions
ATA-2 is the common name of the new ATA specification. ATA-2
is still in early draft form and has not been submitted for
approval as an official standard.
ATA-3 is the common name of a future version of the ATA
specification. ATA-3 is now an approved project of X3T10 but
no working group meetings have been held yet.
ATAPI or ATA Packet Interface
ATAPI is a proposed new interface specification. Initially it
will probably be used for CD-ROM and tape devices. It uses
the ATA hardware interface at the physical level but uses a
subset of the SCSI command set at the logical level. The
ATAPI specification work is currently being done in the SFF
CAM (Common Access Method) Committee
The Common Access Method committee, now disbanded, worked on
two specifications: the CAM SCSI and CAM ATA specifications.
Both specifications were forwarded to the X3T9 committee for
further work years ago.
CHS or Cylinder/Head/Sector)
CHS is the old and traditional way to address data sectors on
a hard disk. This style of addressing relates a sector's
address to the position of the read/write heads. In today's
ATA devices, all sector addresses used by the host are logical
and have nothing to do with the actual physical position of
the sector on the media or the actual position of the
These are names given to the I/O register interface used by
ATA devices. It refers to a set of I/O registers, or I/O
ports and I/O port addresses used to program the device.
These names replace the older term Task File.
DMA or Direct Memory Access
DMA is a method of data transfer between two devices that does
not use the system's main processor as part of the data path.
DMA requires lots of hardware: a DMA arbitration unit, a DMA
data transfer unit and host bus signals that enable the DMA
controller to assume control of the host system's bus. When
the DMA controller has control of the host system's bus, it
moves data between the two devices by generating the
appropriate bus read/write cycles. For the ATA READ DMA
command this means generating an I/O read cycle and then a
memory write cycle for each 16-bit word being transferred.
For the ATA WRITE DMA command, a memory read cycle is followed
by an I/O write cycle for each 16-bit word transferred.
EIDE or Enhanced IDE
EIDE is a marketing program started by Western Digital to
promote certain ATA-2 features including ATAPI. WD has
encouraged other product vendors to mark their products as
"EIDE compatible" or "EIDE capable".
Fast ATA is a Seagate marketing program used to promote
certain ATA-2 features in newer ATA devices. Seagate has
encouraged other product vendors to mark their products as
"Fast ATA compatible" or "Fast ATA capable".
Host or Host System
The computer system that an ATA device is attached to.
HBA or Host Bus Adapter or Host Adapter
The hardware that converts host bus signals to/from ATA
interface signals. An ATA-1 host adapter is generally a very
simple piece of hardware. An ATA-2 host adapter can be simple
IDE can mean any number of things: Imbedded Device (or Drive)
Electronics (yes, you can spell embedded with an "i"),
Intelligent Device (or Drive) Electronics, etc. The term IDE
is the trademark of one of the disk drive vendors (Western
Digital?). Many hard disk vendors do not use IDE to describe
their products to avoid any trademark conflicts.
LBA or Logical Block Addressing
LBA is a newer (for ATA it is newer) way to address data
sectors on a hard disc. This style of addressing uses a
28-bit binary number to address a sector. LBA numbers start
at zero. In today's ATA devices, all sector addresses used by
the host are logical and have nothing to do with the actual
physical location of the sector on the media.
Usually this refers to the processor's local bus in a high
performance computer system. Usually the processor, the
external processor instruction/data cache, the main memory
controller and the bridge controller for the next low speed
system bus, for example, a PCI bus, are located on the local
bus. Lower speed local buses may have connectors that allow
the attachment of other devices. For example, the VL-Bus is a
local bus that can allow attachment of video, SCSI or ATA
controllers. It is very difficult to attach other devices to
high speed (say faster than 100MHz) local buses due to
electrical restrictions that come into play at those higher
ATA device 0. Device 0, the master, is the "master" of
nothing. See Slave.
Megabyte or MB
Megabyte or MB is 1,000,000 bytes or 10^6 bytes. IT IS NOT
1,048,576 bytes or 2^20 bytes, repeat NOT!
In this document MFM refers to any of the older hard disk
controller interfaces, MFM, RLL and ESDI. It is used to
describe any hard disk controller that uses the Task File
interface on the host side and the ST506/ST412 interface
on the drive side.
PC Card ATA
We can thank the Personal Computer Memory Card International
Association for the PC Card specification. The PCMCIA is a
nonprofit industry association. The PC Card ATA
specification is another form of the ATA interface used by
PCMCIA compatible ATA devices. This interface uses the PCMCIA
68-pin connector. Most 68-pin ATA devices are dual mode --
they can operate as either a PCMCIA PC Card ATA device or as a
68-pin ATA device.
We can thank Intel and the other members of the PCI committee
for the PCI bus specification. PCI is intended to be the next
high performance computer bus. PCI is not generally described
as a processor local bus.
PIO or Programmed Input/Output
PIO is a method of data transfer between two devices that uses
the system's main processor as part of the data path. On
x86 systems, the REP INS and REP OUT instructions
implement this data transfer method. INS reads and I/O port
and writes the data into memory. OUTS reads data from memory
and writes the data to an I/O port. Each time an INS or OUTS
instruction is executed, the memory address is updated. The
REP prefix causes the instructions to be repeated until a
counter reaches zero.
ATA device 1. Device 1, the slave, is a "slave" to nothing.
This is the name given to the I/O register interface used by
MFM controllers. It refers to a set of I/O registers, or I/O
ports and I/O port addresses used to program the controller.
In ATA, this name has been replaced by the terms Command Block
and Control Block.
See the SCSI FAQ.
SFF or Small Form Factor
The SFF committee is an ad hoc committee formed by most of the
major storage device and system vendors to set standards for
the physical layout of hard disk and other devices. SFF has
published many specifications that describe the physical
mounting and connector specifications for hard disk devices,
including ATA devices. During a brief period of time when the
X3T9 committee was not doing much work on the ATA-1 interface,
the SFF committee published several specifications that were
not really part of the original SFF charter. Most, if not
all, of these nonphysical specifications have now been
incorporated into the latest X3T9 or X3T10 ATA specifications.
ATAPI is currently an SFF specification.
ST506 and ST412
This is the common name for the hard disk controller to hard
disk drive interface used by MFM, RLL and ESDI controllers and
disk drives. ST stands for Seagate Technology. The ST506 and
ST412 were the Seagate products that set the de facto
standards for this interface many years ago. This interface
is composed of two cables: a 34-conductor and a 20-conductor
VESA and VL-Bus
We can thank the Video Electronics Standards Association for
the VESA Local Bus or VL-Bus specification. The VL-Bus is one
example of a local bus. VESA is a nonprofit industry
association like the PCMCIA.
WG or Working Group
The actual work on various specifications and standards
documents within the X3T9, X3T10 and SFF committees happens in
working group meetings. Most WG meetings are held monthly.
X3T9 and X3T10
These are the names of the official standards committees that
have worked on the ATA-1 and ATA-2 specifications. X3T9 was
responsible for the SCSI and ATA-1 specifications and
standards. X3T10 has replaced X3T9 and is now responsible for
the current SCSI and ATA specifications and standards work.
This term is used in this document to describe the capacity
boundary that exists in most x86 system software. This
boundary limits the size of an ATA disk drive to 528MB. For
cylinder/head/sector style addressing of disk data sectors,
this number is computed as follows:
a) the number of cylinders are limited to 1024, numbered
b) the number of heads (per cylinder) are limited to 16,
c) the number of sectors (per track) are limited to 63,
d) a sector is 512 bytes,
e) 528MB means the following values:
( 1024 * 16 * 63 ) or 1,032,192 data sectors
( 1024 * 16 * 63 * 512 ) or 528,482,304 bytes.
This refers to a variation of the ATA interface that uses the
PCMCIA 68-pin physical interface but does not use the PCMCIA
electrical or logical interface. Most 68-pin ATA devices are
dual mode -- they can operate as either a PCMCIA PC Card ATA
device or as a 68-pin ATA device. This interface was
developed within the SFF committee and is now included in
!!! Where did ATA come from?
What we now call the ATA-1 interface was developed for Compaq
many years ago by Imprimus (then part of CDC, now part of
Seagate) and Western Digital. The first ATA-1 hard disk
drives were made by Imprimus but it was Conner that made the
interface so popular.
!!! How is ATA different from MFM?
From the host software standpoint, ATA is very much like the
Task File interface used by MFM controllers. A properly
written host software driver should not notice any difference
between the MFM Task File interface and the ATA Command Block
interface while doing basic commands such as Read/Write
At the hardware level, ATA uses a single cable between a host
bus adapter and the ATA device, where the MFM controller
interface uses two cables between the controller and the
In the MFM environment, the controller is one piece of
hardware and the drive another piece of hardware. Most likely
these two pieces of hardware are from different vendors. The
MFM controller is dependent on the design of both the host bus
and on the drive.
In the ATA environment, the host adapter is one piece of
hardware the is dependent on the host system bus design. The
ATA interface is (mostly) system independent. All of the
hard disk controller and drive logic is contained in the ATA
device hardware. This gives the hard disk designer complete
control over both the controller and drive functions.
!!! Why is ATA so popular?
Two basic things make ATA so popular today: cost and hard
disk drive technology. An ATA-1 host adapter is cheap,
usually much less than $25US and it uses only one cable. On
the technology side, current hard disk features, such as,
defect handling, error recovery, zone recording, cache
management and power management require that the controller be
fully integrated with the read/write channel, the servo system
and spindle hardware of the disk drive.
!!! What are the basics of the ATA interface?
The ATA interface is a very simple interface based on an ISA
bus I/O device architecture. The interface consists of two
sets of I/O registers, most 8-bit, for passing command and
status information. The registers are like a set of mail
boxes with a door on front and back connected such that both
doors can not be open at the same time. The front door is
open when the Busy bit in the Status register is zero and the
host can read and write the registers. The back door is open
when the Busy bit in the Status register is one and the ATA
device can read or write the registers.
The physical interface contains just enough signals for a 16
bit data bus, five register address bits, and a few control
signals like read register, write register and reset.
ATA devices look like traditional hard disk
drives even though some are not really a hard disc with
rotating platters. User data is recorded in 512 byte sectors.
Each sector has a sector address. There are two ways to
express sector addresses: by cylinder/head/sector (CHS) or by
logical block address (LBA). CHS is standard, LBA is optional.
!!! What is EIDE or Fast ATA?
Both are marketing programs used to promote various ATA-2
features, mostly the faster data transfer rates defined by
WD defines EIDE as:
* Support for drives larger than 528MB.
* Support for two connectors to allow up to four drives.
* Support for CD-ROM and tape peripherals.
* Support for 11.1/16.6 Mbytes/second, I/O Channel Ready PIO
* Support for 13.3/16.6 Mbytes/second, DMA data transfers.
Seagate defines Fast ATA as:
* Support for PIO mode 3 (11.1 MB/sec) and DMA mode 1(13.3
* Support for Multi-sector [Read/Write Multiple] transfers.
* Support for >528 MB.
* Support for Identify Drive Extensions & Set Transfer Mode
* Backward compatibility with ATA-1.
Note: Seagate may be redefining what they call Fast ATA but
I have not seen the new definition yet. I know that several
of their new products support PIO mode 4 and DMA mode 2 (both
at 16.6 MB/sec).
What does all of this mean to us?
Support for the ATA-2 high speed PIO and DMA data transfer
modes is both a hardware and software issue.
Support for more than one hard disc controller (or ATA host
adapter) requires the BIOS and/or the operating system to
support more than one Task File or Command/Control Block
register set on the host bus.
The 528MB problem is due to the original design of the x86
BIOS which limits cylinders to 1024 and sectors to 63. The
ATA interface allows up to 65,535 cylinders, 16 heads and 255
sectors -- that's about 136GB (137GB if is LBA is used).
Support for devices over 528MB requires the BIOS and/or
operating system to support some form of CHS translation.
Note that LBA alone does not solve this problem (in fact,
LBA may make things more complex).
Support for CD-ROM and tape will probably be done via the
ATAPI interface which uses a different command structure than
ATA. That makes ATAPI another host software issue.
!!! What does an ATA-1 host adapter do?
An ATA-1 host adapter is a simple piece of logic whose main
purpose is to reduce the system bus address lines from 12 (or
more) down to 5. It may also buffer some signals giving some
degree of electrical isolation between the host bus (usually
an ISA bus) and the ATA bus. In ATA-1, the ATA interface is
controlled directly by the host bus so that all timings are
controlled by the host bus timing.
!!! What does an ATA-2 host adapter do?
This answer is complex because it depends on how smart your
ATA-2 host adapter is. First, an ATA-2 host adapter probably
supports the ATA-2 higher speed data transfer rates. That
requires that the host adapter is attached to something other
than an ISA or EISA bus. Second, an ATA-2 host adapter may
perform 32-bit wide transfers on the host bus. This requires
FIFO logic and data buffers in the host adapter. Third, an
ATA-2 host adapter may use a different data transfer protocol
on the host side than is used on the ATA device side.
!!! How many disk controllers and/or ATA host adapters and/or
!!! SCSI host adapters can I put in my system?
From a hardware standpoint -- as many as you want as long as
their are no I/O port address, memory address or interrupt
request signal conflicts. From a software standpoint it is a
whole different story.
First the simple x86 system hard disk controller
a) 1 ATA with 1 or 2 drives at I/O port addresses
1Fxh/3Fxh using interrupt request 14 (IRQ14).
b) 1 ATA with 1 drive at I/O port addresses 1Fxh/3Fxh
using interrupt request 14 (IRQ14) plus a SCSI with 1 drive.
c) 1 SCSI with 1 or 2 drives.
Other configurations are possible but are most likely not
supported in the system or SCSI host adapter BIOS. And if its
not supported at the BIOS level, it is unlikely to be
supported by an operating system, especially DOS. The primary
reason the above configurations are so restrictive is that the
original IBM x86 BIOS supported only one MFM controller with a
maximum of 2 drives. This restriction was then coded into
much x86 software including many early version of DOS. The
configurations above work because they don't break this old
Just remember this -- most systems will always boot from
the first drive on the first controller. In a) that is
ATA drive 0, in b) that is ATA drive 0, in c) that is
SCSI drive 0.
And now the more complex configurations...
Once you go beyond the three configurations above all bets are
off. Most likely you will need operating system device
drivers in order to access any drives beyond the first two.
And now your real problems start especially if you like to run
more than one operating system!
If you do run more than one OS, then you need equivalent
drivers for each system if you would like to access all the
drives. Plus it would be nice if all the drivers configured
the drives in the same manner and supported all the possible
partitioning schemes and partition sizes. It would be
especially nice if a driver would not destroy the data in a
partition just because it did not understand the file system
format in that partition.
One of the things EIDE promotes is BIOS support for up to four
ATA devices -- 2 ATA host adapters each with 1 or 2 drives.
The first would be at I/O port addresses 1Fxh/3Fxh using
interrupt request 14 (IRQ14) and the second at I/O port
addresses 17xh/37xh using interrupt request 15 (IRQ15).
Acceptance of this configuration has not been spreading like
wild fire through the BIOS world.
Lets look at a two complex configurations...
a) 1 ATA with 2 drives and 1 SCSI with 1 or more drives.
Nice configuration. The ATA drives would be supported by the
system BIOS and the SCSI drives may be, could be, should be,
supported by the SCSI host adapter BIOS but probably not. So
in order to use the 2 SCSI drives you probably have to disable
the BIOS on the SCSI card and then load a device driver in
CONFIG.SYS. And because the SCSI BIOS is disabled, you then
need a SCSI driver for that other OS you run.
b) 2 ATA with 1 or 2 drives on each.
Also a nice configuration. But because the system BIOS
probably only supports the first controller address, you'll
need a DOS device driver loaded in CONFIG.SYS in order to
access the drives on the second controller. You'll need that
driver even if there is only one drive on the first
controller. You also need a similar driver to support the
second controller in your other OS.
Note: I understand that OS/2 does support both MFM/ATA
controller addresses and does allow up to four drives -- I
have not confirmed this for myself.
!!! Do I need BIOS or OS drivers to support more than 528MB?
Warning: Read the previous question before reading this one.
Maybe, probably, yes. The answer to this *very* complex and
will be discussed in detail in Part 2. Here is the brief
A traditional x86 system BIOS supports only CHS mode
addressing with cylinders limited to 1024, heads limited to 16
and sectors limited to 63. This allows addressing of drives
up to 528MB. These limitations come from the INT 13
read/write calls that combine a 10-bit cylinder number with a
6-bit sector number into a 16-bit register.
Note that this is entirely a software problem: the ATA
interface supports up to 65,535 cylinders, 16 heads and 255
While the head number usually requires only 4-bits, up to 6 or
8 bits are available in the INT 13 interface. This fact has
allowed the SCSI folks to support big drives by increasing the
number of heads above 16. The SCSI host adapter BIOS converts
this "fake" CHS address to a different CHS or an LBA when it
issues a read/write command to the drive. The following table
shows some approximate drives sizes and the "fake" CHS
parameters that you may see from a SCSI BIOS:
cyl head sector size
1024 16 63 512MB
1024 32 63 1GB
512 64 63 1GB
1024 64 63 2GB
1024 256 63 8GB
The last entry represents the largest possible drive that
a traditional INT 13 BIOS can support.
The system BIOS folks *must* start supporting drives over
528MB in their BIOS by implementing some type of CHS
translation. To date, few systems have such BIOS. And here
is the bad part: Microsoft says that the BIOS *must*
support it in order to use it in their OS. The algorithm is
simple (but warning: this is not the complete algorithm!):
INT 13 input action ATA interface
cyl number "multiply" by n modified cyl number
head number "divide" by n modified head number
sector number nothing sector number
The value of n must be selected such that the modified head
number is less than 16.
LBA addressing at the hard disk drive level or at the BIOS or
driver level is another solution. This solution will probably
not be popular for several more years. It requires that the
BIOS people implement a new INT 13 interface, called the
Microsoft/IBM Extensions and that the OS people start using
this new BIOS interface. Few system BIOS support this
alternative interface today. Without this new interface, LBA
support at the hard disk drive level is not required.
So most of us have older systems without much possibility of
getting a BIOS upgrade, so what do we do? Well we must obtain
one of the many driver products that are on the market that
live in one of the disk boot sectors and "take over" the
system BIOS INT 13 with an INT 13 that supports the
translation. The biggest problem with this is that the
replacement INT 13 BIOS must live someplace in memory. For
DOS based systems, it can usually live at the top of the 640K
of memory and DOS is made to think that that part of memory,
usually around 8K bytes, does not exist. But the protected
mode OS's don't like this and usually wipe out the driver when
they load their kernel. So if you plan to run multiple OS's
on your system, buyer beware!
Then there is the Windows problem: the standard FastDisk
driver in Windows does *not* support such translation schemes
and can not be enabled. So make sure the driver you
purchase also comes with a Windows FastDisk replacement.
!!! Do I need BIOS or OS drivers to support the ATA-2 data
!!! transfer rates?
Warning: Read the previous two questions before reading this
Maybe, probably, yes. The answer to this *very* complex and
will be discussed in detail in Part 2. Here is the brief
If you have a new ATA drive that supports the advanced PIO or
DMA data transfer rates (ATA-2 PIO Mode 3 or 4, or, ATA-2 DMA
Mode 1 or 2) then you also must have a new ATA host adapter
that attaches to the VL-Bus or PCI bus or some other high
speed bus (probably a 32-bit bus) in your system. That host
adapter has I/O registers of its own that are used to control
its advanced features. Controlling those advanced features
requires software -- either in the system INT 13 BIOS or in a
INT 13 BIOS on the host adapter card or in a driver loaded
via the boot record or later by your OS.
Depending on how that host adapter works you may also
need a Windows FastDisk replacement in order to use the high
speed data transfer modes in Windows.
!!! I just purchased a new high speed host adapter for my VL-Bus
!!! (or PCI bus) system and a new 540MB hard disk. How do I get
!!! full use out of all this new hardware?
Did you read the previous three questions?
You need BIOS or driver software and a Windows FastDisk
replacement. These *must* support both CHS translation
(because your drive is over 528MB) and the host adapter
hardware (to use the high speed data transfer rates).
Some drivers on the market today use LBA addressing on the
ATA interface to get over 528MB. This may make your disk
partition(s) unreadable by another OS.
Check the hardware and software specifications of the product
before you buy it! Ask lots of questions -- you probably get
lots of incorrect or misleading answers -- be prepared for
that! If you plan to run something other than DOS and
Windows, especially if you plan a "dual boot" or "boot
manager" environment, be real careful.
OPINION: I know of only one product that supports all of this
new hardware, supports over 528MB *and* supports most of the
current OS's that are shipping including several in shipping
in beta form. The product is from a small two person company
that is trying to sell the product on an OEM basis and not in
the retail market. - Hale Landis
!!! I have an older ATA-1 drive and I want to add an ATA-2 drive
!!! on the same host adapter (same cable). Can I run the new
!!! drive in its ATA-2 data transfer modes?
Sorry, *NO* you can *NOT* run the new drive in its faster data
transfer modes. Be very careful, most of the ATA-2 host
adapter vendors don't have anything in their setup
documentation or software to prevent this sort of thing.
When you run the new drive at a data transfer speed that is
faster than the older drive can support, you are violating the
electrical interface setup and hold times on the older drive.
There is no telling what the older drive will do about this,
but you are asking for data corruption and other nasty
problems on your older drive.
/end part 1/