Floppy

The floppy controller emulates an Intel 82077AA CHMOS single-chip floppy disk controller. It connects to the storage stack through Disk — the same backend abstraction used by NVMe and SCSI. Data transfers use ISA DMA channel 2; interrupts use IRQ 6.

Two variants exist:

Supported media

The controller auto-detects the floppy format from the disk image byte size. See Wikipedia's list of floppy disk formats for background on these formats.

FormatCapacitySectors/trackNotes
Low density (SS)360 KB9Single-sided (one head)
Low density720 KB9
Medium density1.2 MB15
High density1.44 MB18Most common format
DMF1.68 MB21Microsoft Distribution Media Format
XDF1.72 MB23Extended density (fixed 23 SPT variant)

All formats use 512-byte sectors, 80 cylinders, CHS addressing. The controller rejects images that don't match a known format size.

I/O port layout

Register offsets from base (typically 0x3F0):

OffsetReadWritePurpose
+0STATUS_AFixed 0xFF (not emulated)
+1STATUS_BFixed 0xFC (no tape drives)
+2DORDORMotor control, drive select, DMA gate, reset
+4MSRDSRMain status (busy, direction, RQM) / data rate select
+5DATADATACommand/parameter/result FIFO (16-byte)
+7DIRCCRDisk change signal / config control

The controller claims port 0x3F7 for DIR/CCR separately from the 6-byte base region, because 0x3F6 is shared with the IDE controller's alternate status register.

Limitations and deviations

The real 82077AA supports four drives; OpenVMM supports one. The emulator implements a pragmatic subset of the command set — enough for MS-DOS, Windows, and Linux floppy drivers to detect the controller, identify media, and perform read/write/format operations. Commands that interact with physical media timing (perpendicular recording mode, power management) are accepted but largely no-op'd.

Key differences from real hardware:

  • No multi-drive support (real hardware supports drives 0–3).
  • Physical media timing (step rate, head load/unload from SPECIFY) is accepted but doesn't affect I/O timing.
  • CHS-to-LBA translation is straightforward — the controller doesn't emulate track-level interleave or skew.
  • STATUS_A and STATUS_B registers return fixed values rather than reflecting physical drive state.

Crates

CratePurposeRustdoc
floppyFull 82077AA emulatorrustdoc
floppy_pcat_stubStub controller (no drives)rustdoc
floppy_resourcesConfig types (Resource-based instantiation not yet implemented)rustdoc

The storage pipeline page covers how the floppy controller connects to the broader disk backend abstraction.