hello-1.c 410 B

12345678910111213141516171819202122
  1. /*
  2. * hello-1.c - The simplest kernel module.
  3. */
  4. #include <linux/kernel.h> /* Needed for KERN_INFO */
  5. #include <linux/module.h> /* Needed by all modules */
  6. int init_module(void)
  7. {
  8. pr_info("Hello world 1.\n");
  9. /*
  10. * A non 0 return means init_module failed; module can't be loaded.
  11. */
  12. return 0;
  13. }
  14. void cleanup_module(void)
  15. {
  16. pr_info("Goodbye world 1.\n");
  17. }
  18. MODULE_LICENSE("GPL");