Advertisement
RobertBerger

hello-kernel

Nov 22nd, 2021
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. / SPDX-License-Identifier: GPL-2.0
  2.  
  3. #include <linux/module.h> /* for all modules */
  4. #include <linux/init.h> /* for entry/exit macros */
  5. #include <linux/kernel.h> /* for printk priority macros */
  6.  
  7. static int __init hello_init(void)
  8. {
  9. pr_info("Hello Kernel Init\n");
  10. return 0;
  11. }
  12.  
  13. static void __exit hello_exit(void)
  14. {
  15. pr_info("Hello Kernel Exit\n");
  16. }
  17.  
  18. module_init(hello_init);
  19. module_exit(hello_exit);
  20.  
  21. MODULE_AUTHOR("Robert Berger");
  22. MODULE_LICENSE("Dual BSD/GPL"); /* we don't wanna taint the kernel */
  23. MODULE_VERSION("1:1.0");
  24. MODULE_DESCRIPTION("Hello Kernel.");
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement