OSDev.org
https://forum.osdev.org/

GRUB2 Video Mode Switch
https://forum.osdev.org/viewtopic.php?f=1&t=28174
Page 1 of 1

Author:  inixsoftware [ Thu Jun 12, 2014 7:27 pm ]
Post subject:  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?

Author:  thepowersgang [ Thu Jun 12, 2014 7:51 pm ]
Post subject:  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.

Author:  Bender [ Fri Jun 13, 2014 7:24 am ]
Post subject:  Re: GRUB2 Video Mode Switch

thepowersgang 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.

Found this: https://www.gnu.org/software/grub/manua ... ation.html
Quote:
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.

Probably for gfxterm (GRUB's Graphical Terminal I guess), but I think you can use it for your kernel too.
Although I'm not sure if it'll fall back to the original video mode (80x25 text) after booting the kernel.

Author:  klange [ Fri Jun 13, 2014 11:53 am ]
Post subject:  Re: GRUB2 Video Mode Switch

If you want to configure the resolution in grub 2 with a properly configured multiboot kernel, use:
Code:
set gfxpayload=1920x1080
... 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:
Code:
set gfxpayload=text

... to force VGA text-mode when you have the video flag set in your header.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/