This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

kernel modules


Hello,
	
I am trying to build a kernel module that is:-

	/*module name is "hello.c"*/

      #include <linux/module.h>// Needed by all
modules 
      #include <linux/kernel.h>  
      
      
       int init_module(void)
       {
          printk("<1>Hello world 1.\n");
      
          // A non 0 return means init_module failed; 
         
                          module can't be loaded.
         return 0;
      }
     
      void cleanup_module(void)
      {
        printk("<1>Goodbye world 1.\n");
      }	

And then compiling it with the command:-
		gcc -c hello.c

it get successfully compiled and then I am trying to
insert it with command
		insmod ./hello.o

An error as followed is arived how can I remove this
error:-

error: ./hell.o: couldn't find the kernel version the
module was compiled for


	Thanx					Rinku Rathore




		
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]