DMA
Re: DMA
virtual memory is implemented on the operating system...the OS maps virtual addresses to physical addresses and updates a page table which is sent to the memory management unit. With DMA, the cpu initiates the transfer by sending the number of bytes and the write address to the dma controller. It allows the cpu to do other operations while I/O from a device is in progress. My question is...is the dma controller aware of virtual addresses? Or just physical addresses?
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: DMA
Would it make sense to apply a mapping that could change when a process switch hapens (which could be at any time) to an asynchronous hardware device? Answer that and you have the answer to your original question.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: DMA
Now again, what is actually performing virtual to physical translations? How is it wired to the DMA controller?icealys wrote:the OS maps virtual addresses to physical addresses and updates a page table which is sent to the memory management unit.
Re: DMA
the MMU is doing the translations and I think anytime you access RAM the transfer needs to go through the MMU.Now again, what is actually performing virtual to physical translations? How is it wired to the DMA controller?
thepowersgang: what do you mean by applying mapping to an asynchronous hardware device? Do you mean to tell me that the mmu gets updated and knows what the current running process is?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: DMA
Wrong. Don't think, know. If you only think it means you're too lazy to make sure.I think
Now back to the original question: Where is the MMU implemented? Where is the DMA controller?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: DMA
Because I want to teach you something more important than just the answer, and the alternative is reporting you for breaking forum rules (smart questions, required knowledge).icealys wrote:umm I'm not too sure why you are asking these questions in my thread
Post your source, please.but they are both on the die of the cpu.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Re: DMA
The DMA controller is in the South Bridge. Hisorically it was a self contained chip.icealys wrote:umm I'm not too sure why you are asking these questions in my thread but they are both on the die of the cpu.Now back to the original question: Where is the MMU implemented? Where is the DMA controller?
Virtual memory is implemented in the processor, and the operating system makes use of the hardware's capabilities. Just as it does with the DMA controller.virtual memory is implemented on the operating system...
The continuous image of a connected set is connected.
- mathematician
- Member
- Posts: 437
- Joined: Fri Dec 15, 2006 5:26 pm
- Location: Church Stretton Uk
Re: DMA
DMA doesn't use virtual addresses. The chipset knows nothing about the memory mapping effected by the CPU. It uses physical addresses. That is why the OS's memory manager has to make special arrangements for devices which need contiguous chunks of physical memory.icealys wrote:thats true...
the IOMMU is what makes it possible for DMA to use virtual addresses which hides fragmentation of physical RAM.
The continuous image of a connected set is connected.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: DMA
Thanks for providing the incomplete answer. Actually, there are many DMA controllers in a computer - none of which are in the CPU because DMA is meant to bypass the CPU.mathematician wrote:The DMA controller is in the South Bridge. Hisorically it was a self contained chip.
But yes, ISA DMA is typically on the southbridge.
Not exactly true. It does if there's a GART or IOMMU in the way.mathematician wrote:DMA doesn't use virtual addresses.
Which is not the MMU, is located elsewhere (not on the CPU), but still performs the same task of address translation and protection. Although more often than that, it's not even present at all.IOMMU
When it does exist, it acts completely independent from the CPU, and needs to be configured explicitly to do something other than pretending it doesn't exist.