Skip to main content

Module dma

Module dma 

Source
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 (0x80 itself 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.