Snow Developer Thomas Tells You Everything You Ever Wanted to Know About Apple Mac Floppies
From the controller to the disk format, Thomas talks floppies — all in service of a work-in-progress Rust-based Mac emulator dubbed Snow.
Mononymous developer Thomas has been working on emulating classic Apple Macintosh machines, building an emulator dubbed Snow — and, in doing so, has filled a documentation gap in how their floppy drives worked.
"I have been working on an emulator for early (Motorola 68000-powered) Macintosh computers," Thomas explains. "While implementing the disk drive, I noticed documentation was scattered and hard to find. Now that I have a working implementation, this post is my attempt to document everything in one place."
The original Apple Macintosh launched in 1984 as the considerably more successful follow-up to the Apple Lisa, mimicking its all-in-one design but in a more compact chassis built around a 9" cathode-ray tube (CRT) display. Inside the case was a motherboard housing a Motorola 68000 processor and 128kB of RAM, quadrupled in the later Macintosh 512K, but no hard drive — instead relying on loading software from 3.5" disks.
"The 68000 CPU interfaces with the disk drive through a controller, called 'IWM' (Integrated Woz Machine, a reference to Apple co-founder Steve Wozniak, who designed it)," Thomas explains. "This controller handles all the logic and analog signals to the drive itself and exposes them in a usable way to the CPU. The IWM controller was originally designed for 5.25" drives for the Apple II but the implementation has been modernized for 3.5" drives and the Macintosh."
In creating an emulated version of the IWM, Thomas dug deep into how the controller works — from its input/output lines and registers to how it reads and writes data from and to the disks. Still more research was required to tie down the precise format of these disks — a 6-and-2 version of Group Coded Recording (GCR) with 512 logical bytes per sector and "address marker" headers.
There's the matter of speed control, which uses a software-controlled pulse-width modulation (PWM) signal written in the sound buffer on early Macintosh models but was replaced by hardware speed control in the Macintosh Plus and later models, and the software held in ROM. "For emulation purposes," Thomas admits, "knowledge of the Sony driver is not strictly required. However, it helps tremendously when debugging issues."
Thomas' full write-up is available on his website, along with a range of error conditions he encountered during development; the work-in-progress Rust-language Snow Macintosh emulator, meanwhile, is available on GitHub under an unspecified open-source license.