Hello Wold 模块
2012-10-12 21:07
211 查看
/***************20121012*********************/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
//特殊的宏,采用自由许可证 如果没有,内核在装载该模块时会产生抱怨
/*when use by downing*/
static int hello_init(void)
{
printk(KERN_ALERT "hello, world \n");
return 0;
}
/*use when remove*/
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world \n");
}
module_init(hello_init);
module_init(hello_exit);
/*后记*/
/*编写驱动程序退出时,必须撤出初始化函数所做的一切,这与应用程序的最大不同。否则,在系统重新引导之前某些东西就会残留在系统*/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
//特殊的宏,采用自由许可证 如果没有,内核在装载该模块时会产生抱怨
/*when use by downing*/
static int hello_init(void)
{
printk(KERN_ALERT "hello, world \n");
return 0;
}
/*use when remove*/
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world \n");
}
module_init(hello_init);
module_init(hello_exit);
/*后记*/
/*编写驱动程序退出时,必须撤出初始化函数所做的一切,这与应用程序的最大不同。否则,在系统重新引导之前某些东西就会残留在系统*/
相关文章推荐
- Struts2 Hello,Wold
- linux内核之旅---"hello world"模块
- linux设备驱动第一个模块hello,world
- Linux设备驱动程序学习(0)-Hello, world!模块
- 有点小激动啊,哈哈(Hello Wold!)
- Linux设备驱动开发详解-第4章(一)-hello模块编译过程
- android 加载 hello.ko模块
- Linux驱动学习(一)——简单的hello模块
- Linux驱动开发①--Linux基础及hello模块
- hello 内核模块
- Nginx_handler模块发开(hello模块结构解析)
- 驱动开发——hello模块
- 我的第一个内核模块——Hello,kernel
- nginx hello world模块编译运行的问题
- nginx模块开发入门:hello
- 解剖Nginx·模块开发篇(2)ngx_http_hello_world_module 模块基本结构定义
- hello 内核模块
- 模块编译hello
- Linux设备驱动程序学习(0)-Hello, world!模块
- 如何编译linux第一个模块 hellomod.ko