OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:53 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Internal Workings of VESA
PostPosted: Fri Aug 10, 2007 2:27 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
Hi,

I am currently implementing a basic VBE driver and was just wondering more about how VESA works at a hardware level.

The way I understand it, a BIOS programmer adds support for VESA within the BIOS space. Whatever graphics card you are using, the OS can then play nicely with the basic functions of that card. But I believe if I want to use anything above basic VGA in my OS, I would have to write a separate driver for each graphics board.

So how does the BIOS programmer do this? Surely they don't implement a different driver for each video card available. I guess there must be some kind of standard that every graphics card manufacturer follows to enable VESA too? If that is the case, why can't this same level of access be used by OS devvers to provide SVGA support rather than going via real mode interrupts to get and set video modes?

If there are any references where I can read up on this, or anyone has the answers, it will be much appreciated. I've gone for the theory section as I'm not intending to implement anything differently based on the answers - just interested!

Cheers,
Adam


Top
 Profile  
 
 Post subject: Re: Internal Workings of VESA
PostPosted: Fri Aug 10, 2007 3:32 am 
Offline
Member
Member

Joined: Sun Jul 30, 2006 8:16 am
Posts: 149
Location: The Netherlands
AJ wrote:
I am currently implementing a basic VBE driver and was just wondering more about how VESA works at a hardware level.

It doesn't really, it works at the software level. There's a bit of simple hardware support, but that's not VBE-specific.

Quote:
The way I understand it, a BIOS programmer adds support for VESA within the BIOS space. Whatever graphics card you are using, the OS can then play nicely with the basic functions of that card. But I believe if I want to use anything above basic VGA in my OS, I would have to write a separate driver for each graphics board.

So how does the BIOS programmer do this? Surely they don't implement a different driver for each video card available.

Yes, a different driver is implemented for each video card, or at least for every family of video cards that supports VBE. However, this isn't done by the regular BIOS programmers but by programmers employed by the video card manufacturer.

Quote:
I guess there must be some kind of standard that every graphics card manufacturer follows to enable VESA too? If that is the case, why can't this same level of access be used by OS devvers to provide SVGA support rather than going via real mode interrupts to get and set video modes?

From what I understand, when the BIOS initializes the system and finds the video card, it loads a video BIOS from the card to 0xC0000 (IIRC). It then calls a function in there to initialize it. That function may hook interrupt 10h to support VBE functionality.

Quote:
If there are any references where I can read up on this, or anyone has the answers, it will be much appreciated. I've gone for the theory section as I'm not intending to implement anything differently based on the answers - just interested!

I'm not sure where this information can be found [1], but what it comes down to as an OS developer is that if you want to use VBE, you have to use real mode interrupts, v86-mode interrupts, or one of the protected mode interfaces.

[1] Though a bit of it can be found at the top of the Wikipedia page on VBE.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 7:07 am 
Offline
Member
Member
User avatar

Joined: Sun Oct 22, 2006 7:01 am
Posts: 2646
Location: Devon, UK
OK - thanks for the answer.

I guess I was also struggling to see how all those different drivers could fit in BIOS space, but if some kind of firmware is copied from the video card to 0xC0000, I suppose that would explain it. All that would have to fit in the BIOS space would be interface code.

Cheers,
Adam


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 12:29 pm 
Offline
Member
Member
User avatar

Joined: Fri Jan 27, 2006 12:00 am
Posts: 1444
Do you have this doc ? http://www.vesa.org/public/VBE/vbe3.pdf


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 10, 2007 6:54 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 27, 2004 11:00 pm
Posts: 874
Location: WA
Quote:
From what I understand, when the BIOS initializes the system and finds the video card, it loads a video BIOS from the card to 0xC0000 (IIRC). It then calls a function in there to initialize it. That function may hook interrupt 10h to support VBE functionality.

technically, the BIOS code isnt copied to 0xC0000, instead its already at that location (the code is located in ROM/EEPROM on the video card, and that ROM chip is mapped to location 0xC0000)

and there is a BIOS video code located in the system ROM chip, but its extremely minimal, and doesnt support everything (iirc this code doesnt support anything more than CGA, and may not even be completely present on modern systems) this code is, of course, relocated within the 0xE0000-0xFFFFF range belonging to the system BIOS, and the BIOS initially loads this address to the int 10 video handler, but then it checks for RMode expansion cards, by looking for a special signature byte within the add-on ROM located in address range 0xC0000-0xE0000, when it finds the signature bytes, then it knows there is valid ROM at that location, and calls the initialization code, which replaces the int 10 handler with its own code (located in the add-on ROM chip -- normally, VGA ROM is located at 0xC0000, but other chips can be anywhere within that range, and older add-on cards which relied on this for loading drivers/hooking ints/etc would have dip-switches on the card which could change the address of the ROM chips, to avoid using an address already used by another card)

_________________
## ---- ----- ------ Intel Manuals
OSdev wiki


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group