当前位置: 技术问答>linux和unix
加载模块时出现的错误信息,请高手来看看!!
来源: 互联网 发布时间:2015-07-16
本文导语: 加载模块时出现下面的错误信息: Warning: loading hello.o will taint the kernel: no license See http://www.tux.org/lkml/#export-tainted for information about tainted modules hello.o: init_module: Device or resource busy Hint: insmod errors can be...
加载模块时出现下面的错误信息:
Warning: loading hello.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
hello.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.
You may find more information in syslog or the output from dmesg
该模块代码是:
#define MODULE
#define __KERNEL__
#include "linux/kernel.h"
#include "linux/module.h"
#ifdef MODVERSIONS
#include "linux/modversions.h"
#endif
int init_module()
{
printk(" hello !n");
return 1;
}
int cleanup_module()
{
printk(" I will shut down myself in kernerl mod n");
return 0;
}
Warning: loading hello.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
hello.o: init_module: Device or resource busy
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.
You may find more information in syslog or the output from dmesg
该模块代码是:
#define MODULE
#define __KERNEL__
#include "linux/kernel.h"
#include "linux/module.h"
#ifdef MODVERSIONS
#include "linux/modversions.h"
#endif
int init_module()
{
printk(" hello !n");
return 1;
}
int cleanup_module()
{
printk(" I will shut down myself in kernerl mod n");
return 0;
}
|
加在int init_module一句之前
|
把 int init_module()
{
printk(" hello !n");
return 1;
}
中的return 1 改为return 0 就可以了
{
printk(" hello !n");
return 1;
}
中的return 1 改为return 0 就可以了