Page 1 of 1

Text Mode Switching

Posted: Mon Nov 15, 2010 4:43 pm
by Apophis
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.

Re: Text Mode Switching

Posted: Mon Nov 15, 2010 5:22 pm
by neon
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.

Re: Text Mode Switching

Posted: Mon Nov 15, 2010 5:23 pm
by Combuster
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

Re: Text Mode Switching

Posted: Tue Nov 16, 2010 2:20 am
by egos
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