Switching VGA mode with patched GRUB [solved]

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
Threadcore
Posts: 6
Joined: Wed Nov 23, 2011 6:20 am

Switching VGA mode with patched GRUB [solved]

Post 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
Last edited by Threadcore on Tue Feb 21, 2012 6:16 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: Switching VGA mode with patched GRUB

Post 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.
"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 ]
Threadcore
Posts: 6
Joined: Wed Nov 23, 2011 6:20 am

Re: Switching VGA mode with patched GRUB

Post 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
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Switching VGA mode with patched GRUB

Post 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.
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Switching VGA mode with patched GRUB

Post 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.
Every good solution is obvious once you've found it.
Threadcore
Posts: 6
Joined: Wed Nov 23, 2011 6:20 am

Re: Switching VGA mode with patched GRUB

Post 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.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Switching VGA mode with patched GRUB

Post 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)
Post Reply