where is hello world?
I am doing some example code for modules:
/*
* hello-3.c - Illustrating the __init, __initdata and __exit macros.
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/init.h> /* Needed for the macros */
static int hello3_data __initdata = 3;
static int __init hello_3_init(void)
{
printk(KERN_INFO "Hello, world %d\n", hello3_data);
return 0;
}
static void __exit hello_3_exit(void)
{
printk(KERN_INFO "Goodbye, world 3\n");
}
module_init(hello_3_init);
module_exit(hello_3_exit);
and I add this module in kernel:
mei@ubuntu:~/module$ sudo insmod hello-3.ko
mei@ubuntu:~/module$ cat /proc/modules |grep hello
hello_3 12395 0 - Live 0x00000000 (P)
mei@ubuntu:~/module$ sudo rmmod hello-3.ko
mei@ubuntu:~/module$
no "Hello, world 3" print out.
no "Goodbye, world 3" print out.
and I can't find KERN_INFO in kernel.h
|