Switching between graphic and text mode

Programming, for all ages and all languages.
Post Reply
User avatar
mrjbom
Member
Member
Posts: 301
Joined: Sun Jul 21, 2019 7:34 am

Switching between graphic and text mode

Post 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.
StudlyCaps
Member
Member
Posts: 232
Joined: Mon Jul 25, 2016 6:54 pm
Location: Adelaide, Australia

Re: Switching between graphic and text mode

Post 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.
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: Switching between graphic and text mode

Post 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
User avatar
mrjbom
Member
Member
Posts: 301
Joined: Sun Jul 21, 2019 7:34 am

Re: Switching between graphic and text mode

Post by mrjbom »

Ok, thanks.
Post Reply