view · edit · attach · print · history

HowTos.VgaModes History

Hide minor edits - Show changes to markup

April 25, 2006, at 09:20 AM by 172.27.1.83 -
Changed lines 23-24 from:

In case you don't have a scientific calculator handy, I've created a page that explains about using the GNU bc command when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexadecimal number.

to:

In case you don't have a scientific calculator handy, I've created a page that explains about using the GNU bc command when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexadecimal number.

Changed line 61 from:

Sources for this page:\\

to:

Sources of documentation used to create this page:\\

November 02, 2005, at 06:40 PM by brian -
Added lines 5-6:

The following content was culled from the Linux kernel documentation; the kernel source and documentation is always considered authorative, this guide is just a collection of information that I put together for people to use.

Changed lines 9-16 from:

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel wants VGA values in hexadecimal. The bootloaders do the conversion of the vga parameter from decimal to hexadecimal for you when they load the kernel. So how do you know which decimal or hexadecimal numbers to use for which video mode?

When you use the vga=parameter in GRUB, LILO, or syslinux, use the decimal number listed below that represents the video mode you want to use; for example, to obtain a framebuffer screen from the kernel that is 640x480 in size with 16 bits for color (64k colors), the tables below say 0x311 hexadecimal, so the vga parameter should be vga=785.

The video mode to be used is selected by a kernel parameter which can be specified in the kernel Makefile (the SVGA_MODE=... line) or by the vga=... option of LILO (or another boot loader). You can hardcode the video mode into the kernel by using the 'vidmode' utility (also known as 'rdev -v') which is present in standard Linux utility packages).

In case you don't have a scientific calculator handy, I've created a page that explains about using the GNU bc command when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexadecimal number.

to:

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel wants VGA values in hexadecimal. The bootloaders do the conversion of the vga parameter from decimal to hexadecimal automatically when they load the kernel.

So how do you know which decimal or hexadecimal numbers to use for which video mode?

When you use the vga=### in GRUB, LILO, or syslinux, use the decimal number listed below that represents the video mode you want to use; for example, to obtain a framebuffer screen from the kernel that is 640x480 in size with 16 bits for color (64k colors), the tables below say 0x311 hexadecimal, so the vga parameter should be vga=785.

If you would like to hardcode this value into the kernel, there are a few ways you can do it:

  • From the kernel source:
    • The video mode to be used is selected by a variable which can be specified in a Makefile in the kernel source. In my 2.6.12 source, the file is $KERNEL_SOURCE/arch/i386/boot/Makefile, and the parameter to set is SVGA_MODE=.... When you compile your kernel, this value gets built into the kernel, and no other settings need to be made. This value needs to be set in hexdecimal (according to $KERNEL_SOURCE/Documentation/svga.txt)
  • From a bootloader:
    • by the vga=### option of LILO/Syslinux/GRUB (or another boot loader). This value needs to be in decimal. See ConvertingToHexadecimal.
  • From the rdev utility:
    • you can hardcode the video mode into the kernel by using the 'vidmode' utility (also known as 'rdev -v') which is present in standard Linux utility packages). See man rdev on your Linux system for more info. I'm not sure if you should be using a decimal or hexdecimal number here.

In case you don't have a scientific calculator handy, I've created a page that explains about using the GNU bc command when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexadecimal number.

Table 1: Listing of Video Modes and codes

Changed lines 40-42 from:

VESA mode numbers:

to:

Table 2: listing of VESA mode numbers

Changed lines 52-53 from:
to:

Table 3: Kernel VESA mode codes

August 29, 2005, at 12:38 PM by brian -
Changed lines 7-14 from:

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel wants VGA values in hexdecimal. The bootloaders do the conversion of the vga parameter from decimal to hexidecimal for you when they load the kernel. So how do you know which decimal or hexidecimal numbers to use for which video mode?

When you use the vga=parameter in GRUB, LILO, or syslinux, use the decmimal number listed below that represents the video mode you want to use; for example, 640x480x16 is 0x311 hexdecimal, so the vga parameter should be vga=785.

I've created a page that explains about using bc when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

To give you a starting point for conversion, 785 decimal is 0x311 hexdecimal, or a 640x480 16 bit color framebuffer.

to:

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel wants VGA values in hexadecimal. The bootloaders do the conversion of the vga parameter from decimal to hexadecimal for you when they load the kernel. So how do you know which decimal or hexadecimal numbers to use for which video mode?

When you use the vga=parameter in GRUB, LILO, or syslinux, use the decimal number listed below that represents the video mode you want to use; for example, to obtain a framebuffer screen from the kernel that is 640x480 in size with 16 bits for color (64k colors), the tables below say 0x311 hexadecimal, so the vga parameter should be vga=785.

The video mode to be used is selected by a kernel parameter which can be specified in the kernel Makefile (the SVGA_MODE=... line) or by the vga=... option of LILO (or another boot loader). You can hardcode the video mode into the kernel by using the 'vidmode' utility (also known as 'rdev -v') which is present in standard Linux utility packages).

In case you don't have a scientific calculator handy, I've created a page that explains about using the GNU bc command when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexadecimal number.

Changed lines 49-52 from:

From /usr/src/linux/Documentation/svga.txt:

The video mode to be used is selected by a kernel parameter which can be specified in the kernel Makefile (the SVGA_MODE=... line) or by the vga=... option of LILO (or some other boot loader you use) or by the vidmode utility (present in standard Linux utility packages).

to:

Sources for this page:
$LINUX_KERNEL_SOURCE/Documentation/svga.txt $LINUX_KERNEL_SOURCE/Documentation/fb/vesafb.txt

July 03, 2005, at 01:22 AM by brian -
Changed lines 11-12 from:

I've created a page that explains about using =bc= when HowTos.ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

to:

I've created a page that explains about using bc when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

July 03, 2005, at 01:21 AM by brian -
Changed lines 3-4 from:
to:
May 22, 2005, at 10:22 PM by brian -
Changed lines 7-8 from:

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel vga boot parameter wants VGA values in hexdecimal. To give you a starting point for conversion, 785 decimal is 0x311 hexdecimal, or a 640x480 16 bit color framebuffer.

to:

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel wants VGA values in hexdecimal. The bootloaders do the conversion of the vga parameter from decimal to hexidecimal for you when they load the kernel. So how do you know which decimal or hexidecimal numbers to use for which video mode?

Changed lines 13-14 from:
to:

To give you a starting point for conversion, 785 decimal is 0x311 hexdecimal, or a 640x480 16 bit color framebuffer.

May 10, 2005, at 11:56 PM by brian -
Changed lines 11-13 from:

I've created a page that explains about using =bc= when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

to:

I've created a page that explains about using =bc= when HowTos.ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

May 10, 2005, at 11:48 PM by brian -
Changed lines 11-13 from:

I've created a page that explains about using =bc= when ConvertingToHexdecimal?. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

to:

I've created a page that explains about using =bc= when ConvertingToHexadecimal. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

May 10, 2005, at 11:25 PM by brian -
Added lines 1-51:

The contents of this website are Copyright (c)2004 by Brian Manning <brian at antlinux dot com>. Please do not reuse any of the content on this website without permission from the author.

See also KernelBuildNotes?

VGA modes for PC computers

LILO, GRUB, and syslinux (Linux bootloaders) all want their VGA values in decimal. The Linux kernel vga boot parameter wants VGA values in hexdecimal. To give you a starting point for conversion, 785 decimal is 0x311 hexdecimal, or a 640x480 16 bit color framebuffer.

When you use the vga=parameter in GRUB, LILO, or syslinux, use the decmimal number listed below that represents the video mode you want to use; for example, 640x480x16 is 0x311 hexdecimal, so the vga parameter should be vga=785.

I've created a page that explains about using =bc= when ConvertingToHexdecimal?. You feed bc the decimal number you want to use for the VGA mode, and it spits out a hexdecimal number.

 Colours   640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
  -------+--------------------------------------------------------------
  4 bits |    ?       ?     0x302      ?        ?        ?         ?
  8 bits |  0x300   0x301   0x303    0x305    0x161    0x307     0x31C
 15 bits |    ?     0x310   0x313    0x316    0x162    0x319     0x31D
 16 bits |    ?     0x311   0x314    0x317    0x163    0x31A     0x31E
 decimal |           d785    d788     d791
 24 bits |    ?     0x312   0x315    0x318      ?      0x31B     0x31F
 decimal |           d786    d789     d792
 32 bits |    ?       ?       ?        ?      0x164      ?

Here is a better explanation of VESA framebuffer (from Documentation/fb/vesafb.txt):

VESA mode numbers:

     | 640x480  800x600  1024x768 1280x1024
 ----+-------------------------------------
 256 |  0x101    0x103    0x105    0x107
 32k |  0x110    0x113    0x116    0x119
 64k |  0x111    0x114    0x117    0x11A
 16M |  0x112    0x115    0x118    0x11B

The video mode number of the Linux kernel is the VESA mode number plus 0x200. So the table for the Kernel mode numbers are:

     | 640x480  800x600  1024x768 1280x1024
 ----+-------------------------------------
 256 |  0x301    0x303    0x305    0x307
 32k |  0x310    0x313    0x316    0x319
 64k |  0x311    0x314    0x317    0x31A
 16M |  0x312    0x315    0x318    0x31B

From /usr/src/linux/Documentation/svga.txt:

The video mode to be used is selected by a kernel parameter which can be specified in the kernel Makefile (the SVGA_MODE=... line) or by the vga=... option of LILO (or some other boot loader you use) or by the vidmode utility (present in standard Linux utility packages).

view · edit · attach · print · history
Page last modified on April 25, 2006, at 09:20 AM