insmod可以正常加载模块,rmmod时却报出Function not implemented,求助

zozowit 2008-03-28 02:34:01
我的内核是2.6.24,运行在arm的板子上
模块代码如下:
#include <linux/module.h> /* Needed by all modules */
#include <linux/init.h> /* Needed for init&exit macros */
static int mod_init_func(void)
{
/*code here*/
return 0;
}
static void mod_exit_func(void)
{
/*code here*/
}

module_init(mod_init_func);
module_exit(mod_exit_func);

insmod能正常使用,rmmod却报出Function not implemented

...全文
700 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
junxiu6 2008-12-12
  • 打赏
  • 举报
回复
谢谢。我也遇到这个问题了。也是那个选项没有选。为了表达谢意,我特意发了回复。希望我们的论坛求助的人都能象楼主一样,而非单单一句“问题已解决,感谢大家”。
helight 2008-04-22
  • 打赏
  • 举报
回复
呵呵!受教了!!
zozowit 2008-03-28
  • 打赏
  • 举报
回复
解决了,编译内核时没有把 84 CONFIG_MODULE_UNLOAD=y这项选上
zozowit 2008-03-28
  • 打赏
  • 举报
回复
x86下没有问题
pottichu 2008-03-28
  • 打赏
  • 举报
回复
http://blog.csdn.net/pottichu/archive/2007/11/19/1892245.aspx

另外建议你看一下 LDD3 下面是地址.
http://www.deansys.com/doc/ldd3/index.html

http://download.csdn.net/source/295919
zozowit 2008-03-28
  • 打赏
  • 举报
回复
见谅,请问x86上怎么编译模块呢
板子上编译命令如下:
#echo "obj-m :=hello.o" >; Makefile或直接修改Makefile
#make -C /home/zozowit/cross/linux-2.6.22.6_9_patch M=`pwd` modules
那么在pc上该怎么修改呢
pottichu 2008-03-28
  • 打赏
  • 举报
回复
X86 上呢? 试过没有 ?
zozowit 2008-03-28
  • 打赏
  • 举报
回复
谢谢楼上,但是不行,问题似乎不在这
pottichu 2008-03-28
  • 打赏
  • 举报
回复

/*
* $Id: hello.c,v 1.5 2004/10/26 03:32:21 corbet Exp $
*/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);



加上 MODULE_LICENSE("Dual BSD/GPL");
试试.

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧