Wednesday, December 3, 2008

More than 80 columns in an Ubuntu console with SVGATextMode

For my server running Ubuntu 8.04 I needed the text console 160 columns wide.
I tried some "vga=xxx" settings in the kernel options to increase the resolution of the virtual consoles, and to install the SVGATextMode package, but both ones with no success, because during the boot "something" related to the framebuffer was always making the screen revert to 80x25.
I can't remember the page where I read that the video card framebuffer driver is sometimes conflicting with the framebuffer console, but the info was right. So my steps were (as "root"):

  1. look for video card framebuffer driver with:
    lsmod|grep fb
    in my case s3fb;

  2. blacklist that driver to avoid loading it, by appending
    blacklist s3fb
    to the file "/etc/modprobe.d/blacklist-framebuffer";

  3. comment out vesafb from "/etc/modules":
    #vesafb

  4. install SVGATextMode:
    apt-get install svgatextmode
    (note that it rebuilds "initramfs");

  5. edit "/etc/TextConfig", the configuration file for SVGATextMode, in particular:

    • fitting the video card chip and DAC
      ..
      ChipSet "S3"
      ..
      ClockChip "S3Virge"
    • correcting the "setfont" path
      # Debian defaults for use with kbd again, if you use console-tools
      # then use consolechars as your FontProg instead.
      #FontProg "/usr/bin/consolechars -f"
      FontProg "/bin/setfont"
      FontPath "/usr/share/consolefonts"
    • loading a suitable 8bit font (needed to display well on an 160 columns screen)
      FontSelect "lat1-16"   8x16 9x16 8x15 9x15
      FontSelect "lat1-14" 8x14 9x14 8x13 9x13
      FontSelect "lat1-12" 8x12 9x12 8x11 9x11
      FontSelect "lat1-10" 8x10 9x10 8x9 9x9
      FontSelect "lat1-08" 8x8 9x8 8x7 9x7


  6. edit "/etc/init.d/svgatextmode" by adding the "-x" switch (without it, it did not work: I don't know exactly why) and the text mode desired (bold part)
                    /sbin/SVGATextMode -x "n160x60" >/dev/null
    echo "done."
    ;;

    (note that in the "/etc/TextConfig" coming with the package the mode name "160x60" is used for two different text mode, thus only the last one is effective. I renamed one "n160x60" );
  7. reboot