About module?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: About module?

Hi!
          I have a puzzle about the module.
          I have write a simple code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /*
 *      Hello world module.
 */
#include <linux/module.h>

#if defined(CONFIG_SMP)
#define __SMP__
#endif

#if defined(CONFIG_MODVERSIONS)
#define MODVERSIONS
#include <linux/modversions.h>
#endif
            
#include <linux/kernel.h>

int time;
int printtime( )
{
        return 0;
}        

int init_module(void)
{       
        printk(KERN_DEBUG "Hello, kernel!\n");
        return 0;
}
            
void cleanup_module(void)
{
        printk(KERN_DEBUG "Good-bye, kernel!\n");
}  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I compiled it, get hello.o and copy it to hello1.o.
then $insmod hello.o
         $insmod hello1.o
then $lsmod
I found that:
 the hello used by hello1,and the hello1 is "unused'.
why?
                

Best Regards
                         ypxin
       


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux