[skip nav]

www.ackadia.com



» System Architecture: a look at hard drives «

Hard disk design, Data encoding schemes & interfaces

HARD DRIVES
[Δ]
HARD DRIVE DESIGN


Hard drive The original IBM PC did not support any type of hard drive. Program code in the BIOS did not recognise any such device and early versions of DOS precluded mass storage by limiting the maximum number of directory entries. This is not surprising when you consider that the original 4.77 MHz PC came with 16 K of RAM, expandable to 64 K on the motherboard. Even floppy drives and a disk operating system were options to upgrade the built in cassette recorder port and ROM basic.

To utilize a hard drive in a PC requires:

  • A Hardware IRQ (interrupt request)
  • I/O port addresses for the controller
  • A DMA channel (now optional)
  • Low level program code
  • Sufficient power and cooling
  • A physical interface to the bus (expansion slot or built-in)
  • Operating system support

After DOS 2 introduced the sub-directory system and support for mass storage devices, companies started selling hard drives for the PC. These were external cabinets that contained the disk itself, a controller card, and a dedicated power supply (since the PC's 63.5 watts were insufficient). Migrating from other architectures, these units connected to the PC through cabling to an 8 bit adapter card that plugged into an available expansion slot. These subsystems were configured to use one of the available IRQ's, DMA channels, a range of I/O ports, and program code that was made available through a device driver loaded into memory after boot-up.

The number of drive types supported by CMOS has expanded to over 40 and most current BIOS's provide a user definable type to allow parameters to match any drive. Most PC's today still rely on this original CMOS drive type scheme to configure and control hard disks, though many architectures and BIOS's have changed how the information is stored and updated.

This inherently creates certain limiting factors, including a problem with more than two hard drives and BIOS/OS limits to recognizing more than 1024 cylinders, 16 heads and 63 sectors per track. Various technologies must be used to translate non-compliant physical geometries into logical parameters recognized by the system to maintain compatibility with operating system and utility programs that are tied to these limits. With each sector holding 512 bytes of data this allows for drives no larger than 504 MB.
(1024 X 16 X 63 = 1,032,192 sectors X 512 = 528,482,304 bytes)

To understand this limit, we have to examine how hard drives are accessed by a PC. Primarily, I/O commands are sent to the controller via a range of reserved port addresses. This is a very complicated and tedious process and the ROM BIOS includes a subroutine (INT 13) to perform these tasks for you. The DOS operating system then has certain functions that further simplify the process. They include INT 25/26 functions to read and write absolute sectors to the drive as well as higher level functions (INT 21) to Open files, Close files, Write data to files, etc. Most programs rely on these DOS functions to control access to hard drives and DOS in turn calls the INT 13 BIOS subroutines which do the actual I/O commands.

All of these subroutines are assembly language code that are loaded into memory from either your BIOS chip(s) or Operating System files at startup. Assembly language routines store and manipulate values in registers within the CPU. The lowest common denominator for INTEL based PC's is 16 bit registers. Any program or routine that wants to be backward compatible, must use these base registers whether run on an 8088 or a Pentium. This basic INT 13 is the backbone of PC compatibility and uses 16 bit registers in the following way:

  • DX - 8 bits for head number - 8 bits for drive number
  • CX - 10 bits for cylinder number and 6 bits for sector number
  • The largest 10 bit number possible is 1023 hence the limit on cylinder numbers (from 0-1023) and the largest 6 bit number is 63 (from 1-63) allowing 63 sectors per track.


The DX register allows a maximum of 255 heads, not the 16 that original specifications called for. This is what allows various translation schemes to deal with drives up to 8 GB while remaining INT 13 compatible. The DX register allows 8 bits for drive number, and you should be able to control 255 drives instead of only two; however when the INT 13 sends commands to your controller, it must know the physical geometry of the drive in question. During initialisation of the PC, values for disk types are read from CMOS and stored into an area of RAM called the BIOS DATA AREA. Pointers to those entries are stored in the Interrupt Vector Table (at addresses 0:104h and 0:118h). The table only reserved pointers for two drives, so even if your CMOS held more values, the standard routines wouldn't know how to deal with them.

These INT 13 routines are so limited because they were written at a time when 10 and 20 MB drives were the norm, and 120 MB was unbelievable. They were designed to communicate with a specific controller interface, the ST412/506 standard (WD1003 controller), and the specs for passing parameters included only 10 bits for cylinders number, 4 bits for head number and a single bit for drive number. Some of these limitations have been overcome in the past by replacing the PC's INT 13 sub- routines with code that could recognize and deal with different devices. That's why virtually all SCSI adapter cards include a ROM chip and you must set the drive type to ZERO. In effect, no standard drives installed for the motherboard BIOS to control.

NetWare and other advanced Operating Systems use the drive type only long enough to boot- up and then replace the INT 13 code with their own device drivers. You then need to load a different .DSK file written specifically for each type of controller.

THE HARD DISK:


Within a sealed enclosure (Head Disk Assembly or HDA) are one or more rigid platters that are "fixed" or non-removable. These are coated with magnetically sensitised material and data can be written to and read from the surface by means of electromagnetic read/write heads. When powered up, the platters are constantly rotating (except for certain pre-programmed sleep modes) and the heads are moved back and forth across the surface to access different locations. This is a sealed unit which should not be opened, except by qualified personnel in a controlled, dust free environment.

The circuit board(s) attached to the outside of the HDA provide the electronics needed for physical control of the motors within the sealed unit. They interface the source of electrical power to the disk assembly through varied connectors and cables. Most boards have some jumpers, dip switches and/or resistors that are used for configuration purposes. Functionally, these PCB's are separate from the Hard Disk Controller, but many of the newer drives (IDE and SCSI) embed the controller chip directly onto this board (as opposed to having it on the Bus adapter).

A hard drive subsystem is comprised of the following components:

  • The Hard Disk, with one or more boards (PCB) attached.
  • A Controller Mechanism, either on the hard disk PCB or on the bus adapter within the PC.
  • Bus Adapter for interfacing the controller to the host PC.
  • Cables and Connectors to link it all together.

Inside the HEAD - parts of a hard disk:

  • Disk Platter(s), separated by spacers and held together by a clamp.
  • Spindle shaft onto which platters are mounted.
  • Spindle motor for rotating the platters.
  • Electromagnetic read/write heads (one per surface).
  • Access arms or armatures from which the heads are suspended.
  • Actuator for moving the arms (with heads attached).
  • Preamplifier circuitry to maximise read/write signals.
  • Air filter and pressure vent.

Controllers & Bus Adapters:

The hard disk controller provides the logical link between a hard disk unit and the program code within the host computer. It reacts to requests from the computer by sending seek, read, write, and control signals to the drive and must interpret and control the flow of data. Data moving to and from the drive includes sector ID's, positioning information and timing or clock signals. The controller must encode, decode and separate this control information from actual data written to or read from the drive. Also, data is sent to and from the drive serially, in bit format, but the smallest unit that a CPU can work with is a byte (8 bits). The controller must take bits (8 - 16 - or 32 at a time) and assemble them into bytes, words, and doublewords that can be transferred to/from the computer.

The expansion board that plugs into the PC is commonly referred to as a controller card, but for many drives (primarily IDE and SCSI) the controller mechanism is built directly onto the drive PCB and the expansion board in the PC (or built into motherboard) is actually a Host/Bus adapter.

(I/O) Controller Card
An expansion card that interprets the commands between the processor and the disk drive.

Controller
The chip or circuit that translates computer data and commands into a form suitable for use by the hard drive. Also known as the disk controller.

DATA ENCODING SCHEMES AND INTERFACES


ST506/412
The Standard interface used on XT and AT drives and controllers. Originally developed by Seagate Technologies to support their ST506 (5 MB) and ST412 (10 MB) drives. The entire controller mechanism is located on a controller card and communications between the drive and controller flow over 2 ribbon cables - one for drive control and one for data.

Bernoulli Drive
Named after a Swiss scientist who discovered the principle of aerodynamic lift, principal characteristic of a Bernoulli drive is that the flexible disk floats between the read/write heads, so there is no actual contact between the disk and the heads and, being flexible, it is less susceptible than a hard disk to head crashes

MFM (Modified Frequency Modulation)
This is the original type of hard drive found on PCs. MFM refers to the method of recording bits onto the media of the drive. These drives adhere to the ST-506 hard drive controller standard, which is based on early Seagate drive controllers. It was a common technique used to encode the magnetic fluxes recorded on a drive into data. Most drive types supported in CMOS have 17 sectors per track. This was the standard density for MFM encoding.

RLL (Run Length Limited)
RLL drives and controllers also adhered to the ST-506 standard, but used an encoding method that allowed 50% more information to be recorded on a track than MFM. . This was accomplished by using a larger number of sectors (27 rather than 17 or 19) and required a better quality drive media than that required for MFM, recording more fluxes (bits per inch) for every byte, but packing them more tightly onto the surface. Often called 2,7 RLL because the recording scheme involves patterns with no more than 7 successive zeros and no less than two.

It was the controller card that determined whether a drive is used with MFM or RLL encoding. MFM drives may be low-level formatted using an RLL controller, and vice versa. However formatting a drive meant to be used as an MFM drive as RLL can (and usually does) result in disk errors and subsequent massive data loss. RLL drives can be used with MFM controllers without any problems. Drive manufacturers usually made two versions of otherwise identical drives, one having better magnetic media for RLL use. An example of such a pair would be the ST-225 and the ST-238

ARLL (Advanced Run Length Limited)
More complex yet powerful derivatives of the RLL scheme

ESDI (Enhanced System Device Interface)
Developed by Maxtor in the early 1980's, it was an updated ST-506 standard. Due largely to cost not very many of these drives were made, most being found on older, high-end IBM PS/2s.

In their day, these drives were very large and fast. While the drive did not have an embedded controller, one of the most critical functions, encoding-decoding, was performed on the drive. This allowed for faster communications and higher drive capacities. It used the same cabling as ST506 interface, but carried different signals on each line. These drives required an ESDI controller and were not compatible with any of the previous types.

IDE (Integrated Drive Electronics)
An IDE drive is essentially a very advanced RLL controller built right into the electronics of the hard drive.

Pioneered by Compaq and Conner, the tecnology embedded a controller onto the hard disk PCB while maintaining compatibility with the register level commands sent by the computer's INT 13 routines. IDE drives on-board controllers are configured to appear to the computer like standard ST506 drives and are therefore compatible with software that recognises an ST-506 controller (e.g. Windows 3.1's 32-bit disk access).

Since the controller is on board the drive, the drive manufacturer is free to use some very advanced techniques to increase capacity, speed and reliability of the drives, while keeping the complexity hidden from the user and the computer. These techniques include active error checking, moving the contents of failing blocks to blocks set aside for this purpose (the controller re-maps the sectors, so the computer doesn't even know the block has changed location), zone recording (fewer sectors on the inside tracks and more on the outside), higher disk rotation speeds, and re-mapping of drive geometry to suit the user.

IDE drives are connected to the computer's bus via a "paddle card". Two IDE drives may be hooked up together as a master-slave pair (since they have on-board controllers, one of the controllers must be made the master). This involves setting a master-slave dip switch or jumper on the drives. Most computers and paddle cards only allow two drives on the machine, but some allow up to four. Different brands (especially older models) tended to have problems working with each other as a master-slave pair.

These drives allowed much higher capacity (500MB and greater,) and were very reliable and fast in comparison to older MFM and RLL drives.

ATA (AT Attachment)
Implementation of the IDE design with a 16 bit AT style controller on board the drive.

ATA-2 - Enhancement to the AT Attachment standard to provide for considerable performance improvement and more sophisticated drive identification.

EIDE (Enhanced IDE) and FAST-ATA
Various implementations of the ATA-2 standard as marketed by Western Digital (EIDE) and Seagate/Quantum (FAST-ATA).

While more than adequate for its time (1990-1994) the IDE (or ATA) standard was supplanted by ATA-2. In addition, a standard for connecting CD-ROM and tape drives to IDE interfaces, ATAPI, now exists. EIDE, which incorporates ATA-2 and ATAPI enables:

  • Up to four devices installed, including ATAPI CD-ROM and tape drives, through the addition of a second IDE channel.
  • Faster access modes (called PIO Mode 3 and 4, and Multiword DMA Mode 1 and 2)
  • LBA mode, which allows drives larger than 504MB to be specified in CMOS.
  • Autodetection of hard drive parameters by the BIOS.

While most EIDE/ATA-2/Fast-ATA drives are larger than 504MB, the old IDE specification actually allowed drives larger than 100GB. It was the combination of DOS and IDE that kept usable disk capacities to 504MB. The new ATA-3 standard does not provide for faster transfer modes, but improves reliability, especially at PIO mode 4. It also provides for password-based security, better power management and Self-Monitoring Analysis and Report Technology (SMART).

Newer drives support a DMA/33 mode, which is twice as fast as PIO Mode4 or DMA Mode 2. These drives are sometimes labelled as Ultra DMA or Ultra ATA drives. To use DMA/33, special DMA/33 interface cards, or motherboards with DMA/33 compatible interfaces must be used. UDMA/33 is itself being supplanted by the much faster UDMA/66. Nearly all new EIDE made today support this. However, it requires specially cables and motherboard support to take advantage of its greatly enhanced transfer rates.

SCSI (Small Computer Systems Interface)
SCSI was based on an original design by Shugart Associates. Pronounced "scuzzy", it differs in a big way from the ST-506 standard. SCSI is actually a smart bus - it is controlled with a microprocessor. Each SCSI devices (not necessarily just hard drives - scanners, printers and other devices often use SCSI) on the SCSI bus requires a unique SCSI number, from 1 to 7 (the computer's SCSI number is 0). SCSI devices are daisy chained together by cabling, and the device at the end of the daisy chain has to have a terminator resistor.

For hard drives the entire controller is built onto the drive PCB, allowing for very high speed transfers to and from the drive. Fully interpreted, parallel data is then transferred to and from the PC by way of a single cable through a bus interface that has configured the device as a hard drive. SCSI drives are also usually large and fast. Using one will require the addition of a SCSI adapter. In the early days of SCSI, a lot of devices were made that didn't talk to each other, but those days are behind us for the most part.

SCSI II is a newer standard which allows data transfer rates that are a lot higher than the older SCSI standard. SCSI and SCSI II devices should be able to coexist on a SCSI II bus.

There are also Fast SCSI and Wide SCSI, two standards that allow even greater bandwidth across the SCSI bus. These two standards are most often seen on high end workstations or file servers. Ultra Wide SCSI, Ultra2 SCSI and Ultra3 (or Ultra 160) SCSI allow up to 15 devices. They offer ever faster performance with transfer rates of 40Mb/s, 80Mb/s and 160Mb/s respectively.

Ultra160/m intelligently test and manage the storage network so that the maximum reliable data transfer rate is used. If reliability is at risk, the transfer proceeds without a hitch at a lower. The technology will bring a new level of reliability to parallel SCSI operations by helping to ensure the integrity of transferred data. Ultra160/m SCSI is expected to take host adapter intelligence to the next logical step by actually testing the storage network. If the cabling, back planes, and terminators can support the desired speed, the data flows at full throttle. If not, the hardware will be smart enough to gracefully negotiate a lower transfer rate automatically.

Transition clocking doubles data throughput to 160 megabytes per second, done by sending two pieces of data per clock pulse instead of one, thereby doubling the throughput without increasing the processor's clock speed. Cyclic redundancy check will improve data-transmission reliability via an enhanced error-catching scheme, which can help when hot-plugging devices, where things can get wild and crazy electrically. Finally, Domain validation lets the host and device communicate to find the optimal data speed, and identifies the topology and configuration of the SCSI bus. This allows plug and play in low-end products while maintaining the integrity of enterprise systems.

Other drive interfaces
Three types of serial SCSI, a new kind of SCSI interface, are also available but not yet widespread: SSA (serial storage architecture), FC-AL (fibre channel -- arbitrated loop), and IEEE-1394 (FireWire).

SSA, FC-AL, and FireWire have the ability to share multiple storage devices (and other types of devices) among multiple Macs and PCs. SSA and FC-AL max out at a full 127 devices per setup; FireWire can handle 63 devices.