|[ Team LiB ]|
Floppy Disk Interface
Some things are immutable, changing not at all as the years pass—the constellations in the sky, the crags and rocks of tall mountains, your credit card balance. The floppy disk interface fits in there pretty well, too. It's basically the same connection used on the first personal computer more than two decades ago. It sits there, waiting for you to slide in a boot disk so it can show you all of its stuff.
Part of the reason for this immutability is that the function of the floppy disk hasn't changed over the years. The floppy disk remains a boot device, a data-exchange system, and a backup system—although an increasingly feeble one. At one time, however, it was your only choice for each of these functions. The world has, of course, changed in the intervening years, and the floppy disk is at best the fallback choice for each of these functions. Your needs and the rest of your computer hardware have long passed by floppy technology. In the next few years, the floppy disk and its interface may be left behind.
But the floppy disk interface is not as unchangeable as you might think. During its short history, its speed has notched up twice, its connectors have changed, and the range of devices linking to it has broadened. And its role has changed. CDs have replaced the floppy disk for just about every purpose except emergencies. You could live without a floppy disk drive. Many sub-notebook computers get along perfectly well without them. Every once in a while, though, the need for a floppy arises, and the interface proves useful.
The floppy disk controller brings the interface to life. Its basic purpose is to convert the requests from the BIOS or operating system, couched in terms of track and sector numbers, into the pulses that move the head to the proper location on the disk. In this translation function, the controller must make sense from the stream of unformatted pulses delivered from the drive. It first must find the beginning of each track from the Index pulse and then mark out each sector from the information embedded in the data stream. When it identifies a requested sector, it must then read the information it contains and convert that information from serial to parallel form so that it can be sent through the computer bus. In writing, the controller must first identify the proper sector to write to—which is a read operation—and then switch on the write current to put data into that sector before the next sector on the disk begins.
Most of the hard work of the controller is handled by a single integrated circuit, the 765 controller chip, or rather the equivalent of its circuitry inside your computer's chipset. The 765 circuitry works much like a microprocessor, carrying out certain operations in response to commands it receives through registers connected to your computer's I/O ports. This programmability makes floppy disk controllers extremely versatile, able to adapt to changes in media and storage format as the computer industry has evolved. None of the essential floppy disk drive parameters are cast in stone or the silicon on the controller. The number of heads, tracks, and sectors on a disk are set by loading numbers into the registers of the 765 circuitry. The values that the controller will use are normally loaded into the controller when you boot up your computer.
Special software can reprogram your controller to make it read, write, and format floppy disks that differ from the computer standard. The most common alternate format is the Distribution Media Format used by Microsoft to stuff extra information on floppy disks used for distributing software in the years before programs came on CD.
In its heart and in operation, the floppy disk interface is a glorified serial port to which Dr. Frankenstein's son, the mad engineer, grafted a cable and drive. The control electronics help the drive keep spinning at the right speed and know where to move its head.
It's so simple that if two drives get connected to a floppy disk controller, they get all the same signals all the time, except for one. Two Drive Select signals are used to individually select either the first or second drive, usually drives A or B. If the signal assigned to a particular drive is not present, all the other input and output circuits of the drive are deactivated, except for those that control the drive motor. In this way, two drives can share the bulk of the wires in the controller cable without interference. However, this control scheme also means that only one drive in a pair can be active at a time.
Two signals in the floppy disk interface control the head position of each of the attached drives. One, Step Pulse, merely tells the stepper motor on the drive with its Drive Select active to move one step (that's exactly one track) toward or away from the center of the disk. The Direction signal controls which way the pulses move the head. If this signal is active, the head moves toward the center.
To determine which of the two sides of a double-sided disk to read, one signal, called Write Select, is used. When this signal is active, it tells the disk drive to use the upper head. When no signal is present, the disk drive automatically uses the default (lower) head.
Writing to disk requires two signals on the interface. Write Data contains the information that's actually to be written magnetically onto the disk. It consists of nothing but a series of pulses corresponding exactly to the flux transitions that are to be made on the disk. The read/write head merely echoes these signals magnetically. As a fail-safe that precludes the possibility of accidentally writing over valuable data, a second signal called Write Enable is used. No write current is sent to the read/write head unless this signal is active.
Four signals are passed back from the floppy disk drive to the controller through the interface. Two of these help the controller determine where the head is located. Track 0 indicates to the controller when the head is above the outermost track on the disk so that the controller knows from where to start counting head-moving pulses. Index helps the drive determine the location of each bit on a disk track. One pulse is generated on the Index line for each revolution of the disk. The controller can time the distance between ensuing data pulses based on the reference provided by the Index signal.
In addition, the Write Protect signal is derived from the sensor that detects the existence or absence of a write-protect tab on a floppy disk. If a tab is present, this signal is active. The Read Data signal comprises a series of electrical pulses that exactly matches the train of flux transition on the floppy disk.
The original computer floppy system is the standard for nearly all floppy disk systems. It was designed so that you can install floppy disk drives with a minimum of thought—which gives you an idea of what manufacturers think of their assembly line workers. Once you understand a few simple rules, you can do as good a job as they can—or even better.
Drive Select Jumpers
New floppy disk drives simply plug into a floppy drive cable with no changes or settings. Old drives, however, had drive-select jumpers or switches that allowed you to adjust a given drive as unit zero or one. These settings allowed you to adjust a drive to suit systems that did not follow the current fashion (it's not really a standard) in personal computers. When you install one of these older drives, you must adjust the switches or jumpers to identify the drive as unit one rather than zero. Typically you install a jumper on the pins marked DS1 (for Drive Select One).
Similarly, older systems required the last drive (the one at the end of the cable) to be terminated with a small chip full of resistors. The second drive (if installed) was left unterminated. For practical reasons, termination is no longer a concern. The problems of improper drive termination have proven minimal; manufacturers simply include a termination on all drives and design floppy disk controllers to work adequately whether they have one or two terminations on a given cable.
The cable used by your floppy disk system is key to its proper operation. A twist in the cable actually sets how the two drives get identified. The twist occurs in five conductors in the ribbon cable between the two drive connectors. This twist reverses the drive-select and motor-control signals in the cable as well as rearranges some of the ground wires in the cable.
Because all drives are set up as the second drive, this reversal makes the drive attached to the cable after the twist the first drive, drive A. In other words, drive A is attached to the connector at the end of the cable, the one where the wire twist takes place. Drive B is attached to the connector in the middle of the length of the cable. The third connector, at the end of the cable with no twist, goes to the floppy disk controller or host adapter. Figure 10.18 illustrates the floppy disk cable and the proper connections.
Physical aspects of the floppy disk interface have changed subtly over the years. The original computer floppy disk controller used an edge connector to attach to the floppy disk cable. Since about 1984, controllers generally have used pin connectors, although edge-connector products appeared into the 1990s. Similarly, the connectors on floppy disks migrated from edge connectors to pin connectors. With older computers, this difference can be critical when you need to get the correct cable. With modern computers, you'll want a cable that uses only pin connectors. Figure 10.19 contrasts the two connector styles.
|[ Team LiB ]|