CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    58

    Video Card Memory Access

    Hi,

    I'm having some kind of confusion about how these thing work.

    I wonder whether a kernel mode process can access Video RAM using pointers in C like the main RAM.
    Can virtual access actually point to a physical address in a Video RAM, in user and kernel modes?
    Is it just GPU that can do this?
    What different methods by which this access can be accomplished?

    I need a detailed description of this kind of things about the communications between CPU and Video card(both GPU and its RAM)
    I'd be grateful if you indicate a reference for these issues.

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Video Card Memory Access

    I don't think you will get a straight 'here are the details' answer on this post since it's probably highly dependent on what type of graphics board you have. Anyway, all hardware drivers need a static mapping from virtual to physical address space so the kernel provides functions for that.

    Since you post in the Visual C++ forum I guess that Windows is your target? I've never done a Windows driver so I don't know the details but if I were you I'd download the DDK (http://msdn.microsoft.com/en-us/libr.../gg487428.aspx) and look into the video driver example.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Aug 2014
    Posts
    3

    Re: Video Card Memory Access

    If you lost your videos, You can recover them by using Amrev recovery tool. It helps me a lot when I am in need.

  4. #4
    Join Date
    Apr 2014
    Location
    in northeast ohio
    Posts
    94

    Re: Video Card Memory Access

    Hi,

    I'm having some kind of confusion about how these thing work.

    I wonder whether a kernel mode process can access Video RAM using pointers in C like the main RAM.
    a long time ago the cpu actually drew to the vga video memory
    this was a part of ram that was blitted to the screen
    this could be done typically in a assembly language call and that could further be called from c c++
    you would have to set the mode ox32 for instance via a call to a special machine instruction
    set the registers and dump them to the ram memory,
    holding the memory locations corresponding
    to the screen as a 1d array representing 2d space basically x+y*screen pixel stride * mem location bytes + mem offset
    those days are long long gone, now you basically issue commands thru a / to a api the os driver
    translates them to the gpu which does the work, while you can still handle some things on the cpu side such as vsync which the os still needs to have some control over primarily the gpu blits
    Can virtual access actually point to a physical address in a Video RAM, in user and kernel modes?
    Is it just GPU that can do this?
    while technically it may still be possible i imagine its only in a round about way
    as you can pass drop a pixel array into rendertarget or texture on the fly
    you will get cpu speed if you did this for every frame on a complex scene
    it would be very very slow <1 fps

    What different methods by which this access can be accomplished?
    direct x open gl
    nearly all languages provide some wrapper or some type of api built to use dx or opengl
    c c++ can directly use either
    c# xna 1-4 (a managed dx wrapper which was also used for xbox360) ,
    monogame (can use either dx or open gl )
    java has its own interface api's to either dx open gl
    though amd is coming out with mantle
    a new idea on interfacing for apu's and what appears to be more of a api and driver in one,
    its to new to say if it or something like it will eventually move to the same level of dx n open gl
    I need a detailed description of this kind of things about the communications between CPU and Video card(both GPU and its RAM)
    I'd be grateful if you indicate a reference for these issues.
    this is to broad a question to get a simple answer or even one to fit on this page
    as a starting point
    i would simply google combinations of questions on how a modern graphics pipeline works

    (direct x or open gl) (graphics pipeline) (modern) (older) (how it works)
    Last edited by willmotil; August 26th, 2014 at 11:58 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured