virtual memory and DMA

Discussion in 'Engineering Concepts' started by huda, Apr 3, 2009.

  1. huda

    huda New Member

    Joined:
    Jan 22, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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.
     
  3. huda

    huda New Member

    Joined:
    Jan 22, 2009
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    0
    (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


     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    > 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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice