#include
#include
#include
static int hello_2_init(void)
{
printk(KERN_ALERT "Hello, world 2\n");
return 0;
}
static void hello_2_exit(void)
{
printk(KERN_ALERT "Goodbye, world 2\n");
}
module_init(hello_2_init);
module_exit(hello_2_exit);
makefile文件如下(我认为这里不可能出现错误):
obj-m := irq.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIR=$(PWD) modules
终端中输入make后总是出现如下编译错误:
make -C /lib/modules/2.6.28-11-generic/build SUBDIR=/home/ssd modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic'
rm: cannot remove `include/config/kernel.release': Permission denied
make[1]: *** [include/config/kernel.release] Error 1
make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic'
make: *** [default] Error 2
中英文资料差了一大堆没发现解答,求助高手们。
环境:ubuntu 9.04
于 2013-07-19 18:21:40发表:
将SUBDIR 修改为M