Page 1 of 1
How can I set text mode(132*43) when my OS boot from grub
Posted: Mon Mar 21, 2016 1:39 am
by liberty
Now I am writing my own operating system and want to change screen resolution in text mode. I use grub(multiboot) to boot my kernel, but its resolution is very low(in text mode it is 80*25). So I decide to change its resolution when grub is loading my kernel. Actually I need a 132*43 text mode. But it seems doesn't work whatever method I used. Can anyone help me out? Thanks.
Re: How can I set text mode(132*43) when my OS boot from gru
Posted: Mon Mar 21, 2016 5:09 pm
by dseller
The easiest way to do this is to use VBE, although I don't think a 132x43 text mode exists. Perhaps you will have to implement this using graphics mode. Using VBE requires use of the BIOS though, so you have to either write your own bootloader, or temporarily switch back to real mode. I happen to have just finished my implementation of temporarily switching to real mode to achieve the 80x50 text mode by switching font size.
There are other ways to achieve this, like Virtual 8086 mode and such. I haven't researched these options well enough, but the wiki can tell you more about this.
Re: How can I set text mode(132*43) when my OS boot from gru
Posted: Wed Mar 23, 2016 7:38 pm
by liberty
Thank you dseller. I have searched the method for a long time, but nothing found. So maybe I should study grub first to know how to adjust resolution in grub.
Re: How can I set text mode(132*43) when my OS boot from gru
Posted: Thu Mar 31, 2016 1:12 am
by Combuster
While
multiboot allows one to set video modes, you need:
- A bootloader that actually supports it (i.e. a patched grub, but certainly not qemu -kernel)
- A resolution that is actually available. Both the width (characters * 8 or 9) and height (characters * 8 or 16 or 14) don't match up with normal monitor resolutions
- Video cards support less text modes than graphics modes
It's probably better to ask for graphics mode 1024x768 or 800x600 and draw your own characters if you want higher-resolution text modes instead of relying on VBE text modes which are rarely used. After all, multiboot doesn't allow you to pick a resolution from a list or anything like, it has to be spot on from the start.