加载不成功
static long a = 1;static long b = 1;
static int AddOrSub =1;
static int test_init(void)
{
long result=0;
printk(KERN_ALERT "test init\n");
if(1==AddOrSub)
{
result=add_integer(a, b);
}
else
{
result=sub_integer(a, b);
}
printk(KERN_ALERT "The %s result is %ld",AddOrSub==1?"Add":"Sub",result);
return 0;
}
static void test_exit(void)
{
printk(KERN_ALERT "test exit\n");
}
module_init(test_init);
module_exit(test_exit);
module_param(a, long, S_IRUGO);
module_param(b, long, S_IRUGO);
module_param(AddOrSub, int, S_IRUGO);
错误提示
16052.450101] test: no symbol version for sub_integer
test: Unknown symbol sub_integer (err -22) sub_integer在哪定义的,没包括进来吧 回复 2# EZWORD
在另一个模块里面,那个加载成功 不知道你怎么处理的,看样子是没有找到,论坛上有例子,自己找找吧。 另一个模块不知道你有没有export 看看你包含sub_initer()的那个driver文件中有没有export, EXPORT_SYMBOL(sub_initer),而且包含sub_initer的驱动要先于你当前的这个驱动加载 回复 1# thb303663990
在你的另外一个模块中EXPORT_SYSMBOL(sub_integer); 把另一个模块生成的Module.symvers文件复制到当前目录下,重新编译本模块,再加载试试
页:
[1]