hello friends..
i am trying to run this simple hello.c program... and when i use isnmod to insert the module.. i dont get the hello message.. also the same problem exists with rmmod.. wht do i do... plz suggest..
define MODULE
#include
#include
int init_module()
{
printk("<1> hello\n" );
return 0;
}
void cleanup_module()
{
printk("<1> bye");
}
~
Read the Linux Device Driver book
You didn't mention what kernel you're using, but assuming it is 2.6, try checking the Linux Device Drivers book out. The latest version was written with 2.6 in mind, and chapter two has a 'hello world' example to lead off.
check the log
I guess you are checking standard output for your printks. Most probably, your messages won't get printed to stdout if you use the default priority. Check /var/log/messages or /var/log/all for your messages. If you just want to see your messages on the standard output, try printk(KERN_CRIT"your message\n"). However, it is a very bad habit to print unnecessary messages with such high priority.
dmesg
u getting any error on insmod?
if not, run lsmod and check if your module's present there (before rmmod)
if its there..
just run dmesg
n chk
driver tutorial
This is a link to a great step by step tutorial that will show you the way.
http://www.kroah.com/linux/talks/ols_2005_driver_tutorial/
How are things coming along?
How are things coming along? Did you succeed in the end?
Oh so DES