Mar 102011
 

In with the new, Debian 6.0/squeeze. Unfortunately the new isn’t always all good. It seems the trend nowadays is to move to graphical interfaces, which leaves us old console hackers out in the cold. Yes, I prefer good old fashioned text modes. And when I say text mode, I mean hardware text mode, not the new fangled framebuffer and graphical text modes. Why waste resources (memory, CPU) on headless servers that will never show one pixel of graphics? Why not enjoy the speed you can get from text whizzing past on those big directory listings?

After a bit of googling, it surfaced that I was not alone in this quest, as posted by Stephen Powell on debian-user. His solution was to use vga=X during the kernel boot process. However, vga=X has been deprecated in grub2, so Stephen dumped grub2 and reverted to lilo. After struggling for some hours trying to make grub2 accept vga=X, I also had to bite the bullet. Welcome back, lilo, old friend. At least now I had vga=ask available, to find the right VGA mode. At first I was glamored by the VESA modes, only to realize later that they were not text modes, but graphic modes. At last the penny dropped, use the VGA modes from the vga=ask list! After experimenting, I found that vga=0xF07 was the mode for me, which is a 80×60 text mode. Slap on the lat1u-12 font, and I once again had my favorite text mode, 80×40.

However, lilo was irritating me. Surely this must work in grub2 as well? A footnote in the GrubTransition page led me to the solution. Simply replace the default linux loader with linux16, which is the 16-bit loader and supports vga=X. One would wonder what effect a 16-bit loader has on the 64-bit kernel, but so far it seems to all work.

To implement hardware text mode in Debian 6.0/squeeze, add “16″ to the linux and initrd lines in /etc/grub.d/10_linux:

linux16 ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
initrd16 ${rel_dirname}/${initrd}

circa lines 83 and 89. Also make sure you have the following in /etc/default/grub:

GRUB_CMDLINE_LINUX="vga=0xF07"
GRUB_TERMINAL=console
#GRUB_GFXMODE=640x480

ie. make sure GRUB_GFXMODE is commented. For other text modes as per svga.txt:

80x25 - 0xF00 (3840)
80x50 - 0xF01 (3841)
80x43 - 0xF02 (3842)
80x28 - 0xF03 (3843)
80x30 - 0xF05 (3845)
80x34 - 0xF06 (3846)
80x60 - 0xF07 (3847)

For fonts that are more pleasing on the eye (in my opinion), install the console-data package:

# apt-get install console-data

to give you the latX fonts in /usr/share/consolefonts, which you can load at boot time by editing /etc/default/console-setup:

FONTFACE=""
FONTSIZE=""
FONT="lat1u-12.psf.gz"

ie. make sure FONTFACE and FONTSIZE variables are empty, and specify a font to be loaded. Make sure grub is updated:

# update-grub

And reboot. You can experiment with other font sizes, eg.

# setfont lat1u-10.psf.gz
# stty -a

The last command (first line of output) will show you the text screen size, which you can adjust to preference by loading different fonts, limited to 8, 10, 12, 14 and 16 point.

Viola, text mode goodness.

 Leave a Reply

(required)

(required)


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>