Expand description
8237 DMA controller (master and slave register files).
Legacy devices (floppy, parallel port, Sound Blaster-era hardware) program
the 8237 through ports 0x00..=0x0F and 0x80..=0x8F, and the 16-bit
cascade through 0xC0..=0xDF. A DOS-class guest probes those registers even
when it ends up using a BIOS disk service; a real firmware such as SeaBIOS
additionally uses channel 2 for every floppy transfer.
The model keeps the raw register file (so probes read back what they wrote)
and decodes the channel state the floppy controller needs: address, count,
page, mode and mask. It never moves data itself: FloppyController names
the transfer, the exit handler performs it through its physical-memory
view, and Dma::complete advances the channel registers.
Structs§
- Dma
- Minimal 8237 state.
- DmaChannel
- Decoded state of one DMA channel.
Constants§
- CHANNELS 🔒
- Number of channels per controller.
- FLOPPY_
CHANNEL - Floppy transfer channel.
- MASTER_
BASE - Master DMA register file:
0x00..=0x0F. - MASTER_
PAGE_ BASE - Master DMA page registers:
0x81..=0x8F(0x80itself is the POST port and is served by the platform model, not here). - SLAVE_
BASE - Slave (16-bit) DMA register file:
0xC0..=0xDF. - SLAVE_
END - Last port of the slave file.
Functions§
- handles_
port - True if the port belongs to either 8237 register file.
- page_
channel 🔒 - Channel a page register belongs to.