Ubuntu 12.04 LTS sets up the kernel tree. Its system is ubuntu 12.04 LTS. The specific steps are as follows: (1) Check the kernel version of the system. The command is uname-r, output Information: ** 3.8.0-29-generic ** indicates that the kernel version is 3.8.0. (2) In the directory/usr/src directory issued the current file: ** linux-headers-3.8.0-29 linux-headers-3.8.0-29-generic ** from the file name can be seen that the two directories only have the header file of the Code. (3) test whether the helloworld module can be dynamically loaded only with header files (for the generation method, refer to linux device driver development). (4) hello. c file content: # include <linux/init. h> # include <linux/module. h> MODULE_LICENSE ("Dual BSD/GPL"); static int hello_init (void) {printk (KERN_EMERG "Hello world \ n"); return 0;} static int hello_exit (void) {printk (KERN_EMERG "Goodbye, hello world! \ N "); return 0;} module_init (hello_init); module_exit (hello_exit); Makefile file content: ifneq ($ (KERNELRELEASE),) obj-m: = hello. o else KDIR: =/lib/modules/3.8.0-29-generic/build all: make-C $ (KDIR) M = $ (PWD) modules clean: rm-f *. ko *. o *. mod *. mod. c * sysmvers endif (5) Run: sudo insmod hello. ko sudo rmmod hello. ko terminal does not respond, but the output information is found in/var/log/syslog: The module has been successfully loaded by the kernel.