|
在fedora core1 kernel2.4.22-1.2174.ntpl下,实习《linux设备驱动程序》第二版的例子:
1.编辑hello.c
/* begin of hello.c */
#define MODULE
#include <linux/module.h>
int init_module(void) {printk("<1>Hello, world\n"); return 0;}
void cleanup_module(void) {printk("<1>Goodbye\n");}
/* end of hello.c */
2.编译
#gcc -c hello.c
这一步也OK
3.加载模块
#/sbin/insmod ./hello.o
这一步失败,提示:
./hello.o: kernel-module version mismatch
./hello.o was compiled for kernel version 2.4.20
while this kernel is version 2.4.22-1.2174.nptl.
书上说要处理版本控制的问题,但是我还是不知道怎么解决这个问题。请那位大侠指点一下?多谢了。 |
|