Наши партнеры








Книги по Linux (с отзывами читателей)

Библиотека сайта rus-linux.net

G.2. Textmode 100x37

This chapter is a courtesy of Cedric Adjih , though I have changed some minor parts. Please note: Another method to achieve a better resolution in text mode is the use of the framebuffer driver (as explained in the X-Windows chapter above). This method requires kernel reconfiguration (some Linux distributions include an appropriate kernel already) and a new entry (vga=NNN) in /etc/lilo.conf. In text mode it works even with VESA BIOSes before version 2.0, at least on the models I could test it. Though the SVGATextMode method could be faster (couldn't check this yet).

An apparently little known fact about the Neomagic chipset NM20xx is that you can run text mode in 100x37 (i.e. 800x600). This text mode is very nice (as opposed to the 80x25 which is ugly). I tried this with a HP OmniBook 800 and suppose it might work with other laptops using the NeoMagic chip, too.

The main problem is that is a bit difficult to set up, and if you're going wrong with the commands SVGATextMode or restoretextmode some results on the LCD might be frightening. Although I didn't manage to break my LCD with many attempts going wrong, DISCLAMER: THIS MIGHT DAMAGE YOUR HARDWARE. YOU HAVE BEEN WARNED. FOLLOW THE FOLLOWING INSTRUCTIONS AT YOUR OWN RISKS. I'M NOT RESPONSIBLE IF SOMETHING BAD HAPPENS.

G.2.1. Survey

You need to do three main steps:

  1. Enable Linux to boot in 800x600 textmode. The problem is that you won't see any text before the following two steps aren't done.

  2. Automatically run restoretextmode with correct register data.

  3. Automatically run SVGATextMode.

G.2.2. More Details

All the files I have modified, are available for now on my pages

G.2.2.1. Enabling Linux to Boot in 800x600

Recent kernels (2.2.x) need to be compiled with CONFIG_VIDEO_GFX_HACK defined. Default is off. (look in /usr/src/linux-2.2.x/arch/i386/boot/video.S)

This is done by passing the parameter vga=770 to older kernels or vga=7 to 2.2.x kernels. Example with lilo.conf:

 image=/boot/bzImage-modif
label=22
append="svgatextmode=100x37x8_SVGA" #explained later
vga=7
read-only

G.2.2.2. Running restoretextmode and SVGATextMode at Boot Time

Running restoretextmode and SVGATextMode at Boot Time. You must arrange to run restoretextmode <name of some textreg.dat file> and SVGATextMode 100x37x8_SVGA at boot time.

An example textreg.dat for restoretextmode (obtained using savetextmode) is in my tar archive in tmp/, and an example /etc/TextConfig.

Since I'm lazy, I've simply put SVGATextMode and restoretextmode in the /etc/rc.boot/kbd file from my Debian/GNU Linux which get executed at boot time (also available in the tar archive).

G.2.2.3. Now the Key Point

Annoying things will be displayed if you don't use the right SVGATextMode in the right video text mode: this is why I also pass the environmental variable "svgatextmode=100x37x8_SVGA" (arbitrary name) to the kernel (using append=xxx in lilo.conf) when I also set vga=7: the script /etc/rc.boot/kbd tests this variable and calls restoretextmode and SVGATextMode IF AND ONLY IF.

G.2.3. Road Map

  1. Recompile the kernel 2.2.x with CONFIG_VIDEO_GFX_HACK

  2. Insert the restoretextmode with the correct parameter in the initialisation script, with no other changes.

  3. Boot with normal text mode (80x25) but restoretextmode: you should see the screen going to 100x37, but with only 80x25 usable. Don't use SVGATextMode yet.

  4. It is much better to conditionnalize your initialize code as I did, to keep the possibility of booting in both modes: you may test this now with some reboots (starting restoretextmode or not).

  5. Boot with 100x37 text mode using parameter vga=7 (lilo.conf), you should see white background at some point, but the characters will be black on black. This is ok. You'll have to reboot blindly now.

  6. Insert the <path>/SVGATextMode 100x37x8_SVGA after the restoretextmode in initialization scripts.

  7. Reboot with vga=7 (lilo.conf)

  8. Should be OK now. Enjoy.