[Ilugc] insmod in kernel 2.6?

  • From: red@xxxxxxxxxxxx (M S Vijaykumar)
  • Date: Tue, 6 Apr 2004 16:58:38 +0530

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>


static int __init myinit(void){
        printk("<1>Hello kernel!");
        return 0;
}

static void __exit mycleanup(void){
        printk("<1>Hello cleanup!");
}

module_init(myinit);
module_exit(mycleanup);


this is the program i compiled using...

gcc -O2 -c -DMODULE -D__KERNEL__ -I/usr/src/linux-2.6/include hellok.c

all is well till this place!

now when i do an insmod ...

$ insmod hellok.o

i get an error saying

"cannot insert module"

whats wrong? i have no clue, could anyone help?

-- 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The road of excess leads to the palace of wisdom
Prudence is a rich old ugly maid courted by incapacity

...Blake

Other related posts: