DMA & paging

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pepito

DMA & paging

Post by pepito »

Hello:

It is posible to use DMA with memory paging at the same time?

pepito
TheUbu

RE:DMA & paging

Post by TheUbu »

peptio,


Of course if you are in paging more it will write to the virtual page address....


-Christopher
rexlunae

RE:DMA & paging

Post by rexlunae »

"Of course if you are in paging more it will write to the virtual page address...."

Ummm...No it won't.  DMA is not built into the processor, so any of the translations done by the processor are invisible to it.  DMA works with physical addresses only.  In order to use DMA in a pages system (or a segmented system for that matter) you have to figure out the physical addresses of any memory you wish to use with it.
TheUbu

RE:DMA & paging

Post by TheUbu »

rexlunae,


That is not true you can use 32bit DMA with PAGING enabled to use a VM space.


-Christopher
rexlunae

RE:DMA & paging

Post by rexlunae »

Ubu-

I'm not sure we really disagree here.  All I am saying is that to the DMA controller, paging does not exist.  You can, of course, still use paging with it, but the pages you are trying to use must be within the PHYSICAL range that the DMA can access, and all commands to the DMA controller use physical addresses.
pepito

RE:DMA & paging

Post by pepito »

Oh, oh...

Someone have an example or a link where I could read about it?

But thank you.

pepito
CodeSlasher

RE:DMA & paging

Post by CodeSlasher »

Once Paging is Enabled, To perform DMA operations you have to make sure the address you pass to the DMA chip is Linearly Mapped (1:1 mapping) to addresses below 16MB. i.e you use pages that map an address below 16mb to a physical address that is also below 16mb and better if they are the same i.e 0xc000 linear = 0xc000 physical.
rexlunae

RE:DMA & paging

Post by rexlunae »

This place has some documentation.  I don't know how good it is.

http://www.nondot.org/sabre/os/articles ... usDevices/
Post Reply