Ä£¿éÎļþ
#include
#include
static int hello_init()
{
printk(KERN_ALERT "HELLO\n");
return 0;
}
static int hello_exit()
{
printk(KERN_ALERT "GOOD BYE\n");
return 0;
}
module_init(hello_init);
module_exit(hello_exit);
makefileÎļþ
ifeq ($(KERNELRELEASE),)
KD ?= /usr/src/linux-headers-2.6.35-22-gernic
PWD ?= $(shell pwd)
modules:
make -C $(KD) M= $(PWD) modules
modules_install:
make -C $(KD) M= $(PWD) modules_install
clean:
rm *.o
else
obj-m:=hello.o
endif
´íÎóÐÅϢΪ
makefile£º4£º***command commence before first target.stop
ÇëÎÊÕâÊÇΪʲô£¬ÎÒÊÇÕÕ×ÅÊé´òÉÏÀ´µÄ°¡£¬¶øÇÒҲû·¢ÏÖʲô´í¡¡


Ubuntu_LW ÓÚ 2013-01-21 19:14:05·¢±í:
¿´²»¶®
haiyanmao_linux ÓÚ 2013-01-18 10:07:35·¢±í:
??ʼ?£¬Ã²ËÆÒ²²»¶®
ÓÚ 2013-01-10 14:30:31·¢±í:
modules:
make -C $(KD) M= $(PWD) modules
modules_install:
make -C $(KD) M= $(PWD) modules_install
ÕâÑù
ÓÚ 2013-01-10 14:29:13·¢±í:
ÔÚmakefileÃüÁîÏÂÒªÓмÓÉÏËûtab¼ü
tonylee2012 ÓÚ 2012-07-16 17:01:45·¢±í:
¸Õ¿ªÊ¼Ñ§
×ÏÃÎ ÓÚ 2012-07-16 12:51:21·¢±í:
ÄÑ
Junyi ÓÚ 2012-07-16 11:30:18·¢±í:
Õâlinux»ù´¡ºÃ²»¼òµ¥