ISA DMA: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Line 53:
 
As this article assumes you are writing your own OS, the subject of memory management is very important unless you are writing a 286 based operating system. This is because as mentioned earlier, all DMA transactions must occur in the lower 16Mbytes of memory (Yes, I'm repeating myself - memorize - it is crucial)
To be more specific all DMA transactions must occur in PHYSICAL MEMORY. The DMA controller only functions with PHYSICAL memory, if you pass it a virtual address happily mapped into anywhere in memory, the DMA controller will happily ignore your carefully constructed page mapping and access whatever it decides to. VM86 mode does not use PHYSICAL addressing. The physical addresses are FAKE. In VM86 mode the OS must emulate any DMA transactions on behalf of an application, probably in a totally non-DMA way. Almost all DOS memory managers and OSes that uses V86 mode to run DOS apps (including Windows 3.x enhanced mode and EMM386) supplies virtual DMA functions, but these are basically the same, the V86 monitor "fakes" the DMA transaction. DMA has no knowledge of paging whatsoever and I should point out that this includes Bus Master DMA.
Finally (and this is a great laugh when it happens) don't forget to "lock" the pages in memory. Imagine the floppy drive trying to read data from memory and you swap that data out to the hard drive. The DMA chip doesn't know -
"Paging? Whats that then? Dunno. You've just mapped in the password file? No problem, I'll write that out to the floppy instead."
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu