A simple new system call in FreeBSD-11.0-RELEASE-amd64

旧街凉风 提交于 2019-12-11 06:43:15

问题


I am a newbie in FreeBSD. I installed FreeBSD-11.0-RELEASE-amd64 on VMware. I want to add first new system call. I find this link.

I Did:

cd /usr/src/sys/kern

ee mykern.c

#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

 kern/mykern.c       standard

Also, I added the system call to /kern/capabilities.conf

    ##
    ## 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:

make don't know how to make kernel. Stop

make stopped in /usr/src

回答1:


Check that both Makefile and Makefile.inc1 exist in /usr/src. The latter is actually where the buildkernel target is defined. Verify that that target actually exists in that file.



来源:https://stackoverflow.com/questions/42051654/a-simple-new-system-call-in-freebsd-11-0-release-amd64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!