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

Switching between graphic and text mode
https://forum.osdev.org/viewtopic.php?f=13&t=36707
Page 1 of 1

Author:  mrjbom [ Thu Apr 23, 2020 3:41 pm ]
Post subject:  Switching between graphic and text mode

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.

Author:  StudlyCaps [ Thu Apr 23, 2020 6:36 pm ]
Post subject:  Re: Switching between graphic and text mode

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.

Author:  bzt [ Fri Apr 24, 2020 2:55 am ]
Post subject:  Re: Switching between graphic and text mode

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

Author:  mrjbom [ Fri Apr 24, 2020 4:18 am ]
Post subject:  Re: Switching between graphic and text mode

Ok, thanks.

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