Stupid Linux Tricks

Mike Reinehr cmr
Mon May 8 11:18:59 PDT 2006


On Monday 08 May 2006 10:45 am, Chong Yu Meng wrote:
> Hi all,
>
> Not sure how useful this "trick" is to people on this list, and probably
> some people on this list already know this trick, but it took me a long
> time before I found out about it:
>
> If you have a monitor that can support higher than 640x480 resolution,
> you may want the monitor to display more information during boot (i.e.
> use smaller font sizes, so more lines can be displayed on your screen).
>
> You need to determine the maximum resolution that your monitor can
> support, then cross-reference the table below to determine the correct
>
> VGA code to use:
> 	|          R E S O L U T I O N		   |
>
> 	+-------------------------------------------
>  COLORS	| 640X480 | 800X600 | 1024X768 | 1280X1024 |
> +-------+-------------------------------------------
>
> | 256   | 0X301   | 0X303   | 0X305    | 0X307     |
>
> +-------+-------------------------------------------
>
> | 32K   | 0X310   | 0X313   | 0X316    | 0X319     |
>
> +-------+-------------------------------------------
>
> | 64k   | 0X311   | 0X314   | 0X317    | 0X31A	   |
>
> +-------+-------------------------------------------
>
> | 16M   | 0X312   | 0X315   | 0X318    | 0X31B     |
>
> +-------+-------------------------------------------
>
> The table is not my own, but comes from some authoritative source which
> was not mentioned in the newsgroup post where I found this gem.
>
> After you get the code that corresponds to the color and resolution you
> want, you need to add the code as a kernel parameter in
> your /etc/grub.conf. For example, on my notebook, the monitor can
> support up to 1024x768. I want just 256-color support, so this yields
> the code 0x305.
>
> I then locate the line in /etc/grub.conf and append the "vga=" parameter
> next to it. Like so:
>
> title Fedora Core (2.6.16-1.2107_FC5)
>         root (hd0,2)
>         kernel /vmlinuz-2.6.16-1.2107_FC5 ro
> root=/dev/VolGroup00/LogVol00 vga=0x305
>
>
> The next time you boot, you will see a cute Tux logo appear in the top
> left corner of your screen and the font will be smaller.
>
> One word of warning: I read somewhere that this parameter can cause
> serious problems on some monitors, and some monitors (Dell?) require
> vga=731 to work. What 731 refers to, I have no idea.
>
> Anyway, hope this helps somebody out there. It took me long enough
> (about 5 years) to find it.
>
> Regards,
> pascal chong

Thanks, Pascal. This is a good trick to know and I use it all the time.

It's not well documented, but the basics are covered in the kernel 
documentation in svga.txt and i386/boot.txt and there is a How-To that I 
stumbled across: http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html

IIRC the earlier kernels needed the vga parameter to be in hex, e.g. 
vga=0x305, but newer ones will accept decimal as well as hex, e.g. vga=731.

You not only need to determine a mode supported by your monitor, but one 
supported by your video card as well. While experimenting, it's fun to have 
your system boot into a console mode not supported by your video card and 
then try to do a normal shutdown "in the dark!"

Cheers!

cmr

-- 
Debian 'Sarge': Registered Linux User #241964

"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC


More information about the Linux-users mailing list