Berserk wrote:I have made a decision, unless VESA is as easy to initialise as mode 13h? I will not use it
I can't answers this authoritatively... graphics modes are not my area of expertise... However, I think I can break the issue down a bit, to make it a bit easier to work out.
As I understand it, video mode 13 was part of the original VGA system developed by IBM. Because virtually all VGA compatible vdeo cards emulate this hardware exactly, it should be possible to program the video card for this and other basic VGA modes without using the BIOS routines. I cannot tell you from experience how hard this would be compared to using the BIOS functions in a v86 process, however.
(
To the video gurus out there: is this correct? I've never done any serious low-level graphics work, so I'm not entirely clear on this myself.)
With VESA, because there was no absolute hardware standard to copy for the SVGA abd later extensions, and because the functions they needed to support were increasingly complex, the standard became BIOS-level compatibility. For older cards, the BIOS were all 16-bit functions, and in order to use them, you would have to use a v86 mode process. The later VBE v.3.0 standard, which most cards made in 2000 or later support, requires 32-bit BIOS functions as well, which can be called from protected mode directly provided that the functions are mapped into the IDT by the OS.
On the one hand, if you can be certain that the OS will only run on the latest and greatest video hardware, then VESA is probably actually easier (modulo whatever fiddling it takes with the IDT to make it work). On the other hand, Mode 13 is more or less guaranteed to work on nearly any PC made in the past decade, but using it without the BIOS may take some serious hacking (though more in the way of time-consuming than difficult). On the gripping hand, while writing V86 support is no small feat, if you have any other reasons to include v86 support in your OS, then 16-bit VESA support is a minor addition after that.
Which is easier? Damned if I know; there are too many variables involved for me to give a straightforward answer. I hope that this has help clear up rather than muddy the waters, though.
(Do i actually intitialise VESA from the BootSector? are there any example OS's with VESA that i can look at? Does Windows use VESA??)
It is neither necessary nor wise to try and fit the VESA support into your boot sector, or even into your kernel.
Otherwise i will use Mode 13h, i will make a print() function & everything (won't be hard, but will take some time)
Keep in mind that the graphics modes do not have any particular support for text the way that the text modes do. To get text on a graphics page, you will, in effect, be drawing the images of the individual glyphs onto the screen, and there are no fixed rows or columns as in the text modes. While it would be easiest to start out by creating a few simple bitmapped 'fonts' in an image editor to start, and just paint them to the screen, eventually you will probably want to look into supporting one of the common font/typeface standards (postscript fonts, OpenType, etc.) in order to avoid reinventing the wheel for each font you need.
BUT i first want to see an example of VESA, just to see how much coding is needed to initialise it. As i might upgrade to VESA later.
The example a lot of people seem to pointing to is
XFree86, which probably is as good a place to look as any. Keep in mind, though, that it s a production-quality system, and probably not written for easy understanding any more than, say, the Linux kernel is.