我的helloworld模块
来源:互联网 发布:厦门比较好的公司 知乎 编辑:程序博客网 时间:2024/05/01 03:52
//我的hello.c,makefile请从我的资源中下载
/*第一个驱动程序hello world*/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");//告诉内核,该模块才用了自由许可证,否则转载时会遭到内核抱怨
static int hello_init(void)//装载时运行
{
printk(KERN_ALERT "hello world! This is a first drivers of WYJ./n");//printk()内核态的输出函数;KERN_ALERT,显示的优先级
return 0;
}
static void hello_exit(void)//卸载时运行
{
printk(KERN_ALERT "Goodbye,cruel world. My first drivers is over!/n");
}
module_init(hello_init); //指定装载时调用的函数
module_exit(hello_exit); //指定卸载时调用的函数
//存在问题:printk的字符串中若中间有'/n'则只能显示一半.
/*第一个驱动程序hello world*/
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");//告诉内核,该模块才用了自由许可证,否则转载时会遭到内核抱怨
static int hello_init(void)//装载时运行
{
printk(KERN_ALERT "hello world! This is a first drivers of WYJ./n");//printk()内核态的输出函数;KERN_ALERT,显示的优先级
return 0;
}
static void hello_exit(void)//卸载时运行
{
printk(KERN_ALERT "Goodbye,cruel world. My first drivers is over!/n");
}
module_init(hello_init); //指定装载时调用的函数
module_exit(hello_exit); //指定卸载时调用的函数
//存在问题:printk的字符串中若中间有'/n'则只能显示一半.
- 我的helloworld模块
- nginx的helloworld模块的helloworld
- 我的helloworld
- Java-我的HelloWorld
- Helloworld内核模块的开发
- helloworld模块
- helloworld模块
- HelloWorld 模块
- 我的第一个HelloWorld
- 我的第三个HelloWorld
- 我的第二个HelloWorld
- 我的第一条推文HelloWorld
- 2.4下helloworld模块的加载
- Android编译Native C的helloworld模块
- Android编译Native C的helloworld模块
- Android编译Native C的helloworld模块
- Android编译Native C的helloworld模块
- linux 模块编程的简单示例 helloworld
- VB.Net控制IIS的完整源代码
- 为什么C++编译器不支持模板头文件和实现代码分离的编译
- 沦 落
- 李一男2003年在港湾给开发人员培训时的语录
- 各种排序方法的综合比较
- 我的helloworld模块
- 果然是非常的一天
- 通过收缩数据库解决数据库中的日志已满的情况
- BIOS内存映射布局
- C#.Net中类与结构的区别
- WTL Makes UI Programming a Joy--中文系列
- 卡门事件不是泄露隐私那么简单,这是身份冒用问题
- SAP集成技术总结
- 模式1 singleton