Vesa In PMode

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.
Post Reply
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Vesa In PMode

Post by Lprogster »

I have some code that sets up a 640x480x8 VESA mode (in my boot-sector).

...

So this is what I want to do! After searching I can't find anything helpful on this, though...

How do I do this?

Thanks,
Lster
Last edited by Lprogster on Sun Jul 22, 2007 12:40 pm, edited 2 times in total.
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post by nick8325 »

I haven't written any VESA code, but according to http://www.osdev.org/wiki/Getting_VBE_Mode_Info, the screen buffer (framebuffer) address is stored in the mode info block. Look at http://www.ctyme.com/intr/rb-0274.htm; the framebuffer address is 40 bytes into that table. You should be able to call that from your bootloader and pass the information to your kernel.
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

Thank you nick8325, worked a charm!

Cheers,
Lster
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

My mode switcher is run once full initialization is complete (it's loaded off the drive as a virtual mode task).

It basically finds the mode you want to enter, then finds out if that mode supports a LFB, if so, switches to that mode and returns the address of the LFB.

Edit: come to think of it, I don't see the relevance of what I just said, unless you need some NASM code that shows how to safely switch modes (and gracefully die if it can't) in which case I should just say, PM me.
Post Reply