Page 1 of 2
VBE 2 without v86
Posted: Fri Feb 25, 2011 9:25 am
by NickJohnson
I've been reading the VESA VBE docs, and they seem to suggest that there is a way to switch modes entirely in protected mode as long as the card supports version 2.0 and above (which I assume all modern cards do, since the spec is from 1996.) First, is this actually true? Second, is there a reasonable guide on doing this, since the official documentation is a bit vague on how to actually call the functions from protected mode? Third, if this is possible, why does everything on the wiki say that VBE always requires v86? This seems like it could be much much simpler and give you the same effect, so we should be recommending it.
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 10:48 am
by Chandra
NickJohnson wrote:I've been reading the VESA VBE docs, and they seem to suggest that there is a way to switch modes entirely in protected mode as long as the card supports version 2.0 and above (which I assume all modern cards do, since the spec is from 1996.) First, is this actually true? Second, is there a reasonable guide on doing this, since the official documentation is a bit vague on how to actually call the functions from protected mode? Third, if this is possible, why does everything on the wiki say that VBE always requires v86? This seems like it could be much much simpler and give you the same effect, so we should be recommending it.
Are you sure the documents are official? I've been using VBE2 documents as well, but I'm sure nothing is mentioned about PMI.As you know, it's VBE3 that supports PMI and so far I've not heard of any such thing being supported by VBE2. And Of course, I can't blame your documents for something I don't know.So, let's see if anyone has such experience.
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 11:07 am
by NickJohnson
Well, I've been using
this document, which at least claims to be official. Section 4.2 has stuff about a protected mode interface, although I'm having trouble figuring out how you actually call its functions.
However, if only VBE 3 supports the protected mode interface, I'd still like to know about how to use it. How prevalent are cards that support VBE 3 nowadays?
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 12:22 pm
by Cognition
Not all cards support the protected mode interface described in the VBE spec. Even if they claim to be VBE 3 compliant. There is a protected mode interface available for some specific functions on VBE 2 cards (page flipping, etc.), but not mode setting. In general support for full VBE3 style protected mode interface seems to be spotty at best (in my experience anyways).
The method for finding and accessing the protected mode interface is described pretty well in the VBE 3 specification. It requires creating several segments and copying the VGA bios over iirc. It's quite similar to the BIOS32 interface, but once again it's not very well supported. In general if VM86 is available it's the best way to get things done, if not you can either use a real mode emulator or virtualization extensions if they're available on the processor (pretty much involves using VM86 mode through a VM).
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 1:06 pm
by quok
Cognition wrote:Not all cards support the protected mode interface described in the VBE spec. Even if they claim to be VBE 3 compliant. There is a protected mode interface available for some specific functions on VBE 2 cards (page flipping, etc.), but not mode setting. In general support for full VBE3 style protected mode interface seems to be spotty at best (in my experience anyways).
Yes, that's correct... the VBE2 protected mode interface does not support mode setting, which is the primary reason it's not recommended for use I do believe. However, the VBE2 protected mode interface is 32-bit, and required by the VBE2 spec. VBE3 differs here as the protected mode interface is not only optional, but uses 16-bit protected mode. Support for the VBE3 protected mode interface is spotty at best, but it does support mode setting, as it is required to support all VBE3 functions if it is present.
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 2:28 pm
by NickJohnson
Okay, well, I guess it won't work then. It's going to be particularly hard for me to use VM86 because I'm working in usermode (with port privileges). Is there actually a working implementation of a 80286 emulator that I could use to simulate the BIOS, or do people just suggest this because it is theoretically possible?
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 3:17 pm
by quok
x86emu is what's generally used for this purpose.
Re: VBE 2 without v86
Posted: Fri Feb 25, 2011 8:47 pm
by bewing
And I've built a simplified emulator based on rebochs that does the same thing.
Re: VBE 2 without v86
Posted: Mon Feb 28, 2011 8:48 am
by rdos
I've not seen any system yet that supports the PMI interface, even though I once coded it just in case. Besides, providing V86 is much easier nowadays with the VME flag supported by most CPUs.
Re: VBE 2 without v86
Posted: Mon Feb 28, 2011 2:46 pm
by Combuster
rdos wrote:Besides, providing V86 is much easier nowadays with the VME flag supported by most CPUs.
And which is broken in half of the virtual machines.
Re: VBE 2 without v86
Posted: Tue Mar 01, 2011 9:30 am
by rdos
Combuster wrote:rdos wrote:Besides, providing V86 is much easier nowadays with the VME flag supported by most CPUs.
And which is broken in half of the virtual machines.
Not much of an issue since the aim is not to run an OS in a virtual machine, but on real hardware, where it should not be broken. However, in practise, some low-end CPUs does not support VME, so if the target audience is low-end systems (like embeded systems), both VME and non-VME processors must be supported. I support both by having a module that emulates the x86 processor that I can attach when the processor has no VME (or possibly when VME is broken in a virtual machine), but that I can leave-out if it supports VME.
Re: VBE 2 without v86
Posted: Thu Mar 10, 2011 4:45 am
by jal
Cognition wrote:Not all cards support the protected mode interface described in the VBE spec.
This is a common meme on this board, but since there arem in practice, only three gfx cards families to deal with on PCs, i.e. Intel, AMD and nVidia, has anyone ever tried to check what VBE support they offer on their latest products?
JAL
Re: VBE 2 without v86
Posted: Thu Mar 10, 2011 7:22 am
by NickJohnson
We can't: none of us have implemented the VBE 3 protected mode interface.
Re: VBE 2 without v86
Posted: Thu Mar 10, 2011 7:59 am
by rdos
NickJohnson wrote:We can't: none of us have implemented the VBE 3 protected mode interface.
Not true. But I've not yet seen a card with a working VBE 3 protected mode interface.
Re: VBE 2 without v86
Posted: Fri Mar 11, 2011 5:44 am
by jal
rdos wrote:Not true. But I've not yet seen a card with a working VBE 3 protected mode interface.
What do you call "working"? Do they just not support VBE3, or is their implementation of it faulty?
JAL