#include /* Needed by all modules */ #include /* Needed for KERN_ALERT */ #include /* Needed for the macros */ MODULE_LICENSE("GPL"); /* Declare what kind of code we want from the header files */ //#define __KERNEL__ /* We're part of the kernel */ //#define MODULE /* Not a permanent part, though. */ /* Standard headers for LKMs */ //#include #include static int carl_data __initdata = 3; static int __init carl_init(void) { printk(KERN_ALERT "Hello, world %d\n", carl_data); return 0; } static void __exit carl_exit(void) { printk(KERN_ALERT "Goodbye, world\n"); } module_init(carl_init); module_exit(carl_exit);