I did a lot of cleanup of my floppy routines, and got the formatter working with double density. Right now it only runs as a “standalone” program. Once I have CP/M running on the Quay, I’ll put in conditionals to run it either standalone or under CP/M.
The source code is here. It’s released under version 3 of the FSF General Public License.
I haven’t yet written code to handle double-sided disks as I don’t have a blank double-sided disk on hand at the moment. Unlike smaller floppy diskettes, eight-inch double-sided disks have the index hole in a different position than single-sided disks, and double-sided drives detect the medium sidedness and disallow accessing the second side of a single-sided medium.
The formatter will prompt the user for a drive letter (A through D, corresponding to drive numbers 0 through 3), and density (S or D). Single density uses standard IBM 3740 format with tracks consisting of 26 sectors of 128 bytes each. This is the standard CP/M interchange format. For double density I use IBM System 34 format with tracks consisting of 8 sectors of 1024 bytes each.
It’s possible to cram nine sectors of 1024 bytes onto a track by using the same gap length as is used for 256-byte sectors, but writing a sector to such a disk on a drive that is overspeed (but within tolerance) could overwrite the following address field.
I haven’t yet figured out how to get FDC interrupts working on the Quay MPS90-F board, so there’s some kludginess in detecting when a seek is complete.
It would be nice to have some retries for soft errors in the verification code. As it is now, the formatter will declare failure if it gets a read error in the verification.