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

how to enable framebuffer on linux bootloadr and X server



 
    
how to enable framebuffer on linux bootloadr and X server
---------------------------------------------------------

[root@esker root]# uname -a
Linux esker.its.unimacq.edu.au 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux

[root@esker root]# cat /mnt/hd/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,1)
#          kernel /vmlinuz-version ro root=/dev/hda5
#          initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=30
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
        root (hd1,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /initrd-2.4.20-8.img
title Red Hat Linux (2.4.20-8 with FrameBuffer)
        root (hd1,0)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/ vga=773
        initrd /initrd-2.4.20-8.img
title Windows XP
        rootnoverify (hd0,0)
        chainloader +1


[root@esker root]# cat /tmp/test.c 
#include <sys/types.h>
#include <sys/time.h>
#include <sys/mman.h>
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <linux/fb.h>
#include <linux/kd.h>

main () {

        int fd;

        /* open the frame buffer */
        printf ("opening /dev/fb\n");
        fd = open ("/dev/fb", O_RDWR | O_SYNC);

        if (fd == -1) {
                perror ("open /dev/fb error");
                exit (1);
        }

        printf ("successed!\n");
}

[root@esker root]# gcc -o test /tmp/test.c 

[root@esker root]# /tmp/t 
opening /dev/fb
successed!

[root@esker root]# cat /etc/X11/XF86Config
...
Section "Device"
        Identifier  "Videocard0"
        # Driver      "i810"
        Driver      "fbdev"
        VendorName  "Videocard vendor"
        BoardName   "Intel 845"
EndSection
...
Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        Monitor    "Monitor0"
        DefaultDepth     8
        SubSection "Display"
                Depth     8
                Modes    "1600x1200" "1400x1050" "1280x1024" "1280x960" "1152x864" "1024x768" "800x600" "640x480"
        EndSubSection
...


Here is an explanation of the values you can use:

vga=xxx sets the framebuffer console to a specific resolution.
Here is a table you can use so it can help you decide what resolution 
you want to use:

      colour          depth   | 640x480  800x600  1024x768 1280x1024
      256             (8bit)  |  769      771       773      775
      32000           (15bit) |  784      787       790      793
      65000           (16bit) |  785      788       791      794
      16.7 Mill.      (24bit) |  786      789       792      795

---------
Reference
---------

How to use framebuffer devices <http://www.linux-magazine.com/issue/03/EmbeddedGraphics.pdf>

Google