To use Text Mode 3 or to use VESA?
To use Text Mode 3 or to use VESA?
..
Last edited by Perica on Sun Dec 03, 2006 8:34 pm, edited 2 times in total.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:To use Text Mode 3 or to use VESA?
Your VM86 stuff troubles me ... why in the world do you need VM86 to use text console ? i really wonder.. the VM86 will mostly be needed when you will switch to VESA display, because you'll need the VGA BIOS interruption in order to switch your display (unless you plan to switch to VESA while you're still in real mode, thus probably in your second-stage bootloader).
What you should take care of if you decide to enable VESA from the start is that you won't have any display until your console code is working and loaded. It will take you monthes before you see a "Hello World" on screen .. and this could be unpractical to debug your system.
Do text mode represent such a large effort ? Do not take me wrong, i don't want to turn you back into the darkness of 0xB8000, but i'm wondering if you didn't overestimated the difficulty of text-mode console.
What i suggest you to do is to define a abstraction layer for your console that could work in text mode AND in graphical mode independently, so that your os isn't bound to a specific output feature...
The bootloader could inform you whether text or graphic mode is engaged, which will make the OS choose:
What you should take care of if you decide to enable VESA from the start is that you won't have any display until your console code is working and loaded. It will take you monthes before you see a "Hello World" on screen .. and this could be unpractical to debug your system.
Do text mode represent such a large effort ? Do not take me wrong, i don't want to turn you back into the darkness of 0xB8000, but i'm wondering if you didn't overestimated the difficulty of text-mode console.
What i suggest you to do is to define a abstraction layer for your console that could work in text mode AND in graphical mode independently, so that your os isn't bound to a specific output feature...
The bootloader could inform you whether text or graphic mode is engaged, which will make the OS choose:
Code: Select all
Console System = Boot.isVesa?new GraphicConsole(80,25):new TextConsole(80,25)
System.clear();
System.enableCursor();
System.newline("Hello from "+System.printname);
Re:To use Text Mode 3 or to use VESA?
..
Last edited by Perica on Sun Dec 03, 2006 8:34 pm, edited 1 time in total.
Re:To use Text Mode 3 or to use VESA?
What work is there in making mode 3 output routines?
Add in suitable cursor routines etc.
You can later have:
Code: Select all
void TextOutputCharacter(int row, int col, wchar_t ch)
{
char ascii;
ascii = UnicodeToCp437(ch);
text_videomem[row * 80 + col] = ascii | text_attribs;
}
You can later have:
Code: Select all
void GfxOutputCharacter(int row, int col, wchar_t ch)
{
GfxBitBlt(col * 8, row * 8, gfx_chars[ch]);
}
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:To use Text Mode 3 or to use VESA?
You don't need VM86 for this: just use a zone of your graphic array as a tile map (each tile being a character) and a ROWxCOL memory area that will be checked when the redraw is needed ...Perica Senjak wrote: Hi,
Well -- If i was already in a Graphical Mode (Any -- VGA or SVGA, It doesn't Really matter); And i wanted to make a Window with a Console in it -- How else can it be done other than using vm86?
If you have abstract console calls like enable_cursor() instead of just using ports output & input, the console programs will only access things that can be done by the console emulator : once again, no need for virtual 8086 mode.
This is how Eterm, Konsole, gnome-terminal and the like work in Linux, and this is also how 32bits console applications work in Windows .
Re:To use Text Mode 3 or to use VESA?
..
Last edited by Perica on Sun Dec 03, 2006 8:35 pm, edited 1 time in total.
Re:To use Text Mode 3 or to use VESA?
Well it's an oo concept. You make Console an abstract interface, this means that you can't make a concrete instance of it, as the functions are not implemented, but must be implemented by any Classes that inherit from the interface. The VesaConsole would extend Console, and must implement all the virtual functions of Console. Then you can do clever stuff like this:-Perica Senjak wrote: What's that third voting option
Code: Select all
if(vesaMode)
{
Console *console = new VesaConsole() ;
}else
{
Console *console = new TextConsole() ;
}
console.println("Hello, world!") ;
Hope I made this clear :-\
Re:To use Text Mode 3 or to use VESA?
What about a text mode lib where you select the area to write to mem if its text mode...or use bitmaps for text on graphical modes?
What about a text lib that is device independant...one where you may insert code modules that tell what device to write to and how? What about....a OS that is portable...one that only uses adding code modules to tell what devices to use and how to work them?
What about a text lib that is device independant...one where you may insert code modules that tell what device to write to and how? What about....a OS that is portable...one that only uses adding code modules to tell what devices to use and how to work them?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact: