|
我用的是FC3,2.6.10内核
写的驱动如下:
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
static int init_module()
{
printk("Hello,World!\n");
return 0;
}
static void cleanup_module()
{
printk("Bye!\n");
}
保存为test.c
编译: gcc -c test.c
之后用命令: insmod test.o , 报错,怎么也解决不了,报错信息如下:
insmod: error inserting 'test.o': -1 Invalid module format
请问这是怎么一回事呢?
或者谁能给个2.6.10内核下已经成功实现的类似的简单驱动程序代码?
谢谢 |
|