To use Text Mode 3 or to use VESA?

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
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

To use Text Mode 3 or to use VESA?

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:34 pm, edited 2 times in total.
User avatar
Pype.Clicker
Member
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?

Post by Pype.Clicker »

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:

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);
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:To use Text Mode 3 or to use VESA?

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:34 pm, edited 1 time in total.
Tim

Re:To use Text Mode 3 or to use VESA?

Post by Tim »

What work is there in making mode 3 output routines?

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;
}
Add in suitable cursor routines etc.

You can later have:

Code: Select all

void GfxOutputCharacter(int row, int col, wchar_t ch)
{
    GfxBitBlt(col * 8, row * 8, gfx_chars[ch]);
}
User avatar
Pype.Clicker
Member
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?

Post by Pype.Clicker »

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?
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 ...
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 .
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:To use Text Mode 3 or to use VESA?

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:35 pm, edited 1 time in total.
whyme_t

Re:To use Text Mode 3 or to use VESA?

Post by whyme_t »

Perica Senjak wrote: What's that third voting option
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:-

Code: Select all

if(vesaMode)
{
   Console *console = new VesaConsole() ;
}else
{
   Console *console = new TextConsole() ;
}
console.println("Hello, world!") ;
Because you've abstracted the implementation, it doesn't matter which type of output your console uses, because it will use the same set of functions.

Hope I made this clear :-\
jrfritz

Re:To use Text Mode 3 or to use VESA?

Post by jrfritz »

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?
User avatar
Pype.Clicker
Member
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?

Post by Pype.Clicker »

that's what i'm trying to do :)
Post Reply