Page 1 of 2

VBE in Protected Mode Tutorial?

Posted: Sun Apr 19, 2009 5:47 pm
by OniLink10
Hey guys, I'm new here. Does anyone know a simple way to activate VBE Mode 0x112 in Protected Mode Assembly? Here is my current .text section for my Kernel loaded by GRUB:

Code: Select all

;;;;;;;;
; Text ;
;;;;;;;;
section .text
align 4

MultiBootHeader:
	dd MAGIC
	dd FLAGS
	dd CHECKSUM

STACKSIZE equ 0x4000

loader:
	mov esp,stack+STACKSIZE
	push eax
	push ebx
	call kmain
	cli
hang:
	hlt
	jmp hang
Also, how do I find out where VRAM starts in that mode? A Final Question, VBE is supported on all Built-In/PCI/AGP/PCI-E Video Cards, right? I'm confused. D:

EDIT: Oops, I think this is the wrong board. D:

Re: VBE in Protected Mode Tutorial?

Posted: Sun Apr 19, 2009 6:56 pm
by JackScott
Moved.

Re: VBE in Protected Mode Tutorial?

Posted: Sun Apr 19, 2009 6:58 pm
by Troy Martin
Welcome!

We have a great wiki, I suggest you check it out, especially the Getting VBE Mode Info page which helps you get a VBE mode. VBE mode numbers are no longer standardized as of, I think, VBE 2.0.

Have fun,
--Troy

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 2:37 am
by Combuster
This is a good time to add a FAQ entry on mode changes in general...

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 8:21 am
by Troy Martin
We have VGA mode setting-ness in the FAQ, but we need VBE. (it will be done in three minutes)

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 9:09 am
by gedd
Combuster wrote:This is a good time to add a FAQ entry on mode changes in general...
If you are not in VBE 3.0, unless you have not a V86 mode manager you cannot change VESA mode in PM if you have not VBE version on you graphics card
- Bochs, virtual PC, vmWare, virtualbox are all in VBE 2.0
- having a V86 mode manager is a lot of work

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 10:38 am
by Combuster
Troy Martin wrote:We have VGA mode setting-ness in the FAQ, but we need VBE. (it will be done in three minutes)
Already there. Infact, I plan on deleting the VGA entry to make the new one more obvious (it covers both VGA and VBE).
Unless you have not a V86 mode manager you cannot change VESA mode in PM
That's not true. Read the FAQ entry to see why.

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 11:44 am
by gedd
Combuster wrote:
gedd wrote:Unless you have not a V86 mode manager you cannot change VESA mode in PM
That's not true. Read the FAQ entry to see why.
How to ? Return in real mode ? Great difference ..., This solution is worse.

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 12:10 pm
by kmtdk
well

first
if you got VBE 3.0 you can use Pmode
secound:
combuster is one of the best here at graphic's.

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 1:34 pm
by Combuster
the Protected Mode entry point would be the fourth option. I have not listed it in the FAQ since it's practically nowhere supported.

I do find it sad that gedd is putting up this reply and obviously did not read the FAQ entry in question. :(

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 1:53 pm
by Dex
kmtdk wrote:well

first
if you got VBE 3.0 you can use Pmode
This is a 16bit pmode, that is not much differant to going back to realmode as you still need to switch back, but just not as far.

@All, Please try something before you knock it, the best and easist way to switch graphic modes is to goto and from realmode, its simple and works.
Put your heads in the sand if you want and do not give people a chose to switch modes.
But do not knock it, just because one person says it so, so it must be true, following like a bunch of sheep.

Pmode vesa mode switching demo available here: http://www.dex4u.com/demos/VesaDemo.zip

And remember the world is not flat.

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 2:15 pm
by Combuster
Let me rephrase that: "People should not be telling you what is right and wrong. However I am telling you that dropping to real mode is the only acceptable option"

:roll:

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 5:34 pm
by JamesM
Dex wrote:
kmtdk wrote:well

first
if you got VBE 3.0 you can use Pmode
This is a 16bit pmode, that is not much differant to going back to realmode as you still need to switch back, but just not as far.

@All, Please try something before you knock it, the best and easist way to switch graphic modes is to goto and from realmode, its simple and works.
Put your heads in the sand if you want and do not give people a chose to switch modes.
But do not knock it, just because one person says it so, so it must be true, following like a bunch of sheep.

Pmode vesa mode switching demo available here: http://www.dex4u.com/demos/VesaDemo.zip

And remember the world is not flat.
Please understand that not everyone uses 16-bit real mode assembly. Most here write multitasking operating systems with some kind of soft time deadlines (i.e. something can't take so long that the user notices a response lag). Moving to realmode means you have to disable interrupts during the process, and you lose paging and thus access to the majority of your kernel's runtime data.

There are multiple methods for a reason. If you expect people to keep an open mind, please extend the same courtesy to yourself.

And remember, the world may not be flat, but neither is the world still living in the caveman era.

James

Re: VBE in Protected Mode Tutorial?

Posted: Mon Apr 20, 2009 6:44 pm
by Dex
JamesM wrote:And remember, the world may not be flat, but neither is the world still living in the caveman era.
James
But you are ( as in all OS Dev's ) in the caveman era, but you try to pretend your not, you have basic graphics, basic drivers, basic apps.
Thats what a hobby desktop OS is, its a caveman OS, just get real.

Re: VBE in Protected Mode Tutorial?

Posted: Tue Apr 21, 2009 12:40 am
by gedd
kmtdk wrote:well

first
if you got VBE 3.0 you can use Pmode
secound:
combuster is one of the best here at graphic's.
Yes you can in VBE 3, that's what i was saying but my post was not clear.
You can chnage mode but "get " functions are not operationnal (so you have to call them before going in PMode)
Unfortunaly as i said none of the virtual machine got VBE 3 card
You can have also a PM interface in VBE 2 but only for 3 functions i believe to manage window ,granularity (if no LFB) and color
So in this case you haveto change mode before going to PM, and keep it unless ...

And at last it was not a personnal attack for combuster so dont be sad !! :)
I have read the FAQ and VESA standard too !