#include<linux/init.h>
#include<linux/module.h>//MODULE_LICNESE("Dual BSD/GPL");static int hello_init(void){ printk(KERN_ALERT " hello fish!\n");return 0;}static void hello_exit(void){ printk(KERN_ALERT " bye fish!\n");}module_init(hello_init);module_exit(hello_exit);
makefile:
path= /lib/modules/$(shell uname -r)/build
PWD= $(shell pwd)obj-m:=hello.odefault: make -C $(path) M=$(PWD) modules