To learn device driver development, like any other new knowledge, the bestapproach for me is to learn first the theory and then to do some practice. If you don't know about operating systems, I recommend "Willam Stalling's OS book" [1]. This boo…
转自:http://www.cnblogs.com/haimeng2010/p/3582403.html 目录: 1.platform_device注册过程 2.platform_driver注册过程 从 Linux 2.6 起引入了一套新的驱动管理和注册机制 :Platform_device 和 Platform_driver . Linux 中大部分的设备驱动,都可以使用这套机制 ,  设备用 Platform_device 表示,驱动用 Platform_driver 进行注册. Linu…
http://www.kalinskyassociates.com/Wpaper4.html Architecture of Device I/O Drivers Many embedded systems developers will tell you that writing a device driver consists of a lot of "bit-bashing and register-twiddling" to convince some ornery unit…
catalog . 设备驱动程序简介 . I/O体系结构 . 访问设备 . 与文件系统关联 . 字符设备操作 . 块设备操作 . 资源分配 . 总线系统 1. 设备驱动程序简介 设备驱动程序是内核的关键领域,在很多时候,判断一个操作系统的性能时,主要是通过现有驱动程序可用的外设数目和驱动程序对外设的支持程序来判断,例如 . 显卡驱动能够多大程序地发挥显卡硬件本身的性能 . 网卡驱动能否100%挖掘硬件的处理速度 .. 因此,内核源代码的相当大一部分是在致力于设备驱动程序的实现设备驱动程序基于中心…
1.platform device是怎么"自动"关联到platform driver上的? 转向linux driver有些时间了,前段时间碰到个问题,在Linux kernel 3.10的drivers/tty/serial/imx.c中,注册driver的时候调用platform_driver_register(&serial_imx_driver),serial_imx_driver类型为platform_driver, serial_imx_driver中有个成员变量p…
linux下bus,device,driver三者关系 1.bus: 总线作为主机和外设的连接通道,有些总线是比较规范的,形成了很多协议.如 PCI,USB,1394,IIC等.任何设备都可以选择合适的总线连接到主机.当然主机也可能就是CPU本身.内存也是通过BUS连接到主机的,可内存 使用的总线不是外设总线,因此和内存使用相同类型的总线的设备,谈及BUS比较含糊. 一块网卡在嵌入式开发中,直接通过内存总线接入到CPU.我们在写网卡驱动时,要给该BUS定义就麻烦了. 2.driver: 驱动程序…
还是没有接触到怎么控制硬件,但是在书里看到了一个挺巧妙的环形缓冲区实现. 此环形缓冲区实际为一个大小为bufsize的一维数组,有一个rp的读指针,一个wp的写指针. 在数据满时写进程会等待读进程读取数据,数据为空时读进程会等待写进程写入数据. 在上次代码上改的,所以名字还是ioctldemo ioctldemo.c #include <linux/module.h> #include <linux/init.h> #include <linux/stat.h> #in…
The Internal Representation of Device Numbers Within the kernel,the dev_t type(defined in linux/types.h ) is used to hold device numbers---both the major and minor parts. it should,instead,make use of a set of macros found in linux/kdev_t.h.To obtain…
/******************************************************************************************* * I.MX6 Linux I2C device& driver hacking * 声明: * 1. 本文主要是对Linux I2C驱动进行代码跟踪,主要是为了能够对I2C驱动框架有个全面的了解: * 2. 本文源代码来自myzr_android4_2_2_1_1_0.tar.bz2: * 3. 如果你有兴趣,…
Linux Device Driver 学习(1) 一.搭建虚拟机开发环境 1.选择虚拟机VirtualBox,官网下载.deb包安装: VirtualBox Linux 5.1.6 下载fedora 24 workstation iso镜像 Fedora 24 WorkStation 具体虚拟机的安装和Fedora的安装,这里不再详细描述,可以自己在网上找到. 第一次使用Fedora,估计也有很多坑. 特别的,如果使用Ubuntu在安装的时候如果没选择安装源码,则在/usr/src下虽然可以看…