Subject: Re: How to print "Hello" using system call?
To: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
From: Keichii Moto <keichiitoyota@yahoo.com>
List: tech-kern
Date: 07/16/2003 06:28:53
--- Hubert Feyrer
<hubert.feyrer@informatik.fh-regensburg.de> wrote:
> On Tue, 15 Jul 2003, Keichii Moto wrote:
> > Would you tell me which header files I should add
> > ? Thanks. I added <sys/syscallargs.h> and
> <stdio.h>.
> 
> stdio.h for kernel code? um... I think I don't
> really understand what you
> want to do - write kernel code, or userland code?
> the includes you list
> are ok for userland, but sys_hello() sounds like you
> want to add a
> hello(2) function to your kernel...
> 
> What do you want to do?

Sorry for misunderstood. I want to write kernel code,
not userland code. Here is my implementation:

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/syscallargs.h>

int
sys_hello(struct lwp *l, void *v, register_t *retval)
{
	struct sys_exit_args /* {
		syscallarg(int)	rval;
	} */ *uap = v;

        printf("Hello\n");
        return (0);
}

Then I use syscall() to load my system call,
it will print "Hello". Is it right? Thanks.
> 
> 
>  - Hubert
> 
> -- 
> Want to get a clue on IPv6 but don't know where to
> start? Try this:
> * Basics ->
>
http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html
> * Setup  ->
>
http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html
> Of course with your #1 IPv6 ready operating system
> -> http://www.NetBSD.org/


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com