How to enter and use VESA Video Modes ?

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
User avatar
DeezRamChips
Member
Member
Posts: 132
Joined: Fri Apr 08, 2016 5:03 am
Location: atapio.cpp - why won't you work :(
Contact:

How to enter and use VESA Video Modes ?

Post by DeezRamChips »

Hi, as said in the title, i was wondering how could i enter the vesa mode and plot pixels :)

I took time to read the page on the iki but i still dont understand :/

For the ones ho are interested, here is the source code : https://github.com/AlexandreRouma/PenutOS


Thanks for your help :)
Last edited by DeezRamChips on Fri Apr 08, 2016 6:22 am, edited 1 time in total.
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: How to enter and use VESA Video Modes ?

Post by Combuster »

Since you've read the wiki, which method do you plan to use and what about it don't you understand?
"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
DeezRamChips
Member
Member
Posts: 132
Joined: Fri Apr 08, 2016 5:03 am
Location: atapio.cpp - why won't you work :(
Contact:

Re: How to enter and use VESA Video Modes ?

Post by DeezRamChips »

Well, since I want to use my own bootloader, I want to change it at startup (just before entering P-Mode)
User avatar
DeezRamChips
Member
Member
Posts: 132
Joined: Fri Apr 08, 2016 5:03 am
Location: atapio.cpp - why won't you work :(
Contact:

Re: How to enter and use VESA Video Modes ?

Post by DeezRamChips »

And, what I dont understand, is how to plot a pixel after a changed the mode (i successfully change to 800 x 600 x16M) but i doesn't want to display anything so i assume i didn't change the mode correctly :/
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: How to enter and use VESA Video Modes ?

Post by Combuster »

The VESA tells you to use three functions, one to get a list of modes, one to get information about a specific mode (to see if it is what you want), and one to set a mode, including full pseudocode. To what extent is that insufficient?

In addition, you'll know setting the mode works if the screen gets cleared.
"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
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: How to enter and use VESA Video Modes ?

Post by BrightLight »

VESA says use function 0x4F01 to get the address of the framebuffer. You then write to the framebuffer to display pixels.
EDIT: Are you sure bit 14 (value 0x4000) of BX is set when you call function 0x4F02? You need to enable the linear frame buffer.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Post Reply