【问题标题】:A simple new system call in FreeBSD-11.0-RELEASE-amd64FreeBSD-11.0-RELEASE-amd64 中一个简单的新系统调用
【发布时间】:2017-06-22 10:37:23
【问题描述】:

我是 FreeBSD 的新手。我在 VMware 上安装了 FreeBSD-11.0-RELEASE-amd64。我想添加第一个新的系统调用。我找到了这个link

我做到了:

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);
}

我在末尾添加了我的系统调用 /kern/syscalls.master

550      AUE_NULL      STD { int func(int k);}

然后我做了

cd /usr/src

sudo make -C /sys/kern/sysent

接下来,我将文件添加到 /sys/conf/files

 kern/mykern.c       standard

另外,我在 /kern/capabilities.conf 中添加了系统调用

    ##
    ## Allow associating SHA1 key with user
    ##
    func

最后,在 /usr/src/ 中我运行了命令

sudo make -j8 内核

在这一步我得到:

make don't know how to make kernel. Stop

make stopped in /usr/src

【问题讨论】:

标签: system-calls freebsd


【解决方案1】:

检查MakefileMakefile.inc1 是否都存在于/usr/src 中。后者实际上是定义buildkernel 目标的地方。验证该目标是否确实存在于该文件中。

【讨论】:

    猜你喜欢
    • 2017-06-30
    • 1970-01-01
    • 2016-06-02
    • 2016-05-31
    • 1970-01-01
    • 2011-04-23
    • 1970-01-01
    • 2017-07-03
    • 1970-01-01
    相关资源
    最近更新 更多