Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S8TDp-0006mc-Un for mharc-grub-devel@gnu.org; Fri, 16 Mar 2012 05:13:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8TDi-0006k2-VV for grub-devel@gnu.org; Fri, 16 Mar 2012 05:13:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8TDK-0005wf-9M for grub-devel@gnu.org; Fri, 16 Mar 2012 05:13:10 -0400 Received: from smtprelay02.ispgateway.de ([80.67.31.25]:47754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8TDJ-0005wE-Vm for grub-devel@gnu.org; Fri, 16 Mar 2012 05:12:46 -0400 Received: from [188.105.76.107] (helo=[192.168.1.3]) by smtprelay02.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1S8TDH-0004SX-6U for grub-devel@gnu.org; Fri, 16 Mar 2012 10:12:43 +0100 Message-ID: <4F63040D.8020408@jomammele.de> Date: Fri, 16 Mar 2012 10:12:45 +0100 From: Joachim Mammele User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: grub-devel@gnu.org Subject: getting status of frontkeys Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Df-Sender: bWFpbEBqb21hbW1lbGUuZGU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.67.31.25 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: Fri, 16 Mar 2012 09:13:17 -0000 Hi everybody, I wrote a mail to this list some time ago wondering if it might be possible to get the status of some frontkeys of a tablet. Vladimir answered me and mentioned that Grub Legacy wouldn't be supported any more. Would it be possible then with Grub2 instead? Vladimir answered aswell the following: > bits9 = system("readFrontKey"); You can't use usual syscalls inside bootloader. GRUB2 has its own API which is somewhat posix-like but has no such things as "system", pipes or forks, and normally there shouldn't be any need. I had a look at this page: http://www.gnu.org/software/grub/manual/grub.html#Command_002dline-and-menu-entry-commands So I'm wondering if there might be any way to select the system to boot depending on which key is pressed? Greetings Joachiim Here my old mail: ---- Hi everybody, I have got a tablet with special frontkeys and I would like to install and adapt android on it. This works fine with the project android-x86.org On grub I would like to select the bootitems with the frontkeys. The frontkeys can be read with the following code (this is working, file named readFrontKey.c). #include #include #include #include int main() { unsigned char bits8, bits9, bits0, bitsA, bitsB, bitsC, bitsD, bitsE, bits; if(ioperm(0x208, 8, 1) < 0) { perror("0x208"); return 1; } bits = 32; outb(bits, 0x20A); outw(-16832, 0x20C); bits9 = inb(0x209); return bits9; } But when I add the following code to external/grub/stage2/stage2.c I get an "undefined reference to `system' " error message: The code I added to stage2.c (at roundabout line 391) is bits9 = system("readFrontKey"); if (bits9 == 64) entryno = 1; if (bits9 == 32) entryno = 2; if (bits9 == 16) entryno = 3; goto boot_entry; /* Check for a keypress, however if TIMEOUT has been expired (GRUB_TIMEOUT == -1) relax in GETKEY even if no key has been pressed. stage2.c has stdlib.h included. I added the program readfrontkey.c to Makefile.am and also adapted Makefile.in Any help woud be apreciated Joachim Mammele P.S. The repository that I use can be found here: http://android-x86.git.sourceforge.net/git/gitweb.cgi?p=android-x86/korg_external_grub.git;a=summary _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel