From owner-freebsd-hackers Wed Apr 15 13:01:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA25187 for freebsd-hackers-outgoing; Wed, 15 Apr 1998 13:01:04 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from shark.nas.nasa.gov (shark.nas.nasa.gov [129.99.34.41]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA25095 for ; Wed, 15 Apr 1998 20:00:35 GMT (envelope-from edavis@shark.nas.nasa.gov) Received: from shark.nas.nasa.gov (edavis@localhost) by shark.nas.nasa.gov (8.8.7/NAS8.8.7) with ESMTP id NAA28011; Wed, 15 Apr 1998 13:00:24 -0700 (PDT) Message-Id: <199804152000.NAA28011@shark.nas.nasa.gov> X-Mailer: exmh version 2.0.2 2/24/98 To: John Birrell cc: edavis@shark.nas.nasa.gov, freebsd-hackers@FreeBSD.ORG Subject: Re: still having problems adding system calls... In-reply-to: jb's message of Wed, 15 Apr 1998 16:28:36 +1000.<199804150628.QAA09427@cimlogic.com.au> Date: Wed, 15 Apr 1998 13:00:24 -0700 From: "Eric A. Davis" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 15 Apr 1998 16:28:36 +1000 (EST) John Birrell wrote >Eric A. Davis wrote: >> Now when I try to use any of the system calls my application will >> compile cleany but when run will core dump with a mesage saying bad >> system call message. Any ideas? Is there someplace where I can find >> documentation for the above procedures? > >Are you _sure_ that the kernel build includes your syscalls? >Sounds like they aren't getting built. > Yes. The functions are located in a new file sys/kern/vfs_fmon.c. Here is a sample definition of the fam_close() system call I added: #include #ifndef _SYS_SYSPROTO_H_ struct fmon_close_args { int fd; }; #endif int fam_close(p, uap, retval) struct proc *p; register struct fmon_close_args *uap; int *retval; { /* code here */ } The file vfs_fmon.c is compiled into the kernel. I saw it. ;-) vfs_fmon.c is listed in sys/conf/files and sys/conf/files.newconf. I recompile and boot with the new kernel but I still get a bad system call messages. Once again here are the steps I took in adding the new system calls: 1. added the needed definitions to sys/kern/syscalls.master #ifdef FMON 326 STD BSD { int fmon_open(void); } 327 STD BSD { int fmon_close(int fd); } 328 STD BSD { int fmon_monitor_file(char *path); } 329 STD BSD { int fmon_monitor_dir(char *path); } 330 STD BSD { int fmon_cancel_monitor(char *path); } #else 326 UNIMPL BSD nosys 327 UNIMPL BSD nosys 328 UNIMPL BSD nosys 329 UNIMPL BSD nosys 330 UNIMPL BSD nosys #endif the above system calls are located in there own file in sys/kern 2. executed sys/kern/makesyscalls.sh 3. compiled a new kernel and put in / (the kernel compiles cleanly) 4. copied sys/sys/syscall.h to /usr/include/sys/syscall.h sys/sys/syscall-hide.h to /usr/include/sys/syscall-hide.h sys/sys/sysproto.h to /usr/include/sys/sysproto.h 5. edited /usr/src/lib/libc/sys/Makefile.inc to include the above defs added the above defs to the end of the ASM define in Makefile.inc (i.e fmon_open.o fmon_close.o ...) 6. did a make obj, depend, all, and install in /usr/src/lib/libc doing a strings on the new libc shows the symbols for the new calls 7. rebooted -- Eric Allen Davis Network Engineer edavis@nas.nasa.gov NASA Ames Research Center Voice: (415)604-2543 NAS Systems Division Pager: (415)428-6931 http://www.nas.nasa.gov/~edavis To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message