How can I set text mode(132*43) when my OS boot from grub

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
liberty
Posts: 2
Joined: Wed Mar 16, 2016 8:01 am

How can I set text mode(132*43) when my OS boot from grub

Post 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.
dseller
Member
Member
Posts: 84
Joined: Thu Jul 03, 2014 5:18 am
Location: The Netherlands
Contact:

Re: How can I set text mode(132*43) when my OS boot from gru

Post 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.
liberty
Posts: 2
Joined: Wed Mar 16, 2016 8:01 am

Re: How can I set text mode(132*43) when my OS boot from gru

Post 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. :D
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: How can I set text mode(132*43) when my OS boot from gru

Post 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.
"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