代码改变世界

随笔档案-2010年3月9日

设备驱动编写流程之二

2010-03-09 09:55 by htc开发, 161 阅读, 收藏,
摘要: hello.c#include <linux/module.h> //needed by all modules#include <linux/kernel.h> //needed for KERN_ALERT#include <linux/init.h>MODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){ printk(KERN_INFO "hello, world!/n"); return 0;}static void hello_exit(void 阅读全文

设备驱动编写流程之一

2010-03-09 09:51 by htc开发, 262 阅读, 收藏,
摘要: 1.在drivers/char/目录下建立一个first_driver_hello.c文件 文件的内容如下 /************************************* NAME:first_driver_hello.c COPYRIGHT:328977974@qq.com **************************************/ #include <linux/module.h> #include <linux/kernel.h> MODULE_LICENSE("GPL"); static int hello_ 阅读全文