I'm teaching my son programming "the right/hard way", so we're starting with C, like real men :)
Printing text to the console is fun, but I still remember the exhilaration of switching my old i386 to the 320x200x256 mode and drawing a few colored rectangles... back in the day it was as easy as invoking int 10h
and then you just write bytes to [A000:0000]
to draw pixels on the screen.
With modern Linux, however, such low-level access to the hardware seems to be more complicated (for obvious reasons). I've briefly looked at mmap
-ing /dev/fd0
as described here - turns out there's no /dev/fb0
device on my Ubuntu 13.04. I also looked at using svgalib
- however, their example code displays nothing on my monitor.
So the question is: are there easy ways to obtain direct access to video memory in modern Linux which do not require much system configuration and boilerplate code? It does not have to be a fullscreen access - opening an X window and drawing pixels there would be fine too, as long as it's done via writing data directly to memory.