Page 1 of 1
Having GRUB set video mode?
Posted: Mon May 09, 2005 11:17 am
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
Re:Having GRUB set video mode?
Posted: Mon May 09, 2005 11:27 am
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
Re:Having GRUB set video mode?
Posted: Mon May 09, 2005 11:56 am
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
Re:Having GRUB set video mode?
Posted: Mon May 09, 2005 12:06 pm
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.
Re:Having GRUB set video mode?
Posted: Mon May 09, 2005 2:31 pm
by Warrior
I'll have a look at it, thanks.
Re:Having GRUB set video mode?
Posted: Tue May 10, 2005 9:47 pm
by jicama
Re:Having GRUB set video mode?
Posted: Wed May 11, 2005 2:19 am
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.
Re:Having GRUB set video mode?
Posted: Wed May 11, 2005 4:40 am
by Warrior
isn't it possible to switch using a module? I dunno if they are executed while in real mode.
Re:Having GRUB set video mode?
Posted: Wed May 11, 2005 5:25 am
by Pype.Clicker
modules are not executed: they're loaded. period.
Re:Having GRUB set video mode?
Posted: Wed May 11, 2005 10:23 am
by Warrior
Oh, I guess I'll either
A) use that patched GRUB
B) write my own loader
or use a prewritten one.
Re:Having GRUB set video mode?
Posted: Wed May 11, 2005 8:06 pm
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
Re:Having GRUB set video mode?
Posted: Wed May 11, 2005 9:19 pm
by Warrior
Clever! Yea, I checked out BCOS, looks pretty nice