I am developing a small operating system for the x86 platform, which uses the protected mode (but no paging).
I'm trying to implement a simple VGA driver, without using the BIOS interrupt 10h. I know there is a lot of threads about it, but none of them helped me.
So, my driver is able to switch to mode "13h" (320x200 - 8 bits) by writing correct values to the various VGA registers , it works great, but the problem comes when trying to get back to text mode (i.e. 80x25).
The card seem to switch, but the font is completely wasted on Qemu, and horizontal black lines appears on Bochs and real PC hardware (see the screenshot below). The values I am writing to the VGA registers should be good, as everything is okay if I write them when I am actually in text mode.
I think the switch to graphical mode "erases" the font used by the text mode. I don't know much on how or where the card actually stores the font (the FreeVGA project didn't tell me a lot about it).
I'd like to know is anyone have been able to do it.
Here is a screenshot taken from Bochs, showing what is appearing after a switch-back to text mode from 320x200:

Sorry not being able to finish my echo command, my keyboard driver is a bit broken on Bochs, and it suddenly died.
Thanks!
