Page 1 of 2
VBE3.0 protected mode interface
Posted: Fri Feb 24, 2006 12:00 am
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.
Re: VBE3.0 protected mode interface
Posted: Fri Feb 24, 2006 12:00 am
by carbonBased
Does your video card support VBE 3.0?
--Jeff
Re: VBE3.0 protected mode interface
Posted: Fri Feb 24, 2006 12:00 am
by yaocong
yes,
Re: VBE3.0 protected mode interface
Posted: Sat Feb 25, 2006 12:00 am
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.
Re: VBE3.0 protected mode interface
Posted: Sat Feb 25, 2006 12:00 am
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
Re: VBE3.0 protected mode interface
Posted: Sat Feb 25, 2006 12:00 am
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!!!
Re: VBE3.0 protected mode interface
Posted: Sun Feb 26, 2006 12:00 am
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)
Re: VBE3.0 protected mode interface
Posted: Sun Feb 26, 2006 12:00 am
by yaocong
I traced the code, and found that the vbe3 bios actually have the similar errors, load register es with 0.
Re: VBE3.0 protected mode interface
Posted: Sun Feb 26, 2006 12:00 am
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...
Re: VBE3.0 protected mode interface
Posted: Mon Feb 27, 2006 12:00 am
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
Re: VBE3.0 protected mode interface
Posted: Mon Feb 27, 2006 12:00 am
by matthias
But very difficult to initialize as I found
does anyone have a idea what is wrong with my code?
Re: VBE3.0 protected mode interface
Posted: Tue Feb 28, 2006 12:00 am
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
Re: VBE3.0 protected mode interface
Posted: Tue Feb 28, 2006 12:00 am
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.
Re: VBE3.0 protected mode interface
Posted: Tue Feb 28, 2006 12:00 am
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)
Re: VBE3.0 protected mode interface
Posted: Tue Feb 28, 2006 12:00 am
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!!!!