Junji Zhi
Junji Zhi

Reputation: 1470

Is Linux kernel aware of which instruction is DMA related?

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?

Upvotes: 0

Views: 76

Answers (1)

Grapsus
Grapsus

Reputation: 2762

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.

Upvotes: 1

Related Questions