嘿伙计们,我试图在ubuntu 12.04.1中进行系统调用。我遇到了编译我的hello.c文件的问题
#include <linux/kernel.h>
asmlinkage long sys_hello(void) {
printk("hello world\n");
return 0;
}
我相信问题出在我的Makefile中,但我仍然是编写Makefile的初学者。
hello.o: hello.c
gcc -c -o hello.o hello.c
obj-y := hello.o
我知道我必须添加obj-y:= hello.o部分,以便它可以编译并包含在内核中。当我运行make时,我收到此错误:
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'long'
我不完全确定要做什么,而且我被卡住了。我非常感谢任何帮助。