#include
#include
#include
#include
#include
static char *whom = "world";
static int howmany = 1;
//static int int_array[6];
//int narr;
MODULE_AUTHOR("moyin_lin@foxmail.com");
module_param(howmany, int, S_IRUGO);
module_param(whom, charp, S_IWUGO);
//module_param_array(int_array, int, &narr, S_IWUGO);
static int __init hello_init(void)
{
int i;
printk(KERN_INFO "hello_init\n");
//printk(KERN_ALERT "narr: %d\n", narr);
for(i=0;i<6;i++){
printk(KERN_ALERT "%dHello %s\n", i, whom);
}
return 0;
}
static void __init hello_exit(void)
{
printk(KERN_INFO "hello_exit\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("Dual BSD/GPL");
//insmod hello.ko howmany=5 whom="Students"
错误如下:
g2pez16m 于 2012-07-11 17:00:39发表:
谢谢你啦,你的总结太全啦
墨lgq 于 2012-07-11 15:35:58发表:
顶起
墨lgq 于 2012-07-11 15:35:49发表:
顶