accessing the contents of video memory

Alexandre Courbot gnurou at
Sun Jan 16 21:46:51 EST 2011

> Hello list. How I can access the video memory directly from user
> space? I tried to map the framebuffer (/dev/fb0) using mmap() and
> ioctl(), but I have not been successful. Really I want to make a copy
> of the contents of video memory and save it  as an image. have any
> suggestions?

With modern cards, the video memory is a pretty large area. In order
to find where the current screen actually resides, you will need to
know more information like what is the driver used (Linux framebuffer?
X? With what kind of card?) and probably dive into the driver code to
understand where the current screen resides. In short, this is not
impossible, but not simple neither.

For many systems (e.g. X) there are also easier solutions for getting
the contents of the current screen from user space (think of all these
screenshot programs). Anyway some more information about your context
would be helpful.


More information about the Kernelnewbies mailing list