From owner-freebsd-hackers Wed Nov 8 12:58:27 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (Postfix) with ESMTP id 921FA37B479 for ; Wed, 8 Nov 2000 12:58:22 -0800 (PST) Received: (from daemon@localhost) by smtp04.primenet.com (8.9.3/8.9.3) id NAA08954; Wed, 8 Nov 2000 13:54:55 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp04.primenet.com, id smtpdAAA7baGir; Wed Nov 8 13:54:41 2000 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id NAA26096; Wed, 8 Nov 2000 13:57:57 -0700 (MST) From: Terry Lambert Message-Id: <200011082057.NAA26096@usr08.primenet.com> Subject: Re: system call and SYSCALL macro To: flaw@vt.edu (flaw) Date: Wed, 8 Nov 2000 20:57:57 +0000 (GMT) Cc: rlaw@vt.edu (Raymond Law), tlambert@primenet.com (Terry Lambert), freebsd-hackers@FreeBSD.ORG (freebsd-hackers) In-Reply-To: <3A13684F@zathras.cc.vt.edu> from "flaw" at Nov 08, 2000 03:10:56 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I am not using kld to implement my system call. I am just using > the old way. > > But I tried using pointers also. But I am not getting the correct > returned values either... The correct return value is probably "-1", with the value of 'z' being undefined, for what you have now. If you are not KLD'in your system call, how are you informing the kernel of its existance? The normal way this is done is to modify /sys/kern/syscalls.master, e.g.: 180 STD NOHIDE { int my_call(int x, int y, int *z); } And building a new kernel, after making sure that syscalls.c is regenerated from syscalls.master, and that your .c file that implements "my_call" is included in the kernel compilation. Examine the sysent[] array created from syscalls.master during the build process (down in your kernel compile directory) to make sure that it was put in there; if it wasn't go back and try again until it is. Once you have built a kernel that has your entry in it, you will need to install it and boot off it (I suggest using the name "kernel.test" as the installed kernel name, so that if you screw up, your default kernel will still boot, and so you can ignore it at boot time, when you switch to KLDs). Really, you want to use KLDs for this. If you are adamant about not using KLDs, remember: don't bother even trying to boot your new kernel, if there isn't a "my_call" listed in syscalls.c or its function pointer is not in the sysent[] array. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message