Archive for May, 2009


915resolution with built-in uvesafb

The video BIOSes of many (most?) Intel cards only support a very limited number of standard 4:3 resolutions. Widescreen and native LCD video modes are thus not available in (u)vesafb unless one hacks the BIOS using a special utility called 915resolution.

The usual approach to using the additional video modes with uvesafb is to build the driver as a module and load it after patching the BIOS.  I’ve recently obtained an Eee PC 1000 HE (which has the Intel GME945 graphics card) and wanted to use the native LCD resolution (1024×600) with the framebuffer, while keeping uvesafb built into the kernel.  Such a setup is advantageous in at least the following ways:

  • it provides a working framebuffer from a very early stage of the boot process
  • you don’t need to bother with setting up the initramfs (just like in the case of a standard uvesafb setup)

Here is what to do (the following assumes that you already have a working uvesafb setup, i.e. sys-apps/v86d and dev-libs/klibc are installed, and the kernel is properly configured):

  1. Manually build 915resolution, including all Gentoo patches, but linking the binary against klibc:
    cd /usr/portage/sys-apps/915resolution
    ebuild 915resolution-0.5.3-r2.ebuild unpack
    cd /var/tmp/portage/sys-apps/915resolution-0.5.3-r2/work/915resolution-0.5.3/
    make CC=klcc
  2. Copy the 915resoluton binary to /usr/src/v86d:
    mkdir /usr/src/v86d
    cp 915resolution /usr/src/v86d
    cd /usr/src/v86d
  3. Create a script named v86d using your favourite text editor.  Replace the 915resolution parameters to suit your needs (here we add a 1024×600-32 video mode).  Put the following in the script:
    /sbin/915resolution 4d 1024 600 32
    exec /sbin/v86d.real
  4. Create a file named initramfs, with the following contents:
    dir /dev 0755 0 0
    nod /dev/console 0600 0 0 c 5 1
    nod /dev/tty1 0600 0 0 c 4 1
    nod /dev/zero 0600 0 0 c 1 5
    nod /dev/mem 0600 0 0 c 1 1
    dir /root 0700 0 0
    dir /sbin 0755 0 0
    dir /bin 0755 0 0
    dir /lib 0755 0 0
    file /lib/ /usr/lib/klibc/lib/ 0755 0 0
    file /bin/sh /usr/lib/klibc/bin/sh.shared 0755 0 0
    file /sbin/v86d.real /sbin/v86d 0755 0 0
    file /sbin/915resolution /usr/src/v86d/915resolution 0755 0 0
    file /sbin/v86d /usr/src/v86d/v86d 0755 0 0

    Adjust this script by replacing bJzJ_Gx53KttbTgfZ4dktuoismc with what you actually have in /usr/lib/klibc/lib.

  5. Update your kernel config by setting CONFIG_INITRAMFS_SOURCE="/usr/src/v86d/initramfs".
  6. Rebuild your kernel.
  7. Update grub.conf or lilo.conf, modifying the kernel command line so that it includes your new video mode.  In our case, that would be uvesafb:1024x600-32.
  8. Reboot and enjoy your consoles in the native resolution of your LCD panel.

May 2009
« Feb