Getting GRUB video pointer

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
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Getting GRUB video pointer

Post by obiwac »

I know that I should have done this a LONG time ago, but I kind of forgot to do it when I implemented the graphics for my OS. I only realized that I had hard coded the graphics pointer when I tried running my OS in QEMU, instead of VirtualBox.
I'm passing flags to multiboot GRUB so that it can change the graphics mode before switching to pmode.
So, how exactly do I get the video pointer?
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Getting GRUB video pointer

Post by iansjack »

The multiboot specifications tell you where to find the information.

https://www.gnu.org/software/grub/manua ... cification
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: Getting GRUB video pointer

Post by osdever »

You need to get a Multiboot structure that GRUB passes, video info is included in it along with a ton of other very useful info.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
User avatar
eryjus
Member
Member
Posts: 286
Joined: Fri Oct 21, 2011 9:47 pm
Libera.chat IRC: eryjus
Location: Tustin, CA USA

Re: Getting GRUB video pointer

Post by eryjus »

iansjack wrote:The multiboot specifications tell you where to find the information.

https://www.gnu.org/software/grub/manua ... cification
I actually found the source to be more valuable. https://github.com/coreos/grub/blob/mas ... ultiboot.h

it contains some undocumented extensions which I found to be implemented in my grub2 loader.
Adam

The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal

"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
User avatar
obiwac
Member
Member
Posts: 149
Joined: Fri Jan 27, 2017 12:15 pm
Libera.chat IRC: obiwac
Location: Belgium

Re: Getting GRUB video pointer

Post by obiwac »

Ok thanks! It be working now!
Post Reply