|
gcc -Wall -DMODULE -D__KERNEL__ -DLinux -c start.c
In file included from /usr/include/linux/prefetch.h:13,
from /usr/include/linux/list.h:6,
from /usr/include/linux/module.h:12,
from start.c:2:
/usr/include/asm/processor.h:56: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
/usr/include/asm/processor.h:56: error: requested alignment is not a constant
make: *** [start.o] Error 1
这个在rh9上编译是好的。
是我的linux source安装的有问题吗?
代码如下
#include <linux/kernel.h>
#include <linux/module.h>
#if CONFIG_MODVERSION == 1
#define MODVERSION
#include <linux/modversion.h>
#endif
int init_module()
{
printk("Hello, world - this is the kernel speaking\n");
return 0;
} |
|