FrameBuffer in Console

From Initq

Jump to: navigation, search

Linux framebuffer (fbdev) is hardware-independent layer to show graphics on console.

Contents

How to setup framebuffer

FrameBuffer is good for machines where you don't want to install an X server. If you install framebuffer then you can run some X apps. We are able to start qemu straight in console. You also have to remember that framebuffers are very buggy and cause suspend failure, kernel panics and general mayhem. We strongly urge users not to load them.

Check the framebuffer

YOu can check if a framebuffer is installed by using fbset -i.

Install fbset:

  • apt-get install fbset
  • urpmi fbset
[lexiana@initq ~]$ ssh -l root 192.168.1.85 'fbset -i'
root@192.168.1.85's password: 
 
mode "640x480-60"
    # D: 25.176 MHz, H: 31.469 kHz, V: 59.942 Hz
    geometry 640 480 640 32767 8
    timings 39721 40 24 32 11 96 2
    accel true
    rgba 8/0,8/0,8/0,0/0
endmode
 
Frame buffer device information:
    Name        : NV32
    Address     : 0xd8000000
    Size        : 134217728
    Type        : PACKED PIXELS
    Visual      : PSEUDOCOLOR
    XPanStep    : 8
    YPanStep    : 1
    YWrapStep   : 0
    LineLength  : 640
    MMIO Address: 0xe0000000
    MMIO Size   : 16777216
    Accelerator : nVidia Arch 30
[lexiana@initq ~]$

If the output is

[root@initq modprobe.d]# fbset -i
open /dev/fb0: No such device

This means that the framebuffer is not installed.

Enable Kernel modules

Tell the kernel to load these modules into memory. Edit the proper modules file which can be found at

  • /etc/modules
  • /etc/initramfs-tools/modules

Insert in the modules file the following

fbcon
vesafb

fbcon means framebuffer console. If this is loaded then your tty1 will be a framebuffer console. vesafb is a generic framebuffer driver that will work with any video card but if you have an ATI then use radeonfb and if you are using nvidia then use nvidiafb.

Un-black list kernel modules

Almost all distros blacklist framebuffer modules so we will need to un-blacklist them by comments out the lines in the following directory.

  • /etc/modprobe.d/

The black list could be named blacklist-framebuffer or blacklist-compat or something else. To find all occurrences do the following

[root@initq modprobe.d]# pwd
/etc/modprobe.d
[root@initq modprobe.d]# grep fb *
blacklist-compat:blacklist aty128fb
blacklist-compat:blacklist atyfb
blacklist-compat:blacklist radeonfb
blacklist-compat:blacklist i810fb
blacklist-compat:blacklist cirrusfb
blacklist-compat:blacklist intelfb
blacklist-compat:blacklist kyrofb
blacklist-compat:blacklist i2c-matroxfb
blacklist-compat:blacklist hgafb
blacklist-compat:blacklist nvidiafb
blacklist-compat:blacklist rivafb
blacklist-compat:blacklist savagefb
blacklist-compat:blacklist sstfb
blacklist-compat:blacklist neofb
blacklist-compat:blacklist tridentfb
blacklist-compat:blacklist tdfxfb
blacklist-compat:blacklist virgefb
blacklist-compat:blacklist vga16fb
blacklist-compat:blacklist matroxfb_base
[root@initq modprobe.d]#

Comment out the modules you need from the previous set in this file.

Update initrd

Depending on your system do either of the following.

  • update-initramfs -u -k all
  • mkinitrd <initrd> <kernel>

Hardware info

Install a utility called hwinfo and then check

[root@initq modprobe.d]# hwinfo --framebuffer
02: None 00.0: 11001 VESA Framebuffer                           
  [Created at bios.450]
  Unique ID: rdCR.XAjiXf22Hb7
  Hardware Class: framebuffer
  Model: "NVIDIA nv44 Board - p280h9  "
  Vendor: "NVIDIA Corporation"
  Device: "nv44 Board - p280h9  "
  SubVendor: "NVIDIA"
  SubDevice: 
  Revision: "Chip Rev"
  Memory Size: 128 MB
  Memory Range: 0xe0000000-0xe7ffffff (rw)
  Mode 0x0300: 640x400 (+640), 8 bits
  Mode 0x0301: 640x480 (+640), 8 bits
  Mode 0x0303: 800x600 (+800), 8 bits
  Mode 0x0305: 1024x768 (+1024), 8 bits
  Mode 0x0307: 1280x1024 (+1280), 8 bits
  Mode 0x030e: 320x200 (+640), 16 bits
  Mode 0x030f: 320x200 (+1280), 24 bits
  Mode 0x0311: 640x480 (+1280), 16 bits
  Mode 0x0312: 640x480 (+2560), 24 bits
  Mode 0x0314: 800x600 (+1600), 16 bits
  Mode 0x0315: 800x600 (+3200), 24 bits
  Mode 0x0317: 1024x768 (+2048), 16 bits
  Mode 0x0318: 1024x768 (+4096), 24 bits
  Mode 0x031a: 1280x1024 (+2560), 16 bits
  Mode 0x031b: 1280x1024 (+5120), 24 bits
  Mode 0x0330: 320x200 (+320), 8 bits
  Mode 0x0331: 320x400 (+320), 8 bits
  Mode 0x0332: 320x400 (+640), 16 bits
  Mode 0x0333: 320x400 (+1280), 24 bits
  Mode 0x0334: 320x240 (+320), 8 bits
  Mode 0x0335: 320x240 (+640), 16 bits
  Mode 0x0336: 320x240 (+1280), 24 bits
  Mode 0x033d: 640x400 (+1280), 16 bits
  Mode 0x033e: 640x400 (+2560), 24 bits
  Mode 0x0345: 1600x1200 (+1600), 8 bits
  Mode 0x0346: 1600x1200 (+3200), 16 bits
  Mode 0x0347: 1400x1050 (+1400), 8 bits
  Mode 0x0348: 1400x1050 (+2800), 16 bits
  Mode 0x0352: 2048x1536 (+8192), 24 bits
  Config Status: cfg=new, avail=yes, need=no, active=unknown
[root@initq modprobe.d]#

From the above output choose one hex number that signifies the resolution you desire. These numbers are 0x317, 0x311 etc etc.

Edit grub

Edit /boot/grub/menu.lst file and add

  • #defoptions=splash vga=0x317

Then update grub with

update-grub

Reboot and you should be fine.

Personal tools