All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joachim Mammele <mail@jomammele.de>
To: grub-devel@gnu.org
Subject: undefined reference to 'system'
Date: Tue, 24 Jan 2012 15:40:50 +0100	[thread overview]
Message-ID: <4F1EC2F2.20304@jomammele.de> (raw)

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 <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/io.h>
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





             reply	other threads:[~2012-01-24 14:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24 14:40 Joachim Mammele [this message]
2012-01-24 15:30 ` undefined reference to 'system' Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F1EC2F2.20304@jomammele.de \
    --to=mail@jomammele.de \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.