- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
linux driver : problem with rmmod
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-28-2011 10:55 PM
hi everybody
I am getting started with linux driver development and I want to test how to insert a driver into linux kernel. I've built and run the linux kernel on MicroBlaze on my custom spartan3e board and every thing works fine.
my driver is so simple :
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
MODULE_LICENSE("BSD/GPL");
static int hello_init(void) {
printk("KERN_INFO "Hello : init is working good!");
return 0;
}
static void hello_exit(void) {
printk("<KERN_INFO "Hello : exit is working good!");
}
module_init(hello_init);
module_exit(hello_exit);
after compiling the driver I insert it using insmod and it works fine. but then I cannot remove it
# rmmod hello
rmmod: chdir(/lib/modules): No such file or directory
Am I using rmmod correctly?
I would appreciate any suggestions. thanks in advance.
Solved! Go to Solution.
Re: linux driver : problem with rmmod
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-30-2011 11:44 PM
Please do "lsmod" to check if the module was really inserted or not.
Regards
Madhubala
Re: linux driver : problem with rmmod
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-31-2011 12:07 AM
yes, it has inserted correctly! it allocates major and minor numbers too!
now, what else?
Re: linux driver : problem with rmmod
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-03-2011 01:01 AM
Hi ,
The solution to this problem is please create the directory /lib/modules and then /lib/modules/2.6.39
rmmod is looking for this and since its not finding its throwing the error.
Regards
Madhubala
Re: linux driver : problem with rmmod
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-05-2011 12:46 AM
thank you
It works :)))











