Where do i start??

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
Berserk

Re:Where do i start??

Post by Berserk »

OK,

how do i impliment VESA ?? where do i get it??

And do you know any OS's (with source) which actually can read from the keyboard?

i want to see how it's done.

And my questions still hasn't been answered, how come the print() function doesn't work when i am in mode 13h??

You see i first want to get a better understanding of all this stuff before starting on my own OS.

ciao 8)
Berserk

Re:Where do i start??

Post by Berserk »

oh yeah,

one more thing, does windows use VESA? if not what does it use?? and also is there another way to get 800x600 with true colour without VESA?

And, there is a new freeware OS ' Mandrake Linux' (i have it, but haven't yet tried it. I heard it uses something called GNOME, WHAT THE HELL IS THIS??
and also, does it use VESA?? if not, what does it use??

Please Help.....
eliscool

Re:Where do i start??

Post by eliscool »

Berserk wrote: OK,

how do i impliment VESA ?? where do i get it??
http://www.monstersoft.com/tutorial1/VESA_intro.html
And my questions still hasn't been answered, how come the print() function doesn't work when i am in mode 13h??
because mode13h is a graphics mode, you get a pointer to a linear amount of memory and you put the values in the memory for what you want on screen, that print() function uses the BIOS which has the code 'built in' so does it for you, in mode13h its all upto you, you have to come up with the way to plot the pixels to draw the characters there...
And, there is a new freeware OS ' Mandrake Linux' (i have it, but haven't yet tried it. I heard it uses something called GNOME, WHAT THE HELL IS THIS??
Ok, this is where im really starting to get annoyed, im not meaning to be rude here, but do you actually read what people give you? I had already given you the VESA link, and like has been stated before there are a few threads already about VESA, and Linux is open source... why dont you take alook yourself... and theres one more thing that I think you might find very helpful... its called www.google.com! its really very good, I suggest you try it some time, you should really try to have some initative yourself, theres MANY documents on the web explaining what gnome is, im sure your more likely get faster answers to your questions by first searching google, if by then you still cant find what your looking for you should post here... theres alot of material out there, and you should try to find it and read it yourself...
PS. not trying to be rude ;)
Berserk

Re:Where do i start??

Post by Berserk »

Hey,

I have made a decision, unless VESA is as easy to initialise as mode 13h? I will not use it

(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??)

Otherwise i will use Mode 13h, i will make a print() function & everything (won't be hard, but will take some time) If mode 13h is the best mode i can get, without VESA or anything extra like that, then i will use mode 13h, and i will use it to it's full capacity (Get as much as i can from it)

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.

So please, if you can help...HELP!!

& i searched on google and found some info on GNOME, (i still don't get it) but doesn't matter, i was just curious what it was. So if you don't want to answer this question...don't!

ciao 8)
Curufir

Re:Where do i start??

Post by Curufir »

GNOME, KDE, Sawfish, Enlightenment are all linux window managers and desktop environments. All they do is sit on top of the XServer and provide more functionality (And if you've ever used the vanilla X environment you can understand why *shudders*).

What they aren't is anything to do with actually putting the graphics on the screen. All the functionality is in the xserver, not the window manager. So if you're looking to find some vesa/vga/super-vga drivers to learn from then go digging around in the XFree86 source.

Asking what GNOME is isn't really on topic for OS design, I suggest asking on a linux board if you need more information (of course you'll most likely start another holy war about KDE vs GNOME vs Enlightenment vs whatever :))

Curufir
Schol-R-LEA

Re:Where do i start??

Post by Schol-R-LEA »

Berserk wrote:i searched on google and found some info on GNOME, (i still don't get it) but doesn't matter, i was just curious what it was.
The simple answer is that GNOME is one of the two common desktop environments for Linux (the other one being KDE). By comparison, Finder is the MacOS desktop environment, while Windows Explorer and the Start menu together make up the Windows desktop environment. It serves the same role in a GUI that the shell does in a command-line interface - it is the part the user interacts with directly. It does not implement the graphics system itself, but uses a lower-level system (XFree86) to support the actual graphics calls.

The longer explanation may take a bit of a history lesson. I can't promise that this entirely accurate, however, and if anyone has any corrections or additions on this issue, please do feel free to give them.

First, you have know that most Unix systems, and Unix workalikes such as Linux and FreeBSD (and even some non-Unix systems like Generra, for which it was originally designed), use a standardized, network-transparent graphics system called The X Window System. XWS was originally developed in the mid-1980s as a way of allowing graphical programs to run over networks, with part of the program running on the remote machine (the x client) and part on the local machine (the x server - don't bother trying to figure out why they've reversed the usual meanings of 'client' and 'server', it will probably just give you a headache :P). Xlib11 is the standard API which is used for programming X Window System. Despite its name, XWS only defines the graphics primitives needed to support a windowing system; it is not itself a window manager.

On the PC platform, the most common implementation of the X Window System is called xfree86, which is a graphics library that provided all of the xlib11 functionality, plus platform-specific support for controlling the VESA video modes and palettes. It uses calls to the VBE (VESA BIOS Extensions) v.2 functions; to call those functions, it opens up a v86-mode process and runs the viedo calls as real-mode programs.

This only provides the minimal support for windowing graphics, however. In order to provide a functional user interface, you need to more things: a windows manager, and a user environment. The window manager - defines how the windows should be drawn, how the mouse and keyboard events are handled, and so forth. MOTIF, sawfish and Enlightenment are all examples of window managers. Most window managers today have a common API, allowing a given user environment to run any of the different WMs.

A user environment, such as GNOME or KDE, is the actual finished product - a complete destop system. It defines what user tools will be available as part of the system, provides a (hopefully) consistent mechanism for running user applications, and a means by which the user can manipulate them.

If this separation into four or more layers seems rather abstract, it is because XWS was designed at a time when hardware platforms were far more diverse than today, and when a very different paradigm of networking was in use. It tried to assume as little as possible about the X Server's capabilities.

Ironically, the widespread use of HTML and HTTP for networked client-server software has meant that XWS is almost never used for it's original purpose, but usually seen in the role of supporting a desktop environment such as GNOME.

HTH. CCW.
Mr_Spam

Re:Where do i start??

Post by Mr_Spam »

This thread provides alot of great information however the topic has changed quite a bit. Perhaps continueing the different tipics of this thread in other ones will help us understand the information present :)

As my advise, even though I havn't quite started to code yet, I feel its more important to get a working, rudimentary kernal with nessassary functions running without a hitch before you start to worry about any form of graphics :)

Keep up the flow of great information ;D ;D
Berserk

Re:Where do i start??

Post by Berserk »

Hey,

My other questions still haven't been answered:

I have made a decision, unless VESA is as easy to initialise as mode 13h? I will not use it

(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??)

Otherwise i will use Mode 13h, i will make a print() function & everything (won't be hard, but will take some time) If mode 13h is the best mode i can get, without VESA or anything extra like that, then i will use mode 13h, and i will use it to it's full capacity (Get as much as i can from it)

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.

ciao 8)
Schol-R-LEA

Re:Where do i start??

Post by Schol-R-LEA »

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.
Berserk

Re:Where do i start??

Post by Berserk »

Hey,

VESA is getting a bit complicated, all i want to see is some source code using VESA. If it is not initialised in the BootSector or Kernel, THEN WHERE IS IT INTIALISED, DOES IT NEED TO BE INITIALISED??

I am probably going to use mode 13h for my OS, i might go to another mode later, but mode 13h is the best for a beginner like me. And i am aware that mode 13h does not have text functionality, i will make the letters out of pixels (u know what i mean)

Now what i want to know is, for Mode 13h, it uses 320x200 resolution right?? and 256 colours?? This is correct, is there a way (or other mode, WITHOUT USING VESA - Something Simple and easy to initialise like mode 13h) to add 16 or 32 bit colour and upgrade the resolution to at least 640x480??

If i can't do this, then i will use mode 13h with 320x200 res, A lot of things can be done with 256 colours you know!! even at 320x200. But i would like to have more colours and higher res, but only if i can get it by adding a little more code to my BootSector or Kernel (i want it to be quick and easy to initialise, like mode 13h)

Thanks in advance.....
Tim

Re:Where do i start??

Post by Tim »

Mode 13h is the absolute upper limit for colours on VGA. You must use a SVGA mode for more than 256 colours, and VESA is the easiest way of doing this.
Curufir

Re:Where do i start??

Post by Curufir »

Personally I prefer 640*480*16, but that's mostly 'cos I absolutely hate the blocky pixels at lower resolutions. Here's the list from HelpPC. Bear in mind that the only thing you can be almost 100% absolutely sure of them having on practically any hardware is 80*25 text mode ;D.

Code: Select all

                      INT 10,0 - Set Video Mode

   AH = 00
   AL = 00  40x25 B/W text (CGA,EGA,MCGA,VGA)
      = 01  40x25 16 color text (CGA,EGA,MCGA,VGA)
      = 02  80x25 16 shades of gray text (CGA,EGA,MCGA,VGA)
      = 03  80x25 16 color text (CGA,EGA,MCGA,VGA)
      = 04  320x200 4 color graphics (CGA,EGA,MCGA,VGA)
      = 05  320x200 4 color graphics (CGA,EGA,MCGA,VGA)
      = 06  640x200 B/W graphics (CGA,EGA,MCGA,VGA)
      = 07  80x25 Monochrome text (MDA,HERC,EGA,VGA)
      = 08  160x200 16 color graphics (PCjr)
      = 09  320x200 16 color graphics (PCjr)
      = 0A  640x200 4 color graphics (PCjr)
      = 0B  Reserved (EGA BIOS function 11)
      = 0C  Reserved (EGA BIOS function 11)
      = 0D  320x200 16 color graphics (EGA,VGA)
      = 0E  640x200 16 color graphics (EGA,VGA)
      = 0F  640x350 Monochrome graphics (EGA,VGA)
      = 10  640x350 16 color graphics (EGA or VGA with 128K)
            640x350 4 color graphics (64K EGA)
       = 11  640x480 B/W graphics (MCGA,VGA)
       = 12  640x480 16 color graphics (VGA)
       = 13  320x200 256 color graphics (MCGA,VGA)
       = 8x  EGA, MCGA or VGA ignore bit 7, see below
       = 9x  EGA, MCGA or VGA ignore bit 7, see below
Schol-R-LEA

Re:Where do i start??

Post by Schol-R-LEA »

I believe that the VBE 3.0 Standards document on VESA's web site has an appendix with some initialization examples, but I don't know how useful they are. I'm going to try and read through it later today myself. There's supposed to be a tutorial page as well, but it appears to be empty (or perhaps member's-only access).

EDIT: I found a few more links:

MonsterSoft Tutorials covering p-mode and real mode VESA programming/ While I haven't read it all yet, the "Introduction to VESA Programming" looks to be is a good place to start, and the whole document can be (see the downloaded for offline reading.

Several useful ;tutorials can be found here, as someone pointed out earlier in the book thread.

A thread called SuperVGA/VESA Programmer's Notes from the comp.graphics archive.

Programmer's Heaven has a tutorial in mode 13 that may prove useful.

GameDev has a lot of general graphics programming material, and while most of it is specific to Windows, it may still demonstrate techniques which are more widely applicable. Other game-programming sites may also be useful for general graphics-related material.

Lastly, I strongly recommend reading (or better still, downloading and then reading) the online version of Abrash's Grpahics Programming Black Book. While much of it assumes a DOS or Windows environment, and much of it is quite dated, it should still be largely applicable.

I have not read through most of these, and cannot verify their accuracy or usefulness. YMMV.
Berserk

Re:Where do i start??

Post by Berserk »

What is that table for??

int 10, 0??

what the??

i tried putting the code:

int 10, 0

mov ah, 00
mov al, 10

errors from nasm,

what is the code for??

And i was thinking of making a splash screen for my OS,

Could i enter mode 13h, then put all the pixels needed, load the kernel & everything else then exit mode 13h??

Or is there a better way??

If not, how do i put pixels in assembler, while in mode 13h??

If i can't get more colours without using VESA, then can i get a better resolution? (640x480?)

ciao ;)
Berserk

Re:Where do i start??

Post by Berserk »

Please answer the questions above, and i got one more question to add:

Can i use DLL's in My OS?? If i compile them in Visual C++ 6 or GCC?? Can i just use them normally without extra code? or do i have to go through some painstaking process of assembler code to enable DLL's??

Dynamically Linked Librarys (DLL'S) are needed in an OS, i can't believe i forgot to ask about them, so can i use DLL's??

Please help, ciao;D
Post Reply