This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Module compilation Linux ===== Install dependencies: <code> yum install gcc kernel-devel </code> Create module source file: <code> /* * goku.c - The simplest kernel module. */ #include <linux/module.h> /* Needed by all modules */ #include <linux/kernel.h> /* Needed for KERN_INFO */ MODULE_LICENSE("GPL"); int init_module(void) { printk(KERN_INFO "Dragon Ball GT...\n"); /* * A non 0 return means init_module failed; module can't be loaded. */ return 0; } void cleanup_module(void) { printk(KERN_INFO "Goku SSJ4 es la mejor transformacion...\n"); } </code> Create the make file: <code> obj-m += goku.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean </code> Compile the module: <code> make </code> Test your module: <code> lsmod|grep goku sudo insmod goku.ko lsmod|grep goku </code> Great!... but what does? Check: <code> sudo dmesg </code> You will see in the output: <code> [ 7347.651869] Dragon Ball GT... </code> Unload the module: <code> sudo rmmod hello.ko lsmod|grep hello </code> Check: <code> sudo dmesg </code> You will see in the output: <code> [ 7459.206258] Goku SSJ4 es la mejor transformacion... </code> ==== Sources ==== * https://tldp.org/LDP/lkmpg/2.6/html/x121.html * https://github.com/volatilityfoundation/volatility/pull/813/commits/220f9df1e636f5772ec0f0cd1702ce4e6cfa9849