Reputation: 43
I write a module,and want add it to kernel.It will print a world when i insmod the module.but it will not...
the module as:
#include <linux/module.h>
#include <linux/init.h>
static int __init hello_init()
{
printk(KERN_EMERG"Hello World!\n");
return 0;
}
static void __exit hello_exit()
{
printk("<6>hello exit\n");
}
module_init(hello_init);
module_exit(hello_exit);
why the "Hello World!\n" dose not print when i load the module?? Are there some one meet the question? thinks for your help....
Upvotes: 0
Views: 612
Reputation: 328840
Since you didn't get a compile/linking error and insmod
/modprobe
didn't complain about missing symbols, there are two reasons why this can happen:
printk()
dmesg | tail
Upvotes: 1