Õâ¸öÊÇʲôÔÒò°¡?
¸ÕѧLinuxϵÄÇý¶¯¿ª·¢,°Ñ¡¶LinuxÉ豸Çý¶¯³ÌÐò¡·ÖеÄÄǸöhelloÄ£¿éÄÃÀ´Õհᣬ½á¹û²»ÐУ¡helloÔ´³ÌÐòÈçÏ£º
#define MODULE
#include <linux/version.h>
#include <linux/module.h>
int init_module(void){
printk("<1>Hello,world\n");
return 0;
}
void cleanup_module(void){
printk("<1>Goodbye cruel world\n");
}
È»ºó±àÒëÖ´ÐУº
[root@localhost root]#gcc -c hello.c
/gxqing/hello.c:12:2: warning: no newline at end of file
[root@localhost root]# insmod hello.o
hello.o: kernel-module version mismatch
hello.o was compiled for kernel version 2.4.9-9
while this kernel is version 2.4.18-14.
×¢£ºÎÒµÄÄÚºËÊÇrh8µÄ2.4.18-14
²»Ã÷°×Ëüָʲô°æ±¾²»Æ¥Å䣿
ÇëÖ¸½Ì,3X
:confused:
Ò³:
[1]