Page 1 of 1

Switching VGA mode with patched GRUB [solved]

Posted: Tue Feb 21, 2012 3:08 am
by Threadcore
Hello

I want to switch to the VGA graphic mode. For this I will use GRUB, but I have a few questions:

-The menu.lst config file of GRUB has a parameter called vga=xxx (http://pierre.baudu.in/other/grub.vga.modes.html). For what is this parameter exactly ? I read in this forum, that you must patch GRUB for switching the VGA/VESA BIOS Extensions mode (This 2 lines) in real mode. What's true ?
-Let's say, I need a patched GRUB, I found patches, but for VBE. Is there one for VGA with 320x200 (http://bespin.org/~qz/pc-gpe/vgabios.txt)? Some links are down

I know, that the whole switching is 2 lines in real mode, but my problem is GRUB (Protected mode).

Thanks

Re: Switching VGA mode with patched GRUB

Posted: Tue Feb 21, 2012 3:34 am
by Combuster
Is there one for VGA with 320x200
Depending on the bios and how the patch is actually written, passing 13 as the mode number might work or not. However, since 320x200x8 VGA mode is the mode you seem to want, there are ways to do it properly, without grub, from protected mode, saving you from special binaries and guesswork. There's an entire FAQ entry dedicated to this, but you might want to jump directly to VGA Resources for the cheap solution.

Re: Switching VGA mode with patched GRUB

Posted: Tue Feb 21, 2012 3:42 am
by Threadcore
Hello

I know. I think you mean this (http://files.osdev.org/mirrors/geezer/o ... cs/modes.c). My plan is to switch the mode with INT 10h (Later, when I use VBE, I need this switching in real mode - so this is only a solution for VGA).

I'll take a look to the GRUB source

Re: Switching VGA mode with patched GRUB

Posted: Tue Feb 21, 2012 5:33 am
by Kevin
Threadcore wrote:The menu.lst config file of GRUB has a parameter called vga=xxx
This is a Linux kernel parameter that isn't interpreted by GRUB at all.

Re: Switching VGA mode with patched GRUB

Posted: Tue Feb 21, 2012 5:47 am
by Solar
To elaborate, the syntax is:

kernel <binary> <options...>

It loads the given kernel binary for execution. Whatever comes after the kernel filename is passed as command line to the kernel.

I.e., "kernel" is the only thing that is interpreted by GRUB; all the rest is Linux-specific.

Re: Switching VGA mode with patched GRUB

Posted: Tue Feb 21, 2012 6:14 am
by Threadcore
Hi

Ok, good to know. After that, I think it's better to switch back to real mode or to use a VM8086. A patched GRUB isn't nice and I can't solve other "problems" (without a patch or switching back to rm/VM8086). Thank you.

Re: Switching VGA mode with patched GRUB

Posted: Tue Feb 21, 2012 2:02 pm
by turdus
Threadcore wrote:Hi

Ok, good to know. After that, I think it's better to switch back to real mode or to use a VM8086. A patched GRUB isn't nice and I can't solve other "problems" (without a patch or switching back to rm/VM8086). Thank you.
You can make GRUB to switch mode, but it's not menu.lst's "vga=". You must specify Multiboot header in a way to tell GRUB to do so, read
http://www.gnu.org/software/grub/manual ... ics-fields
(never used though)