DMA transfer RAM-to-RAM

拈花ヽ惹草 提交于 2019-12-03 05:08:57

问题


A friend of mine has told me that on x86 architecture DMA controller can't transfer between two different RAM locations. It can only transfer between RAM and peripheral (such as PCI bus).

Is this true?

Because AFAIK DMA controller should be able between arbitrary devices that sit on BUS and have an address. In particular I see no problem if both source and destionation addresses belong to the same physical device.


回答1:


ISA (remember? ;-) DMA chips certainly have a Fetch-and-Deposit transfer type.

However, from the MASM32 forums:

Hi,

Checking in "The Undocumented PC", he says memory to memory DMA is possible. He then goes on to say that there can be problems, limitations, and that the CPU can do the copy faster than the DMA hardware anyway (MOVSD on 386+).

So it seems to be a yes you can, but who cares, kind of thing.

Regards,

Steve N.




回答2:


Yes, memory to memory transfer is possible well up to 80386 family I have tried with "modern" x86's :)

Specify RAM for source and destination. You might have to watch out for coherence of the L1 cache depending on the device you are programming and if you have enabled the cache.

You might find some code in the Linux kernel for refreshing video RAM pages in shadow memory. This rings a bell.




回答3:


There are definitely DMA engines that cannot transfer between 2 ram addresses, so the second part of the question is already based on an incorrect premise.




回答4:


On ARM Mem-to-Mem DMA significantly improve performance.



来源:https://stackoverflow.com/questions/4297539/dma-transfer-ram-to-ram

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!