// hello.ko: the smallest kernel module, for the QuantaPrism Code "Kernel" lessons. #include #include #include MODULE_LICENSE("GPL"); MODULE_AUTHOR("QuantaPrism Code"); MODULE_DESCRIPTION("Says hello to the kernel log"); static char *name = "friend"; module_param(name, charp, 0444); MODULE_PARM_DESC(name, "who to greet"); static int __init hello_init(void) { pr_info("hello: Hello, %s! Greetings from inside the kernel.\n", name); return 0; } static void __exit hello_exit(void) { pr_info("hello: Goodbye, %s! The module is leaving.\n", name); } module_init(hello_init); module_exit(hello_exit);