PATA Storage Device Specifics and Installation

Before you start

Objectives: Learn what is the difference between IDE, EIDE and ATA, how does PATA work, and how do we install PATA drives.

Prerequisites:

Key terms: ATA, drive, IDE, hard, controller, cable, devices, master, MBps, BIOS, EIDE


 Original IDE or ATA-1

We will often hear the terms IDE, ATA, EIDE, PATA, all used interchangeably to indicate the IDE hard drives. The things, we actually have several different types of drives within the IDE specification.

The first and original standard was called the Integrated Drive Electronics (IDE). It was developed by the companies Western Digital and Compaq in 1989, and back in the old days it was often referred to as ATA or ATA-1, which stands for AT Attachment. With the introduction of SATA, original ATA devices are now commonly referred to as PATA devices.

The specific thing about IDE devices is that the controller of the device is located on the device itself. That’s why it has “integrated electronics” in its name. Before the IDE specification, the controller was a separate device. We could actualy buy the controller for our storage device from one vendor, and our drive from another vendor. Sometimes those two simply wouldn’t work together, despite that they should use the same standard. To deal with those compatibility issues IDE drive has the controller integrated on the drive itself.

The single IDE controller can control two drives. To do that, two drives are connected to the single IDE cable. The IDE cable has three connectors. One connector connects to the IDE interface on the motherboard itself or on the IDE expansion board installed on the motherboard. Other two connectors were used to connect two hard drives. When we connect two hard drives in this way, one controller on one drive remains active, and the other controller on the other drive gets disabled. The drive with the enabled controller actually controls both drives. The original IDE cable had 40 pins. One pin on the cable was usually marked with the red stripe. The red stripe indicated the pin 1 on the cable. Back in the old days, original IDE connectors were not “keyed”, so it was possible to plug the IDE connector the wrong way. This would actually destroy the drive. This is why we had to be very careful when looking at the pin 1 direction on the IDE cable. Modern IDE drives have a key on the connectors which prevent us from attaching our drives the wrong way.

The transfer rate of IDE drives was up to 8.3 MBps. The maximum size of IDE drives was actually limited by the settings in BIOS. The maximum size was 504 MB. Another BIOS limitation was that we could not have any IDE devices other then hard drives. Because of those important limitations, a new standard was introduced, and it was called the Enhanced IDE (EIDE).

Enhanced IDE (EIDE) or ATA-2

EIDE is often referred to as Fast IDE or Fast ATA. It is backward compatible with IDE. EIDE allowed us to have larger drives, up to 8.4 GB. The maximum transfer rate was 16.6 MBps. Also, it supported devices other then hard drives, such as CD-ROM drives. Optical and tape drive support was added through the ATAPI extensions. With EIDE we also got two IDE channels on our system – primary and secondary IDE channels. Those two IDE channels allowed us to have up to 4 IDE devices in the system. Two IDE interfaces on our motherboard could be used to connect two IDE cables. IDE cables also had 40 pins, and allowed us to connect two different drives. In the usual implementation we had our hard drives on the primary IDE channel, and our CD-ROM drives on the secondary IDE channel. After the EIDE, there was a new standard which was simply called ATA or ATA-4 (ATA-3 is an enhanced EIDE).

ATA or ATA-4

Despite that original IDE was also referred to as ATA, this term is now used to indicate the later versions of IDE drives. ATA is backward compatible with EIDE and IDE. There are actually four different ATA standards. The first one was called ATA/33, often referred to as Ultra ATA/33. The maximum transfer rate for ATA/33 was 33 MBps. Another ATA standard was ATA/66 (Ultra ATA/66), which provided the maximum transfer rate of 66 MBps. Another standard was ATA/100 (Ultra ATA/100), with transfer rate of 100 MBps. The latest version is ATA/133 (Ultra ATA/133), which provides 133 MBps. In addition to speed, these ultra ATA drives also provide error correction and are self-monitoring and self-reporting.

Note that IDE, EIDE and ATA drives basically all look the same, so even if our computer might support latest ATA standard, the drive will use the standard in which its controller is built. So, to use the latest ATA standard we have to have the latest ATA controller on the drive. Also, to use ATA standards we have to have a newer cable which has 80 wires. Keep in mind that devices and cables still use 40 pin connectors, but the number of wires in the cable is increased to 80. The number of wires is increased to reduce the Electromagnetic interference. 80-wire cable is used for ATA/66 drives and up. Another thing to remember that all ATA devices in the chain will work at the speed of the slowest device connected. For example, if we have one ATA/133, one ATA/33 and one EIDE drive, the whole system will work at the speed of the EIDE drive.

Master and Slave Drives

When working with IDE, EIDE and ATA drives, we have to take care of which drive will be the master drive and which will be the slave drive. As we already mentioned, we can attach two different drives to the same cable on one ATA channel. Most computers will have two ATA channels (primary and secondary), so we can have up to 4 ATA drives on our system. The thing is, when we connect two drives on one cable we also have to configure the master/slave relationship between those two devices. This is because only one device on each channel can have an active ATA controller. If we set a drive to be the master drive, it will have an active controller. The controller on the slave drive is inactive and the slave drive is controlled by the controller on the master drive. So, keep in mind that each channel must have one master drive. We can’t have two master drives on one channel, but we can have two master drives which are located on different channels. The wrong master/slave configuration is a typical mistake when building PC systems and connecting hard drives. Master/slave relationship is usually configured by setting jumpers on the back of the drives. Drives will typically have a sticker on it which shows us how to configure the drive to be the master or the slave drive. Some drives will simply have labels on the back of the drive for proper jumper positions.

The master/slave relationship can be done in several ways, depending on the number of drives on the channel. If we only have one drive on the channel, we should set the jumper to the position “Single”, if the drive has that position. If the drive doesn’t have the “Single” position, we should set the jumper to the “Master” position. If we have two drives on the channel, we have to set the jumper on one drive to the “Master” position, and the jumper on the other drive to the “Slave” position. There is also the “Cable Select” or “CSEL” or “CS” position, and if we use that position, the drive will be automatically set to master or slave based on the position of the drive on the ATA cable.

After the master/slave configuration we should also go to our BIOS settings and check if our disks are visible on the system. Back in the old days we also had to manually set the geometry for the drives in the BIOS. This means that we had to set the cylinders, the heads, and sectors per track manually, or we had to go to the BIOS and run the autoconfiguration tool and save drive settings. On newer systems we don’t have to worry about that since all drives are auto detected and automatically configured during Power On Self Test (POST) procedure, every time we power on our computer. In this configuration the type of disk in BIOS is set to “Auto”. When compared to manual drive configuration, the POST takes a little longer to finish because of the drive configuration.

Logical Block Addressing (LBA)

You will be surprised to hear that we actually use hard drives that have capacity which is actually not supported by our BIOS. First, the BIOS supported hard drives which had up to 1024 cylinders, 16 heads, and 63 tracks per sector. When multiplied by 512 bytes per sector we get a maximum of 504 MB.

In order to use large hard drives on our computer, we have to use one of three different mechanisms. The first one is called Logical Block Addressing (LBA), and it was developed by Western Digital. When we use LBA, the ATA controller presents the BIOS with a set of parameters for the hard drive that fit within BIOS specification. The actual hard drive parameters are maintained by the ATA controller itself. The ATA controller uses Sector Translation feature to translate between BIOS parameters and the actual hard drive parameters maintained by the ATA controller. With the LBA mode, the maximum size for the hard drive is 8.3 GB.

Later, the limitation in the BIOS was 1024 cylinders, 255 heads and 63 tracks which gave us a maximum of 8.4 GB. Modern hard drives exceeded those cylinder/head/track parameters in great amount. The second mechanism to deal with BIOS limitations was called CHS.

CHS

CHS was developed by the Seagate and it works in the similar manner as LBA. Again, the the controller on the drive actually maintains proper drive parameters.

INTI13 Extensions

To accommodate modern hard drives we use a schema called INIT13 extension. In this mode the controller reports parameters to the BIOS and then ignores it completely when communicating with the hard drive. The controller communicates with the hard drive directly, without BIOS. Despite that, hard drive parameters still have to be configured in the BIOS.

Programmed Input/Output (PIO) Modes

When talking about IDE, EIDE and ATA hard disk we also have to understand what is PIO mode. PIO mode is a method of transferring data between the CPU and peripheral devices. When talking about hard drives, PIO modes are used for older IDE drives, and not ATA drives. PIO mode 0 gives us 3.3 MBps, and it is used on really old hard drives. PIO mode 1 specifies the data transfer rate of 5.2 MBps. PIO mode 2 specifies 8.3 MBps, mode 3 specifies 11.1 MBps, mode 4 specifies 16.6 MBps. There are also PIO modes 5 and 6 which are used with CompactFlash cards and provide 20 MBps and 25 MBps.

DMA Specification

As we said, ATA devices don’t use PIO modes. Instead of that, ATA devices use Direct Memory Access (DMA) specification to transfer data. DMA allows the hard disk controller to write data directly to the system RAM without involving the CPU. By using DMA, ATA devices can transfer data up to 133 MBps. There are 4 different DMA modes. In DMA mode 3 data can be transferred at 33 MBps. This mode is used with ATA/33 drives. DMA mode 4 provides 66 MBps and it is used with ATA/66 drives. DMA mode 5 provides 100 MBps and it is used with ATA/100 drives. DMA mode 6 provides 133 MBps and it is used with ATA/133 drives.

Drive Installation

As computer administrators we have to know how to install PATA devices. The first thing we have to know is how does the PATA cable look like. The IDE cable is usually a flat ribbon type cable with three connectors.

 PATA Cable

PATA Cable

Connectors are often color coded. Blue color usually indicates the motherboard connector, black indicates the primary drive connector and the gray indicates the secondary drive connector. This is the convention, but in reality our drives will work even if we connect them in some other order. The wire with a red stripe is to be connected to pin 1. Today, ATA connectors have a key that prevents us from installing the cable the wrong way. Older IDE, EIDE, and ATA33 devices use a 40-pin, 40-wire cable. Newer ATA devices (ATA66 and higher) use a 40-pin, 80-wire connector. The 80-wire cable is backwards compatible with 40-wire devices, but we should not use 40-wire connector for an ATA device.

Before we do anything else, we have to configure the master/slave relationship for our drives. In our example we see the back of a CD-ROM, and we see that our jumper on the “master” position. This position will work if our drive is the only device on the cable or if we have another device configured as “slave”.

 Jumper Settings

Jumper Settings

When configuring the master/slave relationship, the fastest device should be configured as the master drive. If we have only two ATA devices, we should put them on separate ATA channels. For example, if we have one hard drive and one DVD-ROM, we should put them on separate ATA channels. This way two devices don’t have to share the same channel.

 3 Hard Drive

PATA Hard Drive

The BIOS is usually configured to automatically detect the drive parameters. If not, we might need to edit the CMOS settings to configure the drive parameters.

ATA Motherboard

PATA Connector on Motherboard