From owner-freebsd-hackers Tue Mar 23 21:29:41 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from pak.texar.com (pak.texar.com [207.112.49.1]) by hub.freebsd.org (Postfix) with ESMTP id 77A121508C for ; Tue, 23 Mar 1999 21:29:35 -0800 (PST) (envelope-from dseg@pak.texar.com) Received: (from dseg@localhost) by pak.texar.com (8.8.8/8.8.3) id AAA01768; Wed, 24 Mar 1999 00:29:21 -0500 (EST) Date: Wed, 24 Mar 1999 00:29:21 -0500 (EST) From: Dan Seguin To: Doug Rabson Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: syscalls In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 ) 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