OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 14, 2021 5:28 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: GRUB2 Video Mode Switch
PostPosted: Thu Jun 12, 2014 7:27 pm 
Offline
Member
Member

Joined: Fri Jan 31, 2014 8:21 am
Posts: 32
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?


Top
 Profile  
 
 Post subject: Re: GRUB2 Video Mode Switch
PostPosted: Thu Jun 12, 2014 7:51 pm 
Offline
Member
Member
User avatar

Joined: Tue Dec 25, 2007 6:03 am
Posts: 727
Location: Perth, Western Australia
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.

_________________
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc


Top
 Profile  
 
 Post subject: Re: GRUB2 Video Mode Switch
PostPosted: Fri Jun 13, 2014 7:24 am 
Offline
Member
Member
User avatar

Joined: Wed Aug 21, 2013 3:53 am
Posts: 449
Location: Asia, Singapore
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.

_________________
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)


Top
 Profile  
 
 Post subject: Re: GRUB2 Video Mode Switch
PostPosted: Fri Jun 13, 2014 11:53 am 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 438
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.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group