Can I .. 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
dori

Can I .. VESA

Post by dori »

can I change the video mode with VESA while in 32 bits??? I know vesa 2 has 32 bit bios calls..


and I heard someone that there are no interupts in proctected mode.. what the hell is that cuz I think thats impossible

anyway, can someone help me??
thanks, later
Schol-R-LEA

Re:Can I .. VESA

Post by Schol-R-LEA »

There are indeed interrupts in protected mode, but they work through a completely different mechanism than the real-mode IVT.

What you cannot do, however - as you seem to be aware - is call 16-bit BIOS routines in p-mode without first shifting into either real mode or v86 mode. Since only a small number of graphics card to date support 32-bit BIOS calls, most generic VESA video drivers operate in v86 mode. The alternative is to have a driver specifc to the card in question, and in most cases the information needed to write one for a new OS is not readily available. Even established systems like FreeBSD, OS/2, Linux and even WinNT have had problems with this issue; indeed, one could argue that the lack of drivers were what killed OS/2 and BeOS-PC, and they slowed the acceptance of NT considerably (NT is notoriously difficult to write drivers for).
dori

Re:Can I .. VESA

Post by dori »

they work through the IDT, I know.. thats what I always knew.. was just confused by someone saying that u cant have interupts in rmode


and from what I know all the new 3d video cards support the VESA2 BIOS and have the 32 bit routines in the onboard bios.. so that should do it

and the mobo itself has some PCI 32 bit routines(not related to video though)

Im not planning on writting drivers except an universal driver that will work on all video cards(most)

I am planning on implementing the Linux driver sys(including XFree86) and the Linux API and thats about it... I would do windows api but I just started to hate windows so much that I (dont blame me though.. Im just sick of microshit)

so the ideea is that I can use VESA BIOS from pmode, right?
PlayOS

Re:Can I .. VESA

Post by PlayOS »

In VESA 2 there is 32 bit calls, but these do not include a mode changing call. You can handle bank switching and stuff like that but no mode changes. VESA 3 however has everything available from 32 bit calls. But VESA 3 is not anywhere near as common as VESA 2. :(
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:Can I .. VESA

Post by Pype.Clicker »

to give you a clue, my GeForce2 has VBE3 support built in ... i guess any video card made in this century is likely to have VBE3...
soilwork

Re:Can I .. VESA

Post by soilwork »

thats good to know cuz I by the time I finish my os there is not gonna be 1 video card that doesnt have VBE3


now that I know this can u give me a very piece of code for changing to 800x600 16,24or32RGB(or any mode for that mather.. Ill find the list of modes) in C++ if possible

a simple routine.. thanks
Tim

Re:Can I .. VESA

Post by Tim »

Code: Select all

mov ax, 100h
int 10h
This real-mode code switches to IIRC 640x480x256, which is one of the standard VESA modes. You can't switch VESA modes directly in protected mode under VBE2; you need to run the above code in V86 mode for that.

Not all cards support the same modes. See the VESA spec for a full reference.
Tom

Re:Can I .. VESA

Post by Tom »

Tim Rob. how do you put pixels in that mode? ( in PMode )...If it's complicated, don't worry about it
dori

Re:Can I .. VESA

Post by dori »

yea, thanks... though what I meant is how to do it in pmode with VBE3 32 bit...

and its up to me to setup the IDT, right??

and after I do so I can use the stuff..

and I DONT WANT TO USE 256.. thats a paleted method.. and i realy dont wanna go into those.. I want to use RGB as all video cards now have more then enough memory for that kind of 2D

thanks though
Tim

Re:Can I .. VESA

Post by Tim »

Tom: Use the VBE bank switch function to switch to the right bank, then set 8-bit pixels in the 64KB segment at A0000. If your card supports a linear frame buffer in that mode, you can map the LFB into memory and write pixels to it without any bank switching.
K.J.

Re:Can I .. VESA

Post by K.J. »

Tim: does your OS use VBE3? If so, what file is it hidden in in your OS?

K.J.
Warmaster199

Re:Can I .. VESA

Post by Warmaster199 »

Easier:
Look at the VESA 3.0 specification. If I recall correctly, you just need to check the VBE mode info struct and then set the mode number in the VESA header struct. Simply doing this should tell the VESA card to switch the mode while it's updating...
Tim

Re:Can I .. VESA

Post by Tim »

K.J.: no, not yet. I have S3 Trio64 and VGA drivers.
jcout_bsi

Re:Can I .. VESA

Post by jcout_bsi »

Could someone give info on PMODE in terms that a c programmer can understand... (Assume i know nothing about PMODE...Even though i know how to switch to it [And make my system crash at the next instruction after flushing the cache...])
Post Reply