Forum Moderators: bakedjake
// Start/Init function
static int hello_init(void) {
printk("<1>Hello world!\n"); // A logging mechanism for kernel
return 0; // A non-zero return means hello_init failed; the module can't be loaded.
}
// End/Cleanup function
static void hello_exit(void) {
printk("<1>Goodbye world!\n");
}
module_init(hello_init);
module_exit(hello_exit);
I got the following message when I have tried to install into kernel using insmod::
insmod -f ./hello.o
insmod: error inserting './hello.o': -1 Invalid module format