博客:http://blog.csdn.net/muyang_ren
/*************************************************************************
> File Name: hello.c
> Author: 梁惠涌
> Addr:
> Created Time: 2015年05月15日 星期五 20时16分57秒
************************************************************************/
//1 头文件
#include<linux/init.h>
#include<linux/module.h>
//2 模块加载
static int __init hello_init(){
printk(KERN_INFO"hello is module!\n");
return 0;
}
//3 模块卸载
static void __exit hello_exit(){
printk(KERN_INFO"hello is unmod!\n");
}
//4 模块许可声明
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("梁惠涌");
MODULE_VERSION("V2.0");
MODULE_DESCRIPTION("\n------------------------------------\n"
"| this is a module! |\n"
"| |\n"
"------------------------------------\n");