5
votes

I would like to write into the VGA memory (video memory, not buffer) from user space by mmap-ing in user space and sending the address to kernel space where, i would use pfn remap to map those mmap-ed address to the vga memory (i'll get the address through lspci). And by doing so, i want to display an image/logo on screen? any help regarding this?

1
it is not understandable what you want to do but you can write to /dev/fb00x90
As i get the physical range of video memory by using 'lspci' command, I will remap the virtual address of the mmap that i get from user app through ioctl, to map those addresses to the physical address of the video memory. then, i would like to display a logo / image on screen from user app. help?neo
You may want to identify whatever driver would proxy or pass through access to the software "framebuffer" on your particular installation and examine its source to see how it is interacting with the hardware video memory. Also be aware that while some graphics cards have dedicated video RAM, others use a portion of main memory. On modern systems, beware the risk of false optimization where your attempt to be efficient ends up disabling complicated efficiency optimizations that might make indirect access more efficient than simplistic attempts to write directly.Chris Stratton

1 Answers

2
votes

No need to jump through all those hoops.

Map the corresponding /sys/devices/pci<addr>/resource<N>-file into your process's memory via mmap, et voilà, direct access to PCI memory.