Being enthusiastic with retro computer programs, I beget a few floppy disks (of the three.5-scamper differ) that I’d snatch to preserve as faithfully as that you are going to be ready to think. Needless to convey, I know there are dedicated units for doing that, similar to the Kryoflux or the SuperCard Professional. Nevertheless it came about to me that I already non-public the compulsory hardware to assign shut the low-level data from a floppy disk: my Saleae Common sense 8 common sense analyzer.
Facet shriek: Whereas I can handiest highly indicate the Saleae analyzers for his or her points and simple-to-verbalize software program, the things described here can moreover be carried out with different common sense analyzers – including these on hand for not up to 10 € from your accepted Chinese language on-line store – and the verbalize of, for instance, the free Sigrok software program.

A primer on the floppy power interface

Opposite to extra trendy mass storage units similar to ATA arduous drives or USB sticks, the interface to a floppy power is much extra low-level. E.g., you are going to be ready to ask a up to date arduous power to learn sector 1337 and it will return you the bytes kept in that sector. In inequity, as soon as it’s selected for reading and the disk is rotating, a floppy power will simply give you a pulse every time the magnetic flux adjustments, i.e. at any time when the magnetic self-discipline adjustments orientation. It’s a ways highly fundamental know that the magnetic self-discipline orientation does indirectly picture the individual bits which might presumably well presumably be kept on the disk. As a substitute, an encoding map is continually outdated. The principle points of the encoding differ between programs – which is why you cannot learn an Amiga disk in an Atari ST, for instance. Whatever the implementation, the encoding continually desires to tackle several things: 1. Encode the ideas bits, obviously. 2. Clock recovery. This is terribly famous on yarn of assorted drives can also rotate at a dinky bit different speeds and the floppy disk controller thus desires to search out out the accurate data rate. 3. Marking the launch up of a sector. This is most often performed by flux patterns that fetch not occur in traditional data.

The following examples will back in ideas MFM (modified frequency modulation) encoding as outdated in IBM PCs and Atari STs. It’s a ways highly fundamental shriek, then again, that the floppy disk imaging is conducted at raw flux level and as such will work with every encoding.

This image reveals the signals furious by reading data from a floppy disk. The write lift signal, write gate, is compelled excessive, which manner deasserted, since floppy disks verbalize packed with life low common sense signals. Then the disk power will return flux transitions as pulses as described above on the learn data line. Top probably the falling edge is related.

Furthermore, in relate that you appreciate the duration of 1 revolution of the disk, the index signal affords one pulse for every revolution. Throughout that time – nominally 200 ms for a 300-rpm, 3.5-scamper power – a total track on the disk is learn. The facet 1 lift signal tells the flexibility which facet of the disk to learn.

In case you zoom in on the learn data signal, you will discover – for MFM encoding and DD (double density) disks – the flux transitions are 4 µs, 6 µs or 8 µs apart.

The best approach to sigh the flexibility which track to learn? There just isn’t the form of thing as a tell instructing the flexibility to glance to, e.g., track 42 by itself. It’s a ways highly fundamental present step pulses – again packed with life low – for every step the flexibility head is supposed to homicide inwards (in opposition to increased track numbers) or outwards (in opposition to decrease track numbers), counting on the path signal. The track 0 signal signifies when the head is on the outermost track.

Connecting the common sense analyzer and shooting a fundamental track

With that data, one can now connect the common sense analyzer to the flexibility. The pinout of the floppy power connector is shown below. All peculiar numbered pins are connected to ground.

Expose: A power taken from an IBM-appropriate PC is configured as power lift B and, thus, wants the power lift B and motor enable B strains pulled low to be selected. Write gate obviously desires to be pulled excessive. My power is a up to date one who handiest requires a +5 V vitality present. Older drives might presumably well desire the +12 V present as smartly.

The output signals, similar to learn data and index, are launch-collector, which manner that a pull-up resistor to 5 V is wanted. To decrease substandard discuss between the flying leads, I outdated common sense analyzer channels 1 and 3 as smartly as lawful grounding. With a DD floppy disk inserted and the motor now spinning, one can assign shut a escape with the common sense analyzer – preferably precipitated on the falling fringe of the index signal.

This seems as expected. A histogram of the times between flux adjustments confirms that certainly 4 µs, 6 µs, and 8 µs prevail.

Controlling the floppy power

In expose to movement the flexibility head, I resorted to 1 other bit of hardware that modified into on hand: a USB serial cable. Mine is from FTDI, nevertheless every cable ought to serene work that not handiest exposes transmit and receive signals nevertheless moreover the back watch over strains. I made the following connections:

RTS → path
DTR → facet 1 lift
TX → step
CTS ← track 0

RTS and DTR are outputs that can also moreover be managed from the serial cable. CTS is an enter. The usage of TX (the transmit line) as step signal manner that sending a 0xff byte will trigger a single step pulse to the flexibility thanks to the launch up bit of the serial transmission. I verified this to work with a terminal program that lets in me to arbitrarily snarl the back watch over strains.


Capturing all 80 or extra tracks of a floppy disk manner that the technique desires to be automatic. Python comes in to hand. Needless to convey, a serial port can with out issues be managed from a Python script (by potential of the pyserial module). Thankfully, the Saleae software program can also moreover be a ways off-managed and there might be a Python module for that, as smartly. A minor self-discipline I chanced on is that the a ways off-back watch over API does not shriek all settings. Due to this reality, I initialize the Saleae software program from a previously saved settings file.

With my performed script, I can step thru your total tracks on the floppy disk, shooting each and every aspects, track by track, with the common sense analyzer. Files is exported from the Saleae software program and imported into Python for added processing. This essentially contains trimming the ideas to 1 revolution of the disk by diagram of the index signal and of calculating the times between flux adjustments, i.e., the times between falling edges of the learn data signal.

Exporting the ideas

Obviously, for preservation the captured data desires to be kept – preferably in an already established structure. I determined to movement with the Supercard Professional (.scp) file structure, on yarn of it’s smartly documented and understood by third-event purposes similar to emulators. An scp file retail outlets times between flux transitions, precisely the form of data that I assign shut with my setup. The Python script modified into rapidly extended to produce the accurate structure including headers.

Conserving the first disk

With hardware and software program now in snarl, one can now take a look at every little thing. For the first take a look at, I selected an unimportant disk, factual in case some malfunction would atomize it. The script ran, the floppy power clicking every time the head moved one track extra inwards. And in the cease, the scp file modified into generated! Its file size is roughly 14 MB. Alive to on that the disk handiest has a usable capability of 720 kB, this reveals how great extra low-level data is preserved by imaging disks at magnetic flux level.

I outdated the HxCFloppyEmulator software program to decode and elaborate the ideas. It accurately decoded the individual sectors captured in the scp file, telling me that every 1440 sectors were decoded with out error – proving that my setup works with out any points!

Also, one can homicide attention-grabbing discoveries. Dangle in ideas this shriek of track 0, facet 0 of my disk. The bit timings – drawn as thick gray strains – phrase the flexibility this disk modified into firstly written with had some jitter, evidenced by the wavy strains. Nevertheless the two sectors containing phase of the FAT (file allocation table) were overwritten by a special power with almost perfect timing – marked by orange packing containers. Thus, you are going to be ready to even verbalize this data to “finger-print” a floppy power.

Closing remarks

In case you snatch to hope to this attempt yourself, yow will discover my Python script in sense-analyzer. You doubtlessly will want to adapt it to your hardware configuration.

There are some things that can presumably well be improved:

  • The technique is reasonably unhurried, requiring ca. 10 seconds per track, ca. 800 seconds for a fat disk. As a rule is spent in the Saleae Python API for shooting and exporting data. Per chance, profiling can highlight probably bottlenecks.
  • To reliably preserve tainted (or reproduction-suited) disks, it’s every now and then required to set up a variety of revolutions per track. The scp file structure lets in for it; my Python script might presumably well be extended accordingly.
  • Since in my setup the flexibility motor is continually on, I want to swap off the vitality present sooner than altering disks. By the verbalize of 1 in all the customary-cause output pins of my serial cable, the motor enable signal might presumably well be managed. Nevertheless, these output pins can’t be snarl by potential of pyserial.