- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
Link kopiert
6 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
You can also make a symlink to busybox so you can symply use rmmod:
# cd /bin# ln -sf busybox rmmod- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.

Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite