IDE Basics


Reader Please Note: To the best of my knowledge the information in this document is accurate. If you find any errors, have any comments, additions, or just have questions, please feel free to contact me at billetter@networktechnologist.com.

Glossary

Term
Definition
ATA
AT Attachment or Advanced Technology Attachment - this is the name given to the original IDE specification.
ATAPI
AT Attachment Packet Interface - adds the capability of supporting cdrom devices to the ATA specfication.
Bus Mastering
A refined method of DMA that allows bus mastering devices to transfer data without passing it through the CPU.  Recent advances in bus mastering are referred to as Ultra DMA (UDMA) or Ultra ATA.
Cable Select (CS)
A special cable that has a connector for the master and a connector for the slave device.  Depending on the connector the IDE device is plugged into, deteremines if it is a master or a slave.
CHS
Cylinders/Heads/Sectors
Cluster
One or more sectors on the hard disk which serve to hold the minimum amount of data that can be reserved on the disk for a file.  For example the FAT12 files system has a cluster size of 32KB for a  1 GB hard disk.  This means a 1 byte file requires 32KB of hard disk storage.
Cylinder
Geometric shape made up of all the same tracks on each surface of all the hard drive platters.
DMA
Direct Memory Access - a method of accessing data in memory that bypasses the cpu and allows the device to go directly to the memory, rather than passing all the data through the CPU.
ECHS
Extended Cylinders/Heads/Sectors
EIDE
Enhanced IDE or ATA-2
Encoding
The process of representing a 1 or a 0.
IDE
Integrated Drive Electronics
INT 13
A method of specifying hard drives using cylinders heads and sectors that the bios uses.  It has a 7.88 GB maximum hard disk size.
LBA
Logical Block Addressing
Large
Using ECHS translation
Master
IDE Device that has an active IDE controller
Normal
Using CHS translation
PIO
Programmable Input/Output
Sector
Pie shaped wedge on the disk surface which serves to break each track up into 512 byte areas for data.
Slave
IDE Device that has an in-active IDE controller.  Instead it uses the IDE controller of the master.
SMART
Self Monitoring and Reliability Test - the ability of the hard drive to provide an early warning of disk failure.
Track
Concentric circle on the disk surface to which data is written.
Translation
Converting the BIOS settings to the actual physical geomety of the disk drive.
UDMA
Ultra DMA also known as Ultra ATA, see bus mastering.
XCHS
Another way of specifying ECHS (see above)


Introduction

This article provides the basic details of how the Integraded Drive Electronics (IDE) interface works and how to configure it for hard disks and cdrom drives.  It also provides a summary description of the various IDE specifications that have been developed over the years.  I have written this for my A+ students to provide a complete description of what they need to know in one place.

Hard Disk Basic Concepts

The hard drive stores data in the form of 1's and 0's.  This data is stored on magnetic media using magnetic encoding techniques.  The hard disk itself consist of one or more aluminum platters.  These platters are coated with a magnetic media coating, similar to a audio or video tape, except the rigid aluminum platter has the coating of magnetic material, not a tape.  The data is stored in concentric circles called tracks.  The tracks are broken up into 512 byte segments called sectors.  Since most hard disks have more than one platter, the same track on each platter makes up what is called a cylinder.  The data is read and written by a magnetic read/write head which is affixed to an arm.  As the disk spins the head at the end of the arm can read and write the data.  The arm can move in and out so that the entire hard disk can be accessed.  This fixed arm will have a read/write head for each platter, so that the data is read simultaneously from the same sector on each track of the cylinder.

To complete the installation of the hard disk in the computer requires that the bios understand what type of hard drive you have.  Today this is usually done by telling the bios (through the cmos configuration) how many sectors, cylinders and heads the hard disk has.  This can be manually keyed in (called user defined) or it can be automatically detected if the computer's bios supports that option (called auto).

IDE Basic Concepts

The IDE hard disk is part of the AT Attachment (ATA) specification.  The hard disk itself must be configured as either a master or a slave.  This is done either by jumpers on the hard disk itself, or by a particular position on the cable if a cable-select compatible cable is being used.  Most hard drives do not use cable select cables today, but the newer 80 wire/40 pin cables are often cable select compatible.

A master means that the onboard disk controller is enabled on that disk.  A slave means that the onboard disk controller is disabled for that disk.  If a single hard drive is being used then it must be configured as a master.  If a second hard disk is going to be used on the same cable, then one of the drives must be configured as the master and the other must be configured as the slave.

Cdroms are commonly used with IDE disks today.  This is a result of the ATAPI specification.  The ATA Packet Interface allowed the use of cdroms.  The cdrom is not really a hard disk and as a result does not need to be set as a master (or even as a slave).  However these drives have the ability to be configured as masters or slaves.  It is best to follow the same rules with them as with the hard disks.  If only one cdrom is on the cable make it the master.  If the cdrom is the second device on the cable make it a slave.  Always make the cdrom a slave if it is on the same cable as a hard drive.

The IDE specification allows for the use of 2 disks per cable, the master and the slave.  Most computers come with both a primary and a secondary channel built in.  Each channel has a cable connection, and each cable can support 2 drives.  As a result most PCs today allow the use of 4 IDE devices.  The original ATA specification only allowed a single channel to be built in.  For these older PCs additional channels required purchasing an additional IDE expansion card for the expansion bus.

The IDE devices are normally connected by a 40 wire ribbon cable.  This cable often has 3  40 pin connectors on it, one for each of the 2 ide devices and one connector for the ide controller (usually built into the motherboard).  Unless a special cable select cable is being used, it does not matter which connector is used for the master or which is used for the slave.  The ide controller must use one end of the cable, not the middle connector.  Faster speed disks now require a special 80 wire/40 pin wire, which has twice as many wires, but still uses a 40 pin connector.  The extra wires are ground wires that allow for a faster data transfer using the cable.  Special cables are available as discussed above which allow for cable select.  The connector used actually determines whether the device is a master or a slave.

IDE Cylinder Translation

The IDE disks have evolved greatly over the years.  The original IDE disk was limited to 528 MB of storage.  This was due to a bios limitation at that time.  During the time of the original IDE it was customary to use 10 bits in the bios for the number of cylinders.  This imposed a maximum number of 1024 cylinders.  Which allowed a maximum hard disk size of 528 MB.  This was ok until the 1 GB hard disk was invented.  The method of getting around this problem is called translation.  With translation you specifiy a logical geometry of the hard disk using cylinders heads and sectors.  This logical geometry gets translated to the physical geometry of the hard drive by the hard disk controller.  There are 2 types of translation commonly used, logical block addressing (LBA) and extended cylinder/heads/sectors (known as ECHS or XCHS or Large).

Large disk translation adjusts the actual number of cylinders/heads/sectors to a number that the bios can tolerate.  For example if the number of cylinders is 1500 and the bios can not tolerate more than 1024, ECHS might divide the number of cylinders by 2 (giving up 750 cylinders) and multiplying the number of heads by 2.  This would still give the same disk size, but would result in a different disk geometry (750 heads instead of 1500).  But the hard disk controller would translate this logical geometry back to the actual physical geometry.

LBA doesn't rely on the number of cylinder/heads/sectors, instead it uses the total number of data sectors.  This is simply the total of Cyls X Heads X Sectors.  Each data sector on the hard disk has a unique number.

Since the IDE disks no longer use the actual physical geometry, but translate a logical geometry to the physical geometry, this allows limitations in the bios to be easily over come.  Some of the limitations that have been uncovered in recent years:

Programmable Input Output (PIO)

PIO is a strategy that is used in PCs to improve performance.  Using special PIO chips for input and output operations, the CPU can communicate with the I/O devices very quickly and efficiently.  This technique specifically uses the CPU to perform the data transfer.  However, because the CPU is so fast, this improves the speed of the data transfer.  Due to the different CPUs and motherboard technologies that are in use, PIO uses several standard "modes" to specify it's data transfer rate.  Those rates are listed in the table below.

 ATA Level
PIO Mode
Transfer Rate
ATA
0
3.3 MBps
ATA
1
5.2 MBps
ATA
2
8.3 MBps
ATA-2
3
11.1 MBps
ATA-2
4
16.6 MBps


Ultra DMA (UDMA)

Direct Memory Access (DMA) is the opposite strategy to PIO.  DMA does not use the CPU, but performs the data transfers without the CPUs intervention.  This frees up the CPU for other uses, and does not add any extra clock cycles by transfer data first to the CPU, then having the CPU transfer the data to the device.  Although at slower speeds, PIO is effective, the faster IDE Ultra ATA disk speeds in use today are using UDMA.  The table below summarizes the different UDMA modes available.

ATA Level
UDMA Mode
Transfer Rate
ATA/ATAPI-4
0
16.7 MBps
ATA/ATAPI-4
1
25 MBps
ATA/ATAPI-4
2
33 MBps
ATA/ATAPI-5
3
44.4 MBps
ATA/ATAPI-5
4
66 MBps
ATA/ATAPI-6
5
100 MBps
ATA/ATAPI-6
6
133 MBps

Note:  UDMA speeds above 44.4 MBps require a special 40 pin/80 wire cable.  The extra wires are ground wires that allow for faster data transfer across the ribbon cable.

Summary of ATA Specifications

This is a listing of all the ATA specifications and their corresponding PIO or UDMA transfer rates:

ATA

Known as IDE
Single Channel
528 MB disk limit
PIO Mode 0, 1, 2

ATA-2

Also know as Enhanced IDE (EIDE)
Support for disks above 528 MB
Dual primary and secondary channels.
PIO Mode 3,4

ATA-3

No speed improvement
SMART Technology

ATA/ATAPI-4

CDROM Support
UDMA Mode 0,1,2

ATA/ATAPI-5

Ultra ATA 66 required special 80 wire 40 pin cable
UDMA Mode 3,4

ATA/ATAPI-6

UDMA Mode 5,6

Troubleshooting

Hard drives problems can often be resolved by carefully checking the disk system configuration. Here are several items that cause problems if they are not configured correctly:

CMOS setup
- Today most computer BIOS can automatically detect the hard disk.  However, if the disk drive type is not set to auto, then the number of heads, cylinders and sectors must be specified.  If these parameters are incorrect then the hard disk will not work properly.

Ribbon Cables - The ribbon cables have a red stripe of wire on them.  This stripe must be connected to pin 1 of the motherboard connector (this is often stamped on the motherboard) and pin 1 on the hard disk (this is usually towards the power connector on the disk).  

Jumpers - The hard disk can be configured as a master, slave or cable select.  You must check to see if this is setup properly for your system.  A single hard disk is configured as a master.  Two hard disks on the same channel (same ribbon cable), require that one hard drive be configured as a master and the other hard drive be configured as a slave.

Power Connector
- This is sometimes loose or even disconnected.  Often this is a result of moving wires around when inside the PC.

Match the technology
- This is a difficult problem to identify.  However, the setup of the PC must be consistent.  For instance if you purchase an Ultra ATA 100 hard disk, then several items must be correct in order for it to work at 100 mhz.  First you must setup the BIOS for DMA and you must set up the operating system to support DMA.  Next you must have an 80 wire 40 pin cable to support the speed.  If the BIOS is set to PIO, or DMA is not enabled in the operating system, then the hard disk will operate at the fastest speed that is enabled.

Back To Main Page For List Of Other Documents


Copyright Bill Etter 2002 all rights reserved
Last Revised October 19, 2002
For more information, contact billetter@networktechnologist.com
http://www.networktechnologist.com/pcsupport/ide.htm