Switching to a Higher VGA resolution

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
xing1357
Posts: 1
Joined: Fri Jun 04, 2021 8:25 am
Libera.chat IRC: xing1357

Switching to a Higher VGA resolution

Post by xing1357 »

I have been stuck with the regular 80x25 VGA resolution, and would like to switch to something higher, like 320x200. Is there any way to do this in C/Unix Assembly?

Thanks,
Harvey
Octocontrabass
Member
Member
Posts: 5567
Joined: Mon Mar 25, 2013 7:01 pm

Re: Switching to a Higher VGA resolution

Post by Octocontrabass »

Which bootloader are you using? Some popular ones (like GRUB) can use the firmware to set up a high-resolution video mode with a framebuffer where you can draw bitmap text and graphics.

If you wrote your own bootloader, you can have your bootloader do it too. Since you mentioned VGA text mode, I'm assuming you're using legacy BIOS, so you'd want to set the video mode using VBE. For UEFI, set the video mode using GOP before calling ExitBootServices().

Changing the video mode while your OS is running is a bit more difficult. For that, you need to write a driver for your display adapter.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Switching to a Higher VGA resolution

Post by Combuster »

Technically, what you call 80x25 is often actually a 720x400 resolution, so 320x200 you say is an improvement is actually quite a lower resolution :wink:

Please be considerate and read the wiki before posting a question, there are several relevant entries in the FAQ that will answer your question in far more detail.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply