Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Mar 1999 00:29:21 -0500 (EST)
From:      Dan Seguin <dseg@texar.com>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: syscalls
Message-ID:  <Pine.BSF.3.91.990324000757.1714B-100000@pak.texar.com>
In-Reply-To: <Pine.BSF.4.05.9903232303410.78570-100000@herring.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Tue, 23 Mar 1999, Doug Rabson wrote:

> 
> Syscalls are the interface from user code to kernel code.  The code in a
> KLD is kernel code and as such should not (can't) use syscalls to obtain
> kernel services. In many cases, it is possible to call the underlying
> kernel implementation for these services directly using the internal
> kernel apis.  For most of these apis, the only documentation is the kernel
> sources.
> 
> --
> Doug Rabson				Mail:  dfr@nlsystems.com
> Nonlinear Systems Ltd.			Phone: +44 181 442 9037
> 

Thanks for the response. There's the rub. I thought the syscall redirector
was used internally. I am aware of kernel/userland differences (just not
how in *BSD).The only real problem I have (and I haven't spent enough time
yet looking into this) is setting up a proc structure to pass to the
system call, i.e. something like: 

 returnValue = (sysent[SYS_open].sy_call)(p, uap);

where p is struct proc and uap is (in this case) struct open_args (from 
<sys/protosys.h>) passed to me as a void *. I'm not sure about the above 
syntax, I usually just use return([system call here]).

 The above looks natural to me, being a Schemer. (I know, I know, forget
about Scheme, this is C, just a little sidebar d;-). I'm I way off base here
with the proc stuff? Or the question I really need answered, the one that
would cut through all of this is: how do I pass parameters to system calls
that DON'T originate from userland? Is there something that I need to do 
that is generic for all calls followed (I would expect) by the actual 
parametres to the call?

Thanks for all your answers and especially for your time, gentlemen. (Er, 
and ladies too).

Dan Seguin




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.990324000757.1714B-100000>