ISA DMA: Difference between revisions

m
no edit summary
[unchecked revision][unchecked revision]
m (1 revision imported: import new edits from osdev.org wiki)
mNo edit summary
 
Line 496:
bus. Real code should separate the two "out 0x4" and "out 0x5" calls with an "out" to some other port.
 
<sourcesyntaxhighlight lang="asm">
initialize_floppy_DMA:
; set DMA channel 2 to transfer data from 0x1000 - 0x33ff in memory
Line 512:
out 0x0a, 0x02 ; unmask DMA channel 2
ret
</syntaxhighlight>
</source>
 
Once you have set up your start address and transfer length you do not need to touch it again, if you are using autoinit. Once reading or writing
is selected, you don't need to change that, either. To ''change'' selecting reading or writing you use the mode register.
 
<sourcesyntaxhighlight lang="asm">
prepare_for_floppy_DMA_write:
out 0x0a, 0x06 ; mask DMA channel 2 and 0 (assuming 0 is already masked)
Line 531:
out 0x0a, 0x02 ; unmask DMA channel 2
ret
</syntaxhighlight>
</source>
 
Some hardware, as well as VirtualPC do not support autoinit. You may want to set the Mode registers to 0x4A and 0x46 in the above routines, instead.