Subject: Adding a New System Call
To: 'NetBSD Mailing List' <tech-kern@netbsd.org>
From: Santanu Mazumdar <santanum@delhi.tcs.co.in>
List: tech-kern
Date: 12/19/2000 19:00:04
Hi,
Need your help please !!
I am trying to add two new system calls (getMacAddrList, setMacAddrList) =
in NetBSD 1.4.1. I have carried out the following steps:
Step1. Added the following entry in the file =
/usr/src/sys/kern/syscalls.master
151 STD {int sys_getMacAddrList(void);}
152 STD {int sys_setMacAddrList(int myAddr);}
Step2. Executed make /usr/src/sys/kern/ init_sysent.c
Step3. Copied the new syscall.h and syscallargs.h headers from =
/usr/src/sys/sys to /usr/include/sys.
Step4. I believe I have to add the syscall stub for this two methods to =
/usr/src/lib/libc/sys/Makefile.inc. However there are no such =
directories as /usr/src/lib/libc. Where should I add the stub code ?
Step5. Where should I add the headers and the C files for the above two =
calls. Will the implementation file (.C file) names remain the same as =
the function name or they are prefixed by anything ?
Can you provide an example how the source (getMacAddrList.c) and header =
(getMacAddrList.h) will look like ?
After this I believe that I need to rebuilt the kernel and reboot.
Please let me know if I am wrong anywhere.
Many Thanks in Advance-
Santanu Mazumdar.