- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi!
I have a module with following source code:#include <linux/kernel.h># include <linux/init.h># include <linux/module.h>
int __init hello_init(void)
{
printk("----------->Hello, world\n");
return 0;
}
static void __exit hello_exit(void)
{
printk("------------>Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("testing module");
MODULE_AUTHOR("LS");
When I use the insmod command it works fine hello.ko# busybox insmod hello.ko ----------->hello, world# But when I use the rmmod command something going wrong: # busybox rmmod hello.ko
rmmod: hello.ko: function not implemented# What could be the reason? Bye, Lothar.
コピーされたリンク
6 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
a) Make sure, that you have the function rmmod.
http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/cool.gif Make sure you have enabled Module unloading in your kernel. This feature isn't enabled by default. you will have to enable this function in your kernel configuration, rebuild your kernel and upload it.- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi
The function to use is # busybox rmmod hello Thus, without the extention .ko. And Yea, the function isn't enabled in the kernel by default. Good advice Helmchen Rual- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
You can also make a symlink to busybox so you can symply use rmmod:
# cd /bin# ln -sf busybox rmmod- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi!
Ok, I enabled unloading moduls in kernel configuration. But the following happens: # busybox rmmod hellormmod: hello: device or resource busy I can't imagine what could be the reason for this simple module beeing busy? Bye, Lothar.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Lothar,
I'm asking more than directing. Your init function is not static. Does the kernel lose reference to this module since it is not declaired as static function? Your error says device or resource busy, perhaps the kernel is unsure if the device is in use because it has lost reference to this modue????? Again, I'm asking more than I'm suggesting. Doug- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Doug!
You are right. With a static declaration of the init function command rmmod works:-) # busybox rmmod hello------------>goodbye, cruel world# Thank you, Lothar.
