I am a newbie in FreeBSD. I installed FreeBSD-11.0-RELEASE-amd64 on VM. I want to add first new system call. I find this link.
I Did:
I added my system call to the end /kern/syscalls.master
Then I did
Next, I added the file to /sys/conf/files
Also, I added the system call to /kern/capabilities.conf
Finally, while in /usr/src/ I ran the command
And in this step I get:
Same error!
I Did:
cd /usr/src/sys/kern
ee mykern.c
Code:
#include <sys/sysproto.h>
#include <sys/proc.h>
#include <sys/types.h>
#include <sys/systm.h>
#ifndef _SYS_SYSPROTO_H_
struct myargs {
int k;
};
#endif
int func(struct thread *p, struct myargs *uap)
{
printf("Hello");
return (0);
}
I added my system call to the end /kern/syscalls.master
550 AUE_NULL STD { int func(int k);}
Then I did
cd /usr/src
sudo make -C /sys/kern/ sysent
Next, I added the file to /sys/conf/files
Code:
kern/mykern.c standard
Also, I added the system call to /kern/capabilities.conf
Code:
##
## Allow associating SHA1 key with user
##
func
Finally, while in /usr/src/ I ran the command
sudo make -j8 kernel
And in this step I get:
Code:
make don't know how to make kernel. Stop
make stopped in /usr/src
make buildkernel KERNCONF=MYKERNEL
Same error!
Last edited: