As part of opening the Amstrad CPC time capsule, I wanted to transfer data off the Amstrad CPC 3" disks that I had, onto a modern PC for archiving. While various methods have been used over the years, including serial cables and parallel cables, it seemed like the easiest modern solution would be to use a Gotek USB Floppy Emulator, running Flash Floppy, connected to the Amstrad CPC as an external drive (drive B:) -- and then use disckit3.com to copy disk sides from drive A: (the 3" drive) to drive B: (the Gotek emulator).

The Gotek USB Floppy emulators are available in a variety of models, from a bunch of online sources, with relatively little documentation. I bought mine from TechExpress who appear to be the main New Zealand importer. It took some weeks until they had stock again and I could order it, but otherwise they were very good to deal with. Mostly for aesthetic resons I bought the black cased model of the SFR1M44-FU. (As far as I can tell other than the external case -- black or beige -- the various models only differ in terms of the firmware loaded onto them by default, and in some cases the floppy connector on the back. It appears the internal components are almost identical, so in theory the model matters relatively little if you plan to replace the firmware before using it -- other than some of the more specialised models selling for higher prices.)

The SFR1M44-FU model appears to be an IBM PC style 1.44MB floppy disk emulator, intended to be connected directly to an IBM PC. I got no documentation or software with it, just the base unit, so I was left to Internet resoures to figure out how to test it with an IBM PC to make sure the hardware was working before I moved on to replacing the firmware (which also includes soldering some programing headers onto the PCB).

The most useful resources I found, before purchasing the unit, were two reviews by Lui Gough of the 100 floppy unit and the 1000 floppy unit; mine was the 1000 floppy unit, but to get it working I treated it as if it was a 100 floppy unit. (Someone also made some Windows CMD scripts which use the same technique described there.)

Those two reviews also linked to a specification PDF (cached copy) of one of the reviewed models which provided a reasonable idea how to it was intended to function. From looking around online it appears the drive was intended to come with a small CDROM with some Windows based tools -- UFDISKManager.exe and UFloppyManager.exe -- for setting up the USB drive, but these do not seem to be easily available from a reliable source, and besides I did not want to need to use a Windows system just to test the Gotek unit. (A couple of posts also suggested using a Windows program from ipcas.com, but that product/program appears to have been retired, and the link is only available in archive.org.)

After a bunch of experimentation and some dead ends I managed to get my Gotek unit to boot FreeDOS 1.2 on a PC clone by:

  • Reassembling a working PC clone motherboard with a floppy drive interface, and a power supply, video card, and keyboard. This step was somewhat non-trivial as many of the PC power supplies and PC motherboards I had left around had died of old age (eg, capacitor issues). I eventually got enough mostly working bits that the PC would reasonably reliably power on, and bring up the BIOS screen.

  • Connected up the Gotek unit to the floppy drive interface/power

  • Found a USB stick that could be completely overwritten. (A couple of GB is plenty; at most there's 1000 * 1.44MB, which is only 1.44GB. I used an 8GB stick but only because the smaller USB keys I had already had important things on them.)

  • Downloaded a bootable FreeDOS 1.2 floppy image, so I had something to test with. I downloaded FDSTD.144.imz.

  • Created a Gotek USB disk image for 100 floppies, following the instructions from Lui Gough:

      dd if=/dev/zero of=Desktop/gotek.img bs=1024 count=153600
      unzip FDSTD.144.imz
      dd if=FDSTD.144 of=Desktop/gotek.img bs=1024 count=1440 seek=0 conv=notrunc
    

    (which puts the floppy image at slot 0; see Lui Gough's blog post for offset values for other slots -- basically 1536 * slot_number).

    NOTE the conv=notrunc is very important, otherwise the Gotek image file will be truncated, eg, to the length of a single floppy.

  • Plug in the USB drive to the computer with Desktop/gotek.img on it, and then ensure that the USB drive is unmounted.

  • Copied that Gotek USB disk image file onto the raw USB drive, ie as if it was an entire disk image:

    sudo dd if=Desktop/gotek of=/dev/sdN bs=4M
    

    where /dev/sdN is the device for the whole USB drive. Triple check you have it right before copying over it, as this will overwrite the start of the drive, and thus all important partition information.

  • When the copy (dd) finishes, unplug the USB drive and plug it into the Gotek. Make sure the Gotek shows 000 as the selected floppy image, and reboot the PC. All going well the PC should then boot FreeDOS. Success!

Another blog post linked to a usbfd program for setting up the USB drive under Linux, and a blog post about some Python scripts to work with the USB drive -- but I did not find these until after I had proved my Gotek unit worked my satisfaction. If you are not used to using dd to work with raw disk images, you might want to investigate one of those options first.

From this investigation it appears:

  • The default Gotek SFR1M44-FU firmware treats the USB drive as a raw block device, without any underlying file system. I did see a suggestion that some models understood FAT file systems and IMG144 directories, with 000.IMG like files -- but the relevant "block mode` option did not appear to work on my model, so presumably that needs different firmware on the Gotek.

  • Individual floppy slots are simply offsets within that raw device. Which means that you need to put the floppy image at the right offset. Those offsets appear to be 1536*1024KB, which is larger than a 1.44MB disk -- but presumably chosen to ensure that they can store maximum track images, not just 80 tracks * 18 sectors/track * 2 sides disk images.

  • The two keys appear to work as follows:

    • right button cycles the lowest digit of the slot number, xx0 ... xx9

    • left button cycles the middle digit of the slot number, x0x ... x9x

    • both buttons together cycle the highest digit of the slot number, 1xx ... 9xx.

So in theory one could store multiple PC 1.44MB floppy images at appropriate offsets on the USB stick and cycle amongst them with the buttons, to boot different floppy based programs. But in practice for a PC it is probably more useful just to use the USB stick directly, as most semi-modern (eg, last 10 years) PCs support booting from a USB stick.

Anyway, getting FreeDOS booting on this old PC this way allowed me to confirm the USB interface, and floppy interface hardware on my Gotek unit was working, before I changed anything. I plan to test it again after soldering on the programming headers, but before flashing it with Flash Floppy as well, just to be sure that adding the programming headers themselves has not affected anything else.