GRUB2 Video Mode Switch
-
- Member
- Posts: 32
- Joined: Fri Jan 31, 2014 8:21 am
GRUB2 Video Mode Switch
I am using Grub2 (version 1.98) and according to the Drawing in Protected Mode page, Grub2 and patched Grub Legacy can switch the video modes. Is there a grub.cfg option that tells Grub2 to do the switch?
- thepowersgang
- Member
- Posts: 734
- Joined: Tue Dec 25, 2007 6:03 am
- Libera.chat IRC: thePowersGang
- Location: Perth, Western Australia
- Contact:
Re: GRUB2 Video Mode Switch
Grub switches to a graphical mode before passing control to the kernel if the kernel requests it (by setting the relevant flag in the multiboot header).
I think that you can configure grub to use a specific mode using grub.cfg options, but that's not needed just to get a graphics mode out of it.
I think that you can configure grub to use a specific mode using grub.cfg options, but that's not needed just to get a graphics mode out of it.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
Re: GRUB2 Video Mode Switch
Found this: https://www.gnu.org/software/grub/manua ... ation.htmlthepowersgang wrote: I think that you can configure grub to use a specific mode using grub.cfg options, but that's not needed just to get a graphics mode out of it.
Probably for gfxterm (GRUB's Graphical Terminal I guess), but I think you can use it for your kernel too.GRUB_GFXMODE’
Set the resolution used on the ‘gfxterm’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘auto’, which tries to select a preferred resolution. See gfxmode.
Although I'm not sure if it'll fall back to the original video mode (80x25 text) after booting the kernel.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
(R3X Runtime VM)(CHIP8 Interpreter OS)
Re: GRUB2 Video Mode Switch
If you want to configure the resolution in grub 2 with a properly configured multiboot kernel, use: ... after you've loaded your kernel (right before you call boot).
You can also add "x32" to the end to force 32-bit color (and presumably x24 and so on) if it's available, otherwise I think it defaults to 24-bit.
You can also do:
... to force VGA text-mode when you have the video flag set in your header.
Code: Select all
set gfxpayload=1920x1080
You can also add "x32" to the end to force 32-bit color (and presumably x24 and so on) if it's available, otherwise I think it defaults to 24-bit.
You can also do:
Code: Select all
set gfxpayload=text