I've been searching and searching and have not found much consensus on the topic of switching video modes. What I'm looking for right now is just a way to switch to a different text mode (I want more rows/columns). What is the generally accepted way to do this in protected mode? Is it to just drop into real mode or "virtual" real mode and use INT 0x10? I know this is probably the easiest but I've been trying to avoid it since I just haven't done it yet. Should I just suck it up and add that feature to my OS?
I'm using GRUB Legacy currently to boot the OS and am thinking about switching to GRUB 2 for the improved VBE support.
Text Mode Switching
Re: Text Mode Switching
Hello,
This is up to you - in protected mode you can either drop into v86 mode or with VGA/SVGA. I would personally recommend supporting both - but VBE would be the easier way to go.
This is up to you - in protected mode you can either drop into v86 mode or with VGA/SVGA. I would personally recommend supporting both - but VBE would be the easier way to go.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
- Combuster
- 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: Text Mode Switching
First of all, there is no such thing as consensus in hobby OS development. That problem is even referred to in the list of beginner mistakes. I hope you have the ability to find and weigh off advantages and disadvantages and make an educated choice that suits you.
For the rest, the relevant FAQ is perfectly valid, and even contains the key arguments: http://wiki.osdev.org/How_do_I_set_a_graphics_mode
For the rest, the relevant FAQ is perfectly valid, and even contains the key arguments: http://wiki.osdev.org/How_do_I_set_a_graphics_mode
Re: Text Mode Switching
To set specific text mode you should reprogram all vga registers. But if setting mode has a small difference from current then you can try to reset only some registers. For example I have following difference between 80x25 (720x400) and 80x30 (720x480) modes:
Code: Select all
MSR: 67 E7
CRT06: BF 0B
CRT07: 1F 3E
CRT10: 9C EA
CRT11: 8E 8C
CRT12: 8F DF
CRT15: 96 E7
CRT16: B9 04
If you have seen bad English in my words, tell me what's wrong, please.