Date: Wed, 15 Apr 1998 13:00:24 -0700 From: "Eric A. Davis" <edavis@nas.nasa.gov> To: John Birrell <jb@cimlogic.com.au> Cc: edavis@shark.nas.nasa.gov, freebsd-hackers@FreeBSD.ORG Subject: Re: still having problems adding system calls... Message-ID: <199804152000.NAA28011@shark.nas.nasa.gov> In-Reply-To: jb's message of Wed, 15 Apr 1998 16:28:36 %2B1000.<199804150628.QAA09427@cimlogic.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sysproto.h>
#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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804152000.NAA28011>
