![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux内核驱动
文章平均质量分 55
echoes_of_rainbow
这个作者很懒,什么都没留下…
展开
-
Linux 内核模块之hello world
Linux系统内核运行于一个单独的保护区中,但是运行内核在运行时动态的添加或者删除代码,这些代码包括了相关的数据 函数入口 出口并被组合在一个单一的二进制镜像中,即可装载内核模块,简称为模块。一个最简单的模块组建过程如下://hello world 模块源码#include #include #include static int __init hello_init() { printk("Hello World/n"); } static void __exit hello_e原创 2010-08-18 16:00:00 · 335 阅读 · 0 评论 -
Linux 简单的字符文件驱动
<br />字符设备是Linux 设备驱动中最简单的。<br />struct cdev<br />{<br /> struct kobject *kobj;<br /> struct module *owner; //所属模块<br /> struct file_operations *ops;<br /> struct list_head_list;<br /> dev_t dev;<br /> unsigned int count;<br />};<br />1原创 2010-08-20 17:22:00 · 416 阅读 · 0 评论 -
container_of
在linux内核中经常遇到container_of宏,定义如下: #define container_of(ptr, type, member) ({ / const typeof( ((type *)0)->member ) *__原创 2011-09-05 18:03:46 · 271 阅读 · 0 评论