user7194905
user7194905

Reputation: 217

A simple new system call in 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.

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

Upvotes: 1

Views: 187

Answers (1)

Roland Smith
Roland Smith

Reputation: 43495

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.

Upvotes: 1

Related Questions