VBE3.0 protected mode interface

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.
yaocong
Posts: 22
Joined: Fri Sep 09, 2005 11:00 pm
Location: China
Contact:

VBE3.0 protected mode interface

Post by yaocong »

In vbe3.0,there has offered a method with which we can call the vbe bios directly in protected mode.
But I wrote a code in according to the steps on the vbe3.0 specification,but It does not work!!!
Have anybody wrote a code like this,Could you help me?
many thanks.
I like the Dream of the Red Chamber.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: VBE3.0 protected mode interface

Post by carbonBased »

Does your video card support VBE 3.0?

--Jeff
yaocong
Posts: 22
Joined: Fri Sep 09, 2005 11:00 pm
Location: China
Contact:

Re: VBE3.0 protected mode interface

Post by yaocong »

yes,
I like the Dream of the Red Chamber.
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Re: VBE3.0 protected mode interface

Post by matthias »

I wrote it once, but unfortunatly failed :( Anyway, If you post your code here maybe one of us can help you ;) Maybe I can find some code I wrote back then. I'm lazy so I didn't put much effort in VBE3.0 My problem was my system rebooted when I tried to call the vbe init call, which initializes all structures. Still don't know what went wrong.
The source of my problems is in the source.
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Re: VBE3.0 protected mode interface

Post by matthias »

Found some of my old code :

vbe.cpp

Maybe it helps ;) If so I would like to know how you did it ;):P
Last edited by matthias on Sat Feb 25, 2006 12:00 am, edited 1 time in total.
The source of my problems is in the source.
yaocong
Posts: 22
Joined: Fri Sep 09, 2005 11:00 pm
Location: China
Contact:

Re: VBE3.0 protected mode interface

Post by yaocong »

thanks above guys.

But It still not work,
I traced the program with bochs,
And I know where the problem is : div ax,cx
ax=0,cx=0; odd!!!!

I think,the VBE3.0 BIOS has problem. And I try several other vedio card, they also have many problems. the bios is invalid!!!
I like the Dream of the Red Chamber.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: VBE3.0 protected mode interface

Post by JAAman »

if all the video cards you tryed support VBE3, and it doesn't work on any of them, then the problem is with your code, not the cards --- however, remember, if you are testing in bochs, you are not using the video card, and changing the card in the computer won't make any difference (you have to test on real hardware for that)

that error prob means your passing the wrong arguments (a divide by zero, using argument you passed -- or were supposed to pass)
yaocong
Posts: 22
Joined: Fri Sep 09, 2005 11:00 pm
Location: China
Contact:

Re: VBE3.0 protected mode interface

Post by yaocong »

I traced the code, and found that the vbe3 bios actually have the similar errors, load register es with 0.
I like the Dream of the Red Chamber.
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: VBE3.0 protected mode interface

Post by Da_Maestro »

Does VBE3 have full VBE support...I heard somewhere that VBE3 protected mode didn't support all the functions that VBE3 real mode does...
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: VBE3.0 protected mode interface

Post by JAAman »

no, for example, i don't think there is a 'plot pixel' function, nor is there any 'teletype' functions -- VBE3 doesn't include any functions to draw -- but those are not really important anyway

it does include mode changing, and bank-switching however, which is the most important

you may be thinking of VBE2, whose PMode interface doesn't include some important functions, but vbe3 is fully functional
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Re: VBE3.0 protected mode interface

Post by matthias »

But very difficult to initialize as I found :( does anyone have a idea what is wrong with my code?
Last edited by matthias on Mon Feb 27, 2006 12:00 am, edited 1 time in total.
The source of my problems is in the source.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: VBE3.0 protected mode interface

Post by JAAman »

do you have the official vbe3 documents? or just a tut? or unofficial docs?

if you don't have it, get the official docs, as they will be more accurate and more complete than others
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Re: VBE3.0 protected mode interface

Post by matthias »

I've printed all pages of the official vbe 3.0 documentation.. over 300 pages :S I just wrote the code according what they had to say in the vbe 3.0 specifications. But it doesn't work :S A reboot finds place when I try to call the PMInit vbe-call.
The source of my problems is in the source.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: VBE3.0 protected mode interface

Post by JAAman »

i was actually talking to the original poster, but i don't have expirience with vbe3 yet myself (just started over actually, but having trouble finding time to code)
yaocong
Posts: 22
Joined: Fri Sep 09, 2005 11:00 pm
Location: China
Contact:

Re: VBE3.0 protected mode interface

Post by yaocong »

I have the official document too.

And When I called the PMInitialize in 16-bit protected cs selector,the computer reboots!!!

And I tranced the code, the problem is that in ASM:

....
db 66h
ret

so you can see that we called veb3 initializing code with call fword ptr[ init],it is a far call,but the bios code is a "near return"!!! this is the problem in vbe3 bios.

But when i correct the problem by replacing "ret" with "retf",the initializing function was successed.
however, when I called the "Set Mode Function" by a far call at the "EntryPoint ", another problem arosed:
sub bx,bx;
mov es,bx
lea di,es:[si]
odd!!!! ,the bios laod es with 0,and use this zero selector,it surely be a "protected error"!!!

after I remedied this error by loading es with 0x100000(the relocated bios address),and called again, yet a further error appeard: div ax,cx;
ax=bx=0; REDICULOUS!!!!!

And I fond that different vedio card have different error in calling vbe3 bios.

I wonder whether the designers have tested the code they wrote!!!!
I like the Dream of the Red Chamber.
Post Reply