VBE in Protected Mode Tutorial?

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.
OniLink10
Posts: 1
Joined: Sun Apr 19, 2009 2:17 pm

VBE in Protected Mode Tutorial?

Post 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:
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Re: VBE in Protected Mode Tutorial?

Post by JackScott »

Moved.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: VBE in Protected Mode Tutorial?

Post by Combuster »

This is a good time to add a FAQ entry on mode changes in general...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: VBE in Protected Mode Tutorial?

Post by Troy Martin »

We have VGA mode setting-ness in the FAQ, but we need VBE. (it will be done in three minutes)
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Re: VBE in Protected Mode Tutorial?

Post 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
Last edited by gedd on Mon Apr 20, 2009 11:39 am, edited 1 time in total.
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Re: VBE in Protected Mode Tutorial?

Post 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.
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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.
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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. :(
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: VBE in Protected Mode Tutorial?

Post 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.
gedd
Member
Member
Posts: 104
Joined: Thu Apr 10, 2008 1:47 am

Re: VBE in Protected Mode Tutorial?

Post 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 !
[ Grub 2 | Visual Studio 2013 | PE File ]
The OsDev E.T.
Don't send OsDev MIB !
Locked