Configuring Linux Kernel Video Mode for 32-bit and 16-bit Boot Protocols

The Linux kernel has a generic driver for a graphic framebuffer named vesafb on intel boxes. It provides a nice large console for most of modern displays.

Setting VESA modes for Linux kernel with 32-bit and 16-bit boot protocol are different. We introduce both methods here.

Linux kernel with 32-bit boot protocol

For machine with some new BIOS other than legacy BIOS, such as EFI, LinuxBIOS, etc, and kexec, the 16-bit real mode setup code in kernel based on legacy BIOS can not be used, so a 32-bit boot protocol needs to be defined.


The modes can be set by adding ‘video=…’ to the kernel boot parameter.

The syntax is like this (ref: Kernel Mode-setting):


For Grub2, this can be added by 2 steps.

Edit ‘/dev/default/grub’ and edit the line for ‘GRUB_CMDLINE_LINUX’. For example, to set the video mode to 1024×800 with 32-bit color depth:

GRUB_CMDLINE_LINUX=" rd.lvm=0 KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 video=1024x800-32"

Then make the new grub.cfg by:

# grub2-mkconfig -o /boot/grub2/grub.cfg

Add to ‘/dev/default/grub’:


Then, make the new grub.cfg by

# grub2-mkconfig -o /boot/grub2/grub.cfg

Linux kernel with 16-bit boot protocol

Switching VESA modes of Linux kernel at boot time can be done by using the “vga=… kernel boot parameter. This parameter accept the decimal value of Linux video mode numbers instead of VESA video mode numbers. The Linux video mode number can be easily derived from the VESA number.

The video mode number of the Linux kernel is the VESA mode number plus 0×200.

Linux_kernel_mode_number = VESA_mode_number + 0x200

Here are some of the 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

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

The decimal value of the Linux kernel video mode number can be passed to the kernel in the form “vga=YYY“, where YYY is the decimal value.

Instead of the YYY decimal value, the “vga” parameter also accept “ask” which will list all the Linux kernel mode numbers and let the user select one. You can used it if you want to be asked every time booting Linux. It can also be used to find the best Linux video mode on your console.

The best way for configuring the “vga=YYY” parameter is following these steps.

First, add “vga=ask” parameter to the Linux kernel entry in grub configuration file /boot/grub/grub.conf. Like this:

kernel /vmlinuz- ro root=/dev/mapper/VolGroup-LogVol00 vga=ask

Second, reboot Linux and hit return when the kernel ask for the vga mode. Then select one mode from the list and remember the Linux mode number which is a hexdecimal value in the format YYY. You can also get more choice by entering “scan“.

Last, calculate the decimal value of the Linux video mode number. This simple python command can be used:

python -c "print 0xYYY"

YYY is the hexdecimal value you got.

Then change “ask” in grub configuration file to the decimal value calculated.

Here is a list of usually used Linux mode number and the decimal value if you like to choose one directly:

4 bits 770 (302) 774 (306)
8 bits 768 (300)769 (301)879 (36F)701 (303)815 (32F)874 (36A)773 (305)775 (307)
15 bits781 (30D)801 (321)784 (310)880 (370)787 (313)816 (330)875 (36B)790 (316)793 (319)
16 bits782 (30E)802 (322)785 (311)881 (371)788 (314)817 (331)876 (36C)791 (317)794 (31A)
24 bits783 (30F)803 (323)786 (312)882 (372)789 (315)818 (332)877 (36D)792 (318)795 (31B)
32 bits 804 (324)809 (329)883 (373)814 (32E)819 (333)878 (36E)824 (338)829 (33D)

Leave a Reply

Your email address will not be published. Required fields are marked *

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>

Click to subscribe to Posts by Email if you have not.