From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1SMJJS-0008KA-43 for mharc-grub-devel@gnu.org; Mon, 23 Apr 2012 09:28:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMJJO-0008Jx-Fk for grub-devel@gnu.org; Mon, 23 Apr 2012 09:28:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMJJG-0005KY-Ou for grub-devel@gnu.org; Mon, 23 Apr 2012 09:28:14 -0400 Received: from smtprelay01.ispgateway.de ([80.67.31.24]:57414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMJJG-0005KU-Fo for grub-devel@gnu.org; Mon, 23 Apr 2012 09:28:06 -0400 Received: from [88.67.16.117] (helo=[192.168.1.11]) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1SMJJE-0001I0-Ct for grub-devel@gnu.org; Mon, 23 Apr 2012 15:28:04 +0200 Message-ID: <4F9558EF.8020100@jomammele.de> Date: Mon, 23 Apr 2012 15:28:15 +0200 From: Joachim Mammele User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: select menu item depending on frontkey References: <4F955106.8010603@jomammele.de> <4F955163.4070806@gmail.com> In-Reply-To: <4F955163.4070806@gmail.com> Content-Type: multipart/alternative; boundary="------------000109010606020003090502" X-Df-Sender: bWFpbEBqb21hbW1lbGUuZGU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.67.31.24 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Apr 2012 13:28:17 -0000 This is a multi-part message in MIME format. --------------000109010606020003090502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Okay, I modified the code. But still getting some error messages on the beginning of starting grub (and later on: "error: file not found, you need to load the kernel first") #set keybits = "32"; grub_outb(32, 0x20A); grub_outw(-16832, 0x20C); bits9 = grub_inb(0x209); echo "bits9= " echo ${bits9} if [${bits9} = 64]; then set default="1" elif [${bits9} = 32]; then set default="2" elif [${bits9} = 16]; then set default="3" else set default="0" fi Am 23.04.2012 14:56, schrieb Vladimir '?-coder/phcoder' Serbinenko: > On 23.04.2012 14:54, Joachim Mammele wrote: >> Hi, >> accrding to Vladimirs hints I adapted my grub-configuration. >> >> What I changed in /boot/grub/grub.cfg is the following: (I'm aware >> that editing grub.cfg isn't the best option as it gets rewritten on >> executing the config-scripts) >> (the whole file can be found here http://pastebin.com/K57RHjwn) >> >> ### BEGIN /etc/grub.d/00_header ### >> if [ -s $prefix/grubenv ]; then >> load_env >> fi >> >> #unsigned char bits9, keybits; >> >> set keybits = "32"; >> grub_outb(keybits, 0x20A); >> grub_outw(-16832, 0x20C); >> set bits9 = grub_inb(0x209); >> >> echo "bits9= " >> echo bits9 >> >> if (bits9 == 64) >> set default="1" >> if (bits9 == 32) >> set default="2" >> if (bits9 == 16) >> set default="3" >> else >> set default="0" >> >> On starting grub I see some error log-messages but before I can read >> them the grub-menu appears. >> I'm using ubuntu 10.04 (Kernel 2.6.32-40) >> >> Any help would be appreciated. >> > grub.cfg is written in GRUB bash-like, not C. Modules are in C. >> Greetings >> Joachim >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel >> > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel -- Joachim Mammele Egelhaafstrasse 3 70565 Stuttgart Mobil: 0162/4603792 E-Mail: mail@jomammele.de --------------000109010606020003090502 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Okay,
I modified the code. But still getting some error messages on the beginning of starting grub (and later on: "error: file not found, you need to load the kernel first")

#set keybits = "32";
grub_outb(32, 0x20A);
grub_outw(-16832, 0x20C);
bits9 = grub_inb(0x209);

echo "bits9= "
echo ${bits9}

if [${bits9} = 64]; then
    set default="1"
elif [${bits9} = 32]; then
    set default="2"
elif [${bits9} = 16]; then
    set default="3"
else
    set default="0"
fi

Am 23.04.2012 14:56, schrieb Vladimir 'φ-coder/phcoder' Serbinenko:
On 23.04.2012 14:54, Joachim Mammele wrote:
Hi,
accrding to Vladimirs hints I adapted my grub-configuration.

What I changed in /boot/grub/grub.cfg is the following: (I'm aware
that editing grub.cfg isn't the best option as it gets rewritten on
executing the config-scripts)
(the whole file can be found here http://pastebin.com/K57RHjwn)

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi

#unsigned char bits9, keybits;

set keybits = "32";
grub_outb(keybits, 0x20A);
grub_outw(-16832, 0x20C);
set bits9 = grub_inb(0x209);

echo "bits9= "
echo bits9

if (bits9 == 64)
    set default="1"
if (bits9 == 32)
    set default="2"
if (bits9 == 16)
    set default="3"
else
    set default="0"

On starting grub I see some error log-messages but before I can read
them the grub-menu appears.
I'm using ubuntu 10.04 (Kernel 2.6.32-40)

Any help would be appreciated.

grub.cfg is written in GRUB bash-like, not C. Modules are in C.
Greetings
Joachim

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel




_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Joachim Mammele
Egelhaafstrasse 3
70565 Stuttgart
Mobil: 0162/4603792
E-Mail: mail@jomammele.de
--------------000109010606020003090502--