Re: Sample code for performing a DMA from local memory to local memory

Tech-Archive recommends: Fix windows errors by optimizing your registry



Calvin Guan wrote:
> Are you positive? I'm pretty sure it won't do DMA at least on x86
system.

Just to be more precise:

WRITE_REGISTER_BUFFER_ULONG() does not have anything to do with DMA. It
will just take care of transfering a data block from host memory to a
range of device "registers", i.e. usually some (shared) memory area
exposed by the device.

On x86, this is simply implemented as REP MOVSD, I guess.

DMA, however, is a completely different thing. Almost two decades ago,
when the x86 CPU clock rate was in the ~10 MHz range, so-called system
DMA was faster than REP MOVSW (no 32-bit MOVSD was available at that
time).

Today, REP MOVSD is about a couple orders of magnitude faster compared
to the system DMA controller.

The system DMA controller is still there today, as Max pointed out, but
its just there for compatibility reasons. For instance, DMA for the ISA
and EISA bus was using the system DMA controller (slave).

PCI does no longer use the system DMA controller. PCI cards that want
to use DMA must support busmaster DMA themselves. No system DMA chips
involved whatsoever.

[One could, however, still use the system DMA controller to move memory
to a shared memory range exposed by some PCI device - if the physical
address range is within the first 24 bits.]

See also

"Accessing Hardware Registers" by MVP Mark Roddy
http://www.wd-3.com/archive/PioAccess.htm

Stephan

.



Relevant Pages

  • Re: Zero-length packets in isochronous stream
    ... I thought motherboard DMA may have evolved some over the years when I wasn't ... Each buffer is 300K+. ... I have had it suggested that I use local memory to local memory ... The system DMA controller is an antique legacy of days gone by. ...
    (microsoft.public.development.device.drivers)
  • Re: DMA APIs gumble grumble
    ... 32-bit mask should that fail. ... 32-bit SAC addressing is done more efficiently than DAC addressing. ... DAC interfaces to the PCI DMA API for when "you really really want DAC ...
    (Linux-Kernel)
  • Re: direct memory access
    ... No, 1 ISA, 5 PCI and 1 AGP. ... PCI and AGP might be shared. ... >>> If you don't see the Advanced tab, either your hardware doesn't>> support DMA or the DMA settings are incorrect in the BIOS. ... [[With some IDE drivers/Busmastering drivers, DMA cannot be>> enabled through the device manager, but only through the driver>> settings. ...
    (microsoft.public.windowsxp.help_and_support)
  • [PATCH] docs: move DMA-mapping.txt to Documentation/PCI/
    ... -addresses (DMA addresses) into physical addresses. ... This is needed so that e.g. PCI devices can ... -So that Linux can use the dynamic DMA mapping, it needs some help from the ... And at least one platform (SGI ...
    (Linux-Kernel)
  • [PATCH 1/3 for mainline] docs: Move DMA-mapping.txt to Documentation/PCI/
    ... -addresses (DMA addresses) into physical addresses. ... This is needed so that e.g. PCI devices can ... -So that Linux can use the dynamic DMA mapping, it needs some help from the ... And at least one platform (SGI ...
    (Linux-Kernel)