Building a custom kernel for a VGA text console

I’m creating a custom minimal kernel in Ubuntu 20.04 that is meant to be run from a USB stick on x86 PC platform to test graphics card hardware. The requirements are PC-BIOS running in VGA text mode (not UEFI).

I turned off "support for frame buffer devices" in the kernel configuration. Now I experience the following: When I use "set gfxpayload=text" in grub I get a "colour dummy device 80×25 console". However, when I use "vga=normal" I get a "colour VGA+ 80×25" console, which is what I want.

Setting vga=normal, however, is deprecated and setting gfxpayload=text should be used instead. I guess I could just ignore the message and use vga=normal, but what’s the story here?

Asked By: MaxUbuntu

||

I think I’ve found the answer. vga=normal is deprecated under Grub 2, but still a valid Linux kernel command parameter. As for PC-BIOS VGA modes and Grub 2, replacing the "linux" command line with "linux16" and "initrd" with "initrd16" makes all the difference. Make sure to change both lines and you can also use e.g. vga=ask. You can also still boot the system from /boot on a btrfs volume.

https://www.gnu.org/software/grub/manual/grub/html_node/linux16.html

Answered By: MaxUbuntu
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.