[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interested in starting some basic development



>> Where's a good place to start? I feel that if I start working with an
>> existing API, I won't really have a good understanding of what's
happening
>> at the hardware level.
Whether valid or not, I had the same feeling.  What I did was use the new
frame buffer console (fbcon) in linux.  It allows you to directly mmap
video memory from the linux console.  Upside is that is seems to be very
fast and easy to understand.  Downside is that it requires a development
kernel and a limited number of video cards with a limited number of
resolutions are supported.  To me, this seems to be where graphics on linux
are headed.  Anyone else out there have comments on fbcon?

-Brett

fbcon code would look something like this:
/* open display and map video memory */
     struct fb_fix_screeninfo fix;

     its_display=open("/dev/fb0",O_RDWR);
     ioctl(its_display, FBIOGET_FSCREENINFO, &fix);
     display_mem=mmap(NULL,SCREEN_SIZE,PROT_READ | PROT_WRITE,
                     MAP_SHARED,its_display,0);
/* set color map */
     struct fb_cmap cmap;
     short unsigned int red[MAX_COLORS];
     short unsigned int green[MAX_COLORS];
     short unsigned int blue[MAX_COLORS];

     cmap.start=0;
     cmap.len=MAX_COLORS;
     cmap.transp=NULL;
     cmap.red=red;
     cmap.green=green;
     cmap.blue=blue;
     ioctl(its_display, FBIOPUTCMAP, &cmap);