Why hello kernel module didn't output anything?

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

 




Here is my simple question:
Compile following hello.c with gcc -c hello.c -Wall, then insmod hello.o 
-o mytest
The /proc/modules shows  "mytest                   528   0 (unused)"
But how the module will be called as it suppose to send "Hello, world " 
to either xterm or konsole? 

Thanks,
-Hong


#define __KERNEL__         /* We're part of the kernel */
#define MODULE             /* Not a permanent part, though. */

/* #include <linux/modversions.h>  */
#include <linux/module.h>

int init_module()
{
   printk("Hello, world - this is the kernel speaking\n");
 
  return 0;
}

void cleanup_module()
{
  printk("Short is the life of an LKM\n");
}

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[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