#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
int __init hello_init(void) //模塊初始化函數,一加載驅動模塊就會執行的函數
{
printk("hello init\n"); //pirintk打印,有打印級別可以設置,也可以在內核中設置
return 0;
}
void __exit hello_exit(void) //模塊退出時執行的函數
{
printk("hello exit\n");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");