Page 1 of 1

Vesa In PMode

Posted: Thu Jun 07, 2007 9:46 am
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

Posted: Thu Jun 07, 2007 9:59 am
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.

Posted: Thu Jun 07, 2007 10:27 am
by Lprogster
Thank you nick8325, worked a charm!

Cheers,
Lster

Posted: Thu Jun 07, 2007 4:35 pm
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.