Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Engineering Concepts (http://www.go4expert.com/forums/engineering-concepts/)
-   -   virtual memory and DMA (http://www.go4expert.com/forums/virtual-memory-dma-t16790/)

huda 3Apr2009 20:42

virtual memory and DMA
 
hi,
I'm wondering in an issue.
we are know ,io device are using DMAs to acess directly to RAM. So, in this case it isn't needing intrusion from cpu just for setting up registers of DMAs.Also, it haven't access to cache memory.
it is okay to now,
but what about virtual memory? isn't virtual memory in hard disk ,and the last is I/O device?
isn't hard disk using DMAs to access RAM?
but we are know virtual memory have pages and these pages are transferring to RAM blocks and from RAM to cache memory.
how that?
please, I need help in that topic.
i do appreciate any help

xpi0t0s 3Apr2009 21:54

Re: virtual memory and DMA
 
DMA directly accesses memory; that is physical RAM on the machine. It does not write to swap space.
So the processor allocates some memory for the peripheral to fill (which may have an impact on swap because this might squeeze something out), advises the DMA-peripheral what that address is; the DMA peripheral and the processor coordinate over memory access (i.e. they don't both try to access memory at the same time), and the DMA-peripheral flags to the processor (typically via the DMA IRQ) when it is complete.

The hard disk may well use DMA to put data in RAM. Saves it going through the CPU. Prior to DMA, the CPU would handle all memory and I/O requests which would put a major strain on the CPU and stop it doing more important things. With DMA the procesor takes a co-ordinating role and the DMA just gets on with things in the background.

huda 4Apr2009 00:52

Re: virtual memory and DMA
 
(i.e. they don't both try to access memory at the same time), and the DMA-peripheral flags to the processor (typically via the DMA IRQ) when it is complete.

I know that

The hard disk may well use DMA to put data in RAM. Saves it going through the CPU.

here , you brought my attention for an important point .
I'm sorry ,I didn't expose my problem in a proper way.
might the language is the reason.
while I read your comments , I concluded that:
the information is loading from hard disk to RAM by cpu ,and it is loaded page by page to RAM blocks , then to cache. right?

But , when I/o device (ex. h.d ) want to write data or read data (just data) ,it is access directly to RAM using DMA.
right?

but , my question now is ,what is the information is loaded from hard to ram by cpu? and what is the data is read or write to or from hard?
if possible, I want an practical example by which I can imagine the process


many many thanks



xpi0t0s 4Apr2009 03:29

Re: virtual memory and DMA
 
> what is the information is loaded from hard to ram by cpu?

Nothing, that's the whole point. The CPU tells the HDD where to stick its data and the HDD informs the CPU when it's done.

> and what is the data is read or write to or from hard?

Nope, sorry, I don't understand that question at all.


All times are GMT +5.5. The time now is 18:02.