Page 1 of 1

Switching to a Higher VGA resolution

Posted: Thu Jun 17, 2021 10:38 am
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

Re: Switching to a Higher VGA resolution

Posted: Fri Jun 18, 2021 10:17 pm
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.

Re: Switching to a Higher VGA resolution

Posted: Thu Jul 08, 2021 3:11 pm
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.