这是我所做的。
在路径./linux-5.7下
创建文件夹hello
进入hello文件夹
使用vim编辑器打开hello.c文件
#include <linux/kernel.h>
asmlinkage long sys_hello(void) {
printk ("\n\nHello Kernel\n\n");
return 0;
}
vim Makefile
obj-y := hello.o
vim arch/x86/entry/syscalls/syscall_64.tbl
439 common hello sys_hello
vim include/linux/syscalls.h
asmlinkage long sys_hello(void);
编译内核
make -j4
出错了...
ld: arch/x86/entry/syscall_64.o:(.rodata+0xdb8): undefined reference to `__x64_sys_hello'
make: *** [Makefile:1113: vmlinux] Error 1
这里有什么问题...
...
...