Having GRUB set video mode?

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
Warrior

Having GRUB set video mode?

Post by Warrior »

Is this possible? I saw some mention of it in thier documentation but I didn't know much about it in general. Can anyone elaborate on this?

Regards,
Nelson
srg

Re:Having GRUB set video mode?

Post by srg »

Nelson wrote: Is this possible? I saw some mention of it in thier documentation but I didn't know much about it in general. Can anyone elaborate on this?

Regards,
Nelson
The multiboot spec does define some parts of the multiboot header for telling the loader what display mode to use, but it doesn't seem to work. I think there are other ways though.

srg
beowulf573

Re:Having GRUB set video mode?

Post by beowulf573 »

Grub currently doesn't support changing the VESA mode, but you can grab a patched version that does here:

http://djm.co.za/spoon/grub/grub.php

I've been using it for a few days, works well. It also fills in the multiboot header information for the current mode.

I don't know why this isn't included in the grub, they have support for probing and testing vesa modes, just not setting it before jumping into protected mode.

Eddie
durand
Member
Member
Posts: 193
Joined: Wed Dec 21, 2005 12:00 am
Location: South Africa
Contact:

Re:Having GRUB set video mode?

Post by durand »

It's not included because it doesn't correctly switch back to normal text mode if something goes wrong during the loading of everything.

And I don't think they're too interested since it was shot down on two occasions as well as on a further patched version of my patch. Further development on GRUB is finished and GRUB2 has begun.
Warrior

Re:Having GRUB set video mode?

Post by Warrior »

I'll have a look at it, thanks.
jicama

Re:Having GRUB set video mode?

Post by jicama »

;)my os floppy image, use fat12 grub file from spoon.
http://freehost10.websamba.com/jicama/jicama/floppy.rar
durand
Member
Member
Posts: 193
Joined: Wed Dec 21, 2005 12:00 am
Location: South Africa
Contact:

Re:Having GRUB set video mode?

Post by durand »

cool! I wonder how many people do use it.

I mentioned to the grub maintainers that I thought it would help out new hobby OS developers a lot as it would make the whole switching to VESA mode a non-issue. There would be a lot more pretty OS's to look at.
Warrior

Re:Having GRUB set video mode?

Post by Warrior »

isn't it possible to switch using a module? I dunno if they are executed while in real mode.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Having GRUB set video mode?

Post by Pype.Clicker »

modules are not executed: they're loaded. period.
Warrior

Re:Having GRUB set video mode?

Post by Warrior »

Oh, I guess I'll either

A) use that patched GRUB
B) write my own loader
or use a prewritten one.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Having GRUB set video mode?

Post by Brendan »

Hi,
Nelson wrote: Oh, I guess I'll either

A) use that patched GRUB
B) write my own loader
or use a prewritten one.
I use my own loaders and normal/unpatched GRUB. The trick I use with GRUB is to load the normal kernel/boot image (that GRUB thinks is a module), and also load some "thunk" code (that GRUB thinks is the kernel).

This "thunk" code does a bit of memory juggling, switches the CPU back to real mode and then starts the normal kernel/boot image (that GRUB loaded as a module).

This means the normal kernel/boot code ends up at a specific address and is started in real mode - the same as it would have been setup by normal boot code (e.g. 1440 KB floppy boot sector, DOS boot utility, etc).

Because you're always starting in real mode there's no problems with using the BIOSs to setup video - I generate a list of possible modes and let the user scroll through the list to select (and test) any video mode (I've actually got a full graphical boot menu in 640*480 that uses the BIOS video and keyboard).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Warrior

Re:Having GRUB set video mode?

Post by Warrior »

Clever! Yea, I checked out BCOS, looks pretty nice
Post Reply