lseki
lseki

Reputation: 371

How does Linux kernel parse vga= parameter?

I want to boot my Linux 3.18.48 compiled from source, with resolution 640x480. So I'm passing it a parameter vga=0x312. For some reason, it doesn't work.

To understand what's happening, I grep'ed the kernel source for "vga=", expecting some macro __setup("vga=", function_ptr), similar to other kernel cmdline parameters (video=, root=, etc). However, there's no such occurrence.

So how does the Linux kernel parse vga= parameter?

Upvotes: 2

Views: 4049

Answers (1)

lseki
lseki

Reputation: 371

According to the docs:

vga=        [BOOT,X86-32] Select a particular video mode
            ...
            This is actually a boot loader parameter; the value is
            passed to the kernel using a special protocol.

So the kernel does not parse this parameter at all. In my case it's GRUB 2.02 parsing this parameter and passing to the kernel through variable gfxpayload, as listed in GRUB's linux command.

Now I can continue investigating why vga= parameter is being ignored, looking at GRUB's source :-)

EDIT

vga= is parsed by GRUB only on legacy BIOS systems.

That's why vga= is being ignored on my machine. Since I'm using a UEFI system, I need to set the gfxpayload variable directly:

set gfxpayload=640x480

Now it sets the resolution correctly.

Upvotes: 3

Related Questions