Questions tagged [dma]

Direct memory access (DMA) is a feature of modern computers and microprocessors that allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit.

Direct memory access (DMA) is a feature of modern computers and microprocessors that allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit.

843 questions
57
votes
7 answers

How to get page size programmatically within Linux kernel module code

I am working on a Linux module for IA64. My current problem is that the driver uses the PAGE_SIZE and PAGE_SHIFT macros for dma page allocation. The problem I am having is that the machine compiling the driver is not the ones that needed to run…
Freddy
  • 3,064
  • 3
  • 26
  • 27
48
votes
3 answers

Why mmap() is faster than sequential IO?

Possible Duplicate: mmap() vs. reading blocks I heard (read it on the internet somewhere) that mmap() is faster than sequential IO. Is this correct? If yes then why it is faster? mmap() is not reading sequentially. mmap() has to fetch from the…
Lunar Mushrooms
  • 8,358
  • 18
  • 66
  • 88
36
votes
6 answers

Linux kernel device driver to DMA from a device into user-space memory

I want to get data from a DMA enabled, PCIe hardware device into user-space as quickly as possible. Q: How do I combine "direct I/O to user-space with/and/via a DMA transfer" Reading through LDD3, it seems that I need to perform a few different…
Ian Vaughan
  • 20,211
  • 13
  • 59
  • 79
24
votes
2 answers

How does DMA work with PCI Express devices?

Let's suppose a CPU wants to make a DMA read transfer from a PCI Express device. Communication to PCI Express devices is provided by transaction layer packets (TLP). Theoretically, the maximum payload size is 1024 doubleword for TLP. So how does a…
spartacus
  • 544
  • 2
  • 8
  • 16
24
votes
2 answers

cache - flush and invalidate operation

I have some questions on cache synchronization operations. Invalidate: Before cpu tries to read a portion of memory updated by a device, the corresponding memory needs to be invalidated. Flush: Before the device read a portion of memory updated by…
kumar
  • 2,530
  • 6
  • 33
  • 57
23
votes
3 answers

PCI Express BAR memory mapping basic understanding

I am trying to understand how PCI Express works so i can write a windows driver that can read and write to a custom PCI Express device with no on-board memory. I understand that the Base Address Registers (BAR) in the PCIE configuration space hold…
user3156702
  • 365
  • 1
  • 3
  • 7
22
votes
2 answers

DMA cache coherence management

My question is this: how can I determine when it is safe to disable cache snooping when I am correctly using [pci_]dma_sync_single_for_{cpu,device} in my device driver? I'm working on a device driver for a device which writes directly to RAM over…
Michael
  • 241
  • 1
  • 2
  • 4
19
votes
1 answer

Some questions on dma_alloc_coherent

Is the DMA address returned from this call the same as the physical address? LDD3 says the DMA address should be treated as opaque by the driver. I want to mmap this DMA buffer so user-space can read/write directly to it. Question is what PFN…
ravi
  • 487
  • 2
  • 4
  • 12
17
votes
4 answers

Direct memory access DMA - how does it work?

I read that if DMA is available, then processor can route long read or write requests of disk blocks to the DMA and concentrate on other work. But, DMA to memory data/control channel is busy during this transfer. What else can processor do during…
Boolean
  • 14,266
  • 30
  • 88
  • 129
17
votes
3 answers

DMA transfer RAM-to-RAM

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…
valdo
  • 12,632
  • 2
  • 37
  • 67
14
votes
3 answers

dma vs interrupt-driven i/o

I'm a little unclear on differences between DMA and interrupt I/O. (Currently reading Operating Systems Concepts, 7th ed). Specifically, I'm not sure when the interrupts occur in either case, and at what points in both cases is the CPU is free to…
Joney
  • 309
  • 1
  • 2
  • 8
13
votes
5 answers

Improve performance of reading volatile memory

I have a function reading from some volatile memory which is updated by a DMA. The DMA is never operating on the same memory-location as the function. My application is performance critical. Hence, I realized the execution time is improved by…
12
votes
2 answers

How to write kernel space memory (physical address) to a file using O_DIRECT?

I want to write a physical memory to a file. The memory itself will not be touched again, thus I want to use O_DIRECT to gain the best write performance. My first idea was to open /dev/mem and mmap the memory and write everything to a file, which is…
Friedrich
  • 645
  • 11
  • 26
12
votes
1 answer

What is the difference between DMA and IOMMU?

What is DMA and IOMMU ? How DMA and IOMMU used ? What if architecture does not support IOMMU ? How to use DMA without IOMMU ?
12
votes
3 answers

What is the relationship of DMA ring buffer and TX/RX ring for a network card?

I know that for a network card, OS must allocate tx/rx rings for it so that when OS wants to receive/transmit packets, the network card will know where the packets are and which packets are to be transmit. And when I read about DMA, I see something…
4va1anch3
  • 427
  • 1
  • 4
  • 13
1
2 3
56 57