FreeBSD-11.0-RELEASE-amd64中的一个简单的新系统调用 [英] A simple new system call in FreeBSD-11.0-RELEASE-amd64

查看:74
本文介绍了FreeBSD-11.0-RELEASE-amd64中的一个简单的新系统调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

我做了:

cd/usr/src/sys/kern

cd /usr/src/sys/kern

ee mykern.c

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的末尾

I added my system call to the end /kern/syscalls.master

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

然后我做了

cd/usr/src

cd /usr/src

sudo make -C/sys/kern/sysent

sudo make -C /sys/kern/ sysent

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

Next, I added the file to /sys/conf/files

 kern/mykern.c       standard

我还将系统调用添加到/kern/capabilities.conf

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

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

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

Finally, while in /usr/src/ I ran the command

sudo make -j8内核

sudo make -j8 kernel

在这一步中,我得到:

make don't know how to make kernel. Stop

make stopped in /usr/src

推荐答案

检查/usr/src中是否同时存在MakefileMakefile.inc1.后者实际上是定义buildkernel目标的位置.验证该文件中确实存在目标.

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.

这篇关于FreeBSD-11.0-RELEASE-amd64中的一个简单的新系统调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆