windows DMA 传输 RAM 到 RAM
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4297539/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
DMA transfer RAM-to-RAM
提问by valdo
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).
我的一个朋友告诉我,在 x86 架构上,DMA 控制器不能在两个不同的 RAM 位置之间传输。它只能在 RAM 和外设(如 PCI 总线)之间传输。
Is this true?
这是真的?
Because AFAIK DMA controller shouldbe 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.
因为 AFAIK DMA 控制器应该能够在位于 BUS 上并具有地址的任意设备之间。特别是,如果源地址和目标地址属于同一物理设备,我认为没有问题。
采纳答案by Andras Vass
ISA (remember? ;-) DMA chips certainly have a Fetch-and-Deposittransfer type.
ISA(还记得吗?;-) DMA 芯片当然具有取回和存入传输类型。
However, from the MASM32 forums:
但是,来自MASM32 论坛:
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.
你好,
检查“未记录的 PC”,他说内存到内存 DMA 是可能的。然后他继续说可能存在问题和限制,并且无论如何 CPU 都可以比 DMA 硬件更快地进行复制(386+ 上的 MOVSD)。
所以这似乎是你可以的,但谁在乎呢?
问候,
史蒂夫·N。
回答by T33C
Yes, memory to memory transfer is possible well up to 80386 family I have tried with "modern" x86's :)
是的,内存到内存的传输可以达到 80386 系列,我已经尝试过使用“现代”x86 的 :)
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.
为源和目标指定 RAM。您可能需要注意 L1 缓存的一致性,具体取决于您正在编程的设备以及是否启用了缓存。
You might find some code in the Linux kernel for refreshing video RAM pages in shadow memory. This rings a bell.
您可能会在 Linux 内核中找到一些代码,用于刷新影子内存中的视频 RAM 页面。这敲响了警钟。
回答by lijie
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.
肯定有 DMA 引擎不能在 2 个 ram 地址之间传输,所以问题的第二部分已经基于不正确的前提。