#include #include #include MODULE_DESCRIPTION("Memory and string module"); MODULE_AUTHOR("so"); MODULE_LICENSE("GPL"); static char* my_string; static int my_hello_init(void) { my_string = kmalloc(80, GFP_KERNEL); memset(my_string, 0x00, 80); strcat(my_string, "student"); printk(KERN_WARNING "Hello %s!\n", my_string); return 0; } static void hello_exit(void) { printk(KERN_WARNING "Goodby %s!\n", my_string); kfree(my_string); } module_init(my_hello_init); module_exit(hello_exit);