0

I have this problem related to the concept of Direct Memory Access (DMA). Does the OS/Linux Kernel have some ways to know which instruction is using DMA and which doesn't? Or the DMA is completely implemented by hardware and OS has no access to the DMA controller?

David
  • 15,894
  • 22
  • 55
  • 66
Junji Zhi
  • 1,382
  • 1
  • 14
  • 22
  • By a little search, the simple answer is yes. The kernel documentation (https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt) indicates that the kernel does use DMA related API. The next question is when and where kernel needs to use such APIs. – Junji Zhi May 06 '14 at 15:19

1 Answers1

1

Your question is not very clear, because DMA is not about CPU instructions. It's a piece of hardware that handles memory access without involving the CPU. For example it would be highly unproductive to receive a network packet byte by byte from a network adapter. Instead the OS sets up a DMA region that is accessible by the network adapter which writes the received data directly into that region without having to occupy the CPU. So, of course the OS is aware of DMA, it is one of its tasks to manage its configuration in order to preserve CPU cycles for more useful work.

Grapsus
  • 2,714
  • 15
  • 14
  • Although it can be a bit confusing these days since both Intel and AMD integrated the PCI-e and the RAM controllers into the same chip as the CPU. – Zan Lynx May 06 '14 at 23:28