Page 1 of 1

Switching between graphic and text mode

Posted: Thu Apr 23, 2020 3:41 pm
by mrjbom
Hi.
I'm booting into protected mode with graphics using GRUB, I want to switch back to text mode and back again. In other words, I want to be able to switch between these modes at any time.
How can I do this?
Thanks.

Re: Switching between graphic and text mode

Posted: Thu Apr 23, 2020 6:36 pm
by StudlyCaps
You either need to be in real mode (or virtual 8086 mode), and have access to the BIOS functions, or you need to write a driver for the graphics card - either a generic VGA driver (only supports VGA resolutions) or for your specific card. Info on the wiki is here.

Personally I find all these options vastly more trouble than they're worth and just set a graphic mode at boot and emulate text mode using bitmap fonts.

Re: Switching between graphic and text mode

Posted: Fri Apr 24, 2020 2:55 am
by bzt
StudlyCaps wrote:You either need to be in real mode (or virtual 8086 mode), and have access to the BIOS functions, or you need to write a driver for the graphics card - either a generic VGA driver (only supports VGA resolutions) or for your specific card. Info on the wiki is here.
What StudyCaps wrote, but if you're using UEFI, it won't work unless you enable legacy CSM and your card must support legacy VGA modes (some modern cards don't).
StudlyCaps wrote:Personally I find all these options vastly more trouble than they're worth and just set a graphic mode at boot and emulate text mode using bitmap fonts.
A very big plus one on this. Simplest, most portable, also this is how Linux does it (for a good reason). You can find more info on how to do this in our wiki.

Cheers,
bzt

Re: Switching between graphic and text mode

Posted: Fri Apr 24, 2020 4:18 am
by mrjbom
Ok, thanks.