Skip to content

Instantly share code, notes, and snippets.

@Zardoz89
Zardoz89 / DMA.txt
Created April 25, 2014 15:54
DMA on Virtual Computer
There is this kind of interaction between devices and memory:
- Pasive read
- Copy from RAM to device
- Copy from device to RAM
Passive reads, works "watching" the data/address bus when the CPU (or other device) is writing to the RAM. Could keep sync a device internal memory/buffer respect the changes that happens in these memory block. This is simply implemented, reading the desired RAM block with VComputer.RAM(). If a device does passive read to keep sync his internal memory/buffer, it would need a initial Copy from RAM to device to set-up his internal memory/buffers.
Copy from RAM to device, does copy data to the device internal memory/buffers. Obviously this need an active usage of the data and address buses, and only could be a single device doing that at same time. This not means exactly that only a device could be doing a DMA, but that if more that one device try to do DMA, it will need to share the bus time with the other device doing DMA and the transfer rate will be halve.
Copy from device to RA