Formatting a C64 Disk In 15 Seconds

Recently Commodore History investigated just how Commodore 1541 disk drives format disks, and why it took them over a minute. It was also an explanation of just what it means to format a floppy disk. We linked that last week.

Well, yesterday they posted a second video on matters involving formatting disks. (16½ minutes) This time they went over a routine written, for the same drives, that can format a disk in 15 seconds.

So, how can this new formatting method be more than four times faster? In a few ways. The drive’s normal format routine writes 1 bits throughout each entire track; the 15 second formatter doesn’t do anything like that. The stock routine attempts to size the between-sector zones differently depending on how far from the center the track is, and to make that work better it performs a measurement of how fast the drive motor runs. The quick format just uses a same-sized gap throughout the disk. It still reads okay because the drive uses the sync marks to find sectors, it doesn’t try to time the length of gaps when reading, it just looks for a sequence of 10 1 bits in a row. And Commodore’s format routine verifies each track as it’s recorded to the drive; the 15 second format simply moves on, assuming everything worked out.

The result is, the quick formatter does a worse job of setting up the disk, skipping some of the niceties of Commodore’s routine. I wonder if there are some cases where the quick format produces a non-working disk? The video notes that, because there could have been data on the disk before, it could result in cases where the drive gets confused when that leftover data resembles a sync mark or other essential drive structure. Commodore History mentioned at the end of the video that they tried to create such a disk, to see if it caused issues, but was unable to make it happen.

How the C64’s Disk Drives Formatted Disks

The 1541 disk drive was infamously slow, probably the slowest of the 8-bit floppy disk drives, the result of a VIC-20 Kernal bug that was inexplicably kept in the C64 for the sake of backwards compatibility. The problem could be fixed by writing your own disk routines, which is why so many games used fastloaders.

But the bug isn’t always at fault. The 1541 disk drive takes over a minute and a half to format a disk, but as it turns out it had good reason to, and the time consumed had nothing to do with the C64’s code because the drive does all the work itself; the Commodore 64 just waits throughout the process.

Commodore History goes into considerable detail on the process here (16½ minutes). During formatting the drive wipes out all the data that had been on the disk, lays down syncing structures, writes the disk ID to every sector, puts down the directory track and sets up the Block Allocation Map (BAM), and more. It’s an interesting, if not too useful these days, exploration of what disk drives at the time had to do to make the disk’s magnetic surface usable for data storage.