From: "Richard B. Johnson" <root@chaos.analogic.com>
To: "Randy.Dunlap" <rddunlap@osdl.org>
Cc: "Kristian Sørensen" <ks@cs.auc.dk>,
linux-kernel@vger.kernel.org, umbrella@cs.auc.dk
Subject: Re: Implement new system call in 2.6
Date: Wed, 25 Feb 2004 13:41:11 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.53.0402251336510.3401@chaos> (raw)
In-Reply-To: <20040225101419.5f058573.rddunlap@osdl.org>
On Wed, 25 Feb 2004, Randy.Dunlap wrote:
> On Wed, 25 Feb 2004 11:07:41 +0100 (CET) Kristian Sørensen wrote:
>
> | Hi all!
> |
> | How do I invoke a newly created system call in the 2.6.3 kernel from
> | userspace?
> |
> | The call is added it arch/i386/kernel/entry.S and include/asm/unistd.h
> | and the call is implemented in a security module called Umbrella(*).
> |
> | The kernel compiles and boots nicely.
> |
> | The main problem is now to compile a userspace program that invokes this
> | call. The guide for implementing the systemcall at
> | http://fossil.wpi.edu/docs/howto_add_systemcall.html
> | has been followed, which yields the following userspace program:
> |
> | // test.h
> | #include "/home/snc/linux-2.6.3-umbrella/include/linux/unistd.h"
> | _syscall1(int, umbrella_scr, int, arg1);
> |
> | // test.c
> | #include "test.h"
> | main() {
> | int test = umbrella_scr(1);
> | printf ("%i\n", test);
> | }
> |
> | When compiling:
> |
> | gcc -I/home/snc/linux-2.6.3/include test.c
> |
> | /tmp/ccYYs1zB.o(.text+0x20): In function `umbrella_scr':
> | : undefined reference to `errno'
> | collect2: ld returned 1 exit status
> |
#include <errno.h>
Some versions of 'C' define errno as *__errno_location().
Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
next prev parent reply other threads:[~2004-02-25 18:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-25 10:07 Kristian Sørensen
2004-02-25 11:14 ` Kristian Sørensen
2004-02-25 18:14 ` Randy.Dunlap
2004-02-25 18:41 ` Richard B. Johnson [this message]
2004-02-26 15:56 ` Kristian Soerensen
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=Pine.LNX.4.53.0402251336510.3401@chaos \
--to=root@chaos.analogic.com \
--cc=ks@cs.auc.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=rddunlap@osdl.org \
--cc=umbrella@cs.auc.dk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®