红联Linux门户
Linux帮助

module_param 出错!不明白!求助

发布时间:2012-07-10 21:14:55来源:红联作者:墨lgq
#include
#include
#include /* Optional, to include module_param() macros */
#include /* Optional, to include prink() prototype */
#include /* Optional, to include module_init() macros */
#include /* Optional, to include S_IRUSR ... */

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"

错误如下:
文章评论

共有 3 条评论

  1. g2pez16m 于 2012-07-11 17:00:39发表:

    谢谢你啦,你的总结太全啦

  2. 墨lgq 于 2012-07-11 15:35:58发表:

    顶起

  3. 墨lgq 于 2012-07-11 15:35:49发表: