Solid-State Floppy Drive Emulator
Floppy and diskette drives are a thing of the past for the average computer user. It's all about thumb drives and Cloud storage today. But many legacy commercial systems still require them. Vendors want to sell new equipment but businesses want to get a good return on their investment and need time to consider upgrade options. Meanwhile, getting those old floppy drives to replace defectives gets harder every day.
The Floppy Disk and Diskette
The terms floppy disk and diskette are used interchangeably but there is a distinction. The floppy disk gets it name from the fact that it was originally flexible. Invented by IBM, the first floppy disks were 8" square. It is comprised of a thin plastic disk with a magnetic venire which is inside a plastic envelope lined with a fabric. The disk turns inside the envelope. A window in the envelope allows a magnetic read head to access the disk. Later came the 5-1/4 inch floppy disk and then the 3-1/2 inch diskette.
The 3-1/2 inch diskette is comprised of a flexible plastic magnetic disk but the envelope is a hard plastic. The window includes a door which protects the disk when it is not inserted into a diskette drive.
The disk tracks contain a primary (low-level) format that is necessary to identify its capacity and type of data encoding. This part of the disk is established in manufacturing and never written to again. There is a high-level format that actually partitions and identifies tracks and sectors. It is written to using the host system's format command. Then there is the actual data which is written when data is saved to the disk and also during the formatting.
Cylinders, Sides, Tracks and Sectors
The disk is logically divided into parts which can be selected by the drive's controller. A typical 1.44MB diskette has two sides and typically the drive has two read/write heads, one on each side of the disk. The disk is partitioned into 160 tracks, 80 tracks on each side. The disk is said to have 80 cylinders because there are 80 positions the read/write head can be in. Each track is subdivided into 18 sectors. Each sector contains 512 bytes of data. So that's 9,216 bytes per track, 18,432 bytes per cylinder, 737,280 bytes per side and 1,464,560 bytes per disk. So, why do they call it a 1.44 meg disk? Because the capacity calculation is performed using a nice round 500 bytes per sector. What's 12 bytes between friends?
Modified Frequency Modulation is a form of encoding data to be transmitted asynchronously. Each bit is transmitted in a 2 microsecond window. The window is divided into clock and data pulses. A logic 1 is always transmitted as a data pulse. A logic 0 is transmitted as clock pulse if the precious data bit was a logic 0. If a logic 0 is transmitted after a logic 1, then no pulse is transmitted. For more on this see: http://en.wikipedia.org/wiki/Modified_Frequency_Modulation.
Floppy Drive Interface
Most of the signals between the drive and LPC are to select the drive, control the read head movement, select the side of the disk and determine if the operation is read or write. All of the timing is controlled by the drive's read signal. The host system must write data back in perfect time with the read signal's timing.
IDE hard drives have its controller built into the drive itself. The old MFM hard drive and today's IDE connected (internal) diskette drives are controlled by either a controller card that is plugged into the host's bus or a dedicated controller interface located on the motherboard. Specifically, the floppy drive is controlled by the LPC (Low Pin Count) interface. The LPC also controls keyboard, mouse, sometimes USB, the parallel and serial ports.
A key point to note, and what makes my endeavor easier is that the diskette drive is in control of the timing. Drive interfaces need to employ phase-locked loops in order to synchronize with the read data and coordinate writing data. They also need to adjust the phase of the write data in order to compensate for the physics of the disk. I won't need to worry about any of that.