How to learn linux device driver
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 book has a more hardware oriented approach unlike other OS books that focused more on the algorithms and data structures used in operating systems.
After having a high level overview of operating systems, you have to learn aboutLinux kernel development. Robert Love's book [2] is for me the best one on thesubject. You can learn not only about Linux kernel development, but also themotivations behind the technical decisions that lead to the design.
Then you have to learn about device drivers development on Linux, two books that are very good are "Linux Device Drivers" [3] and "Essential Linux Device Drivers" [4].This two books are complementary. The former teaches how to write virtual devicedrivers for memory based devices, so you can try the examples without the need ofspecial hardware. While the latter shows you how device drives for real devices are actually written. I maintain an up-to-date repository with all LDD3 examples so you can compile and test on recent kernels [5].
Once you have the theory you can begin with the practice by writing real device drivers. You need a hardware that still is not supported on Linux. The good news is that you probably already have one of these devices. With the popularity of the Android platform, is very likely that you own an Android device.
Even when Android is a Linux-based operating system, Google by a design decision forked the Linux kernel and added some APIs [6] that don't exist on the Linux kernel. These APIs are used by device drivers and for that reason, a developer has to choose whether to write a device driver for Android or Linux.
So, porting Android device drivers to Linux is an excellent opportunity to learn device driver development skills, the Linux kernel development process and how to work with the Linux community while doing something useful.
[1]: http://williamstallings.com/OS/
[2]: http://blog.rlove.org/2010/07/li...
[3]: http://lwn.net/Kernel/LDD3/
[4]: http://elinuxdd.com/
[5]: https://github.com/martinezjavier/ldd3
[6]: http://lwn.net/Articles/416690/
How to learn linux device driver的更多相关文章
- linux device driver —— 环形缓冲区的实现
还是没有接触到怎么控制硬件,但是在书里看到了一个挺巧妙的环形缓冲区实现. 此环形缓冲区实际为一个大小为bufsize的一维数组,有一个rp的读指针,一个wp的写指针. 在数据满时写进程会等待读进程读取 ...
- Linux Device Driver 学习(1)
Linux Device Driver 学习(1) 一.搭建虚拟机开发环境 1.选择虚拟机VirtualBox,官网下载.deb包安装: VirtualBox Linux 5.1.6 下载fedora ...
- how to write your first linux device driver
how to write your first linux device driver 0. environment-ubuntu 1804 64bit 1. apt-get install linu ...
- Linux Device Driver && Device File
catalog . 设备驱动程序简介 . I/O体系结构 . 访问设备 . 与文件系统关联 . 字符设备操作 . 块设备操作 . 资源分配 . 总线系统 1. 设备驱动程序简介 设备驱动程序是内核的关 ...
- <<linux device driver,third edition>> Chapter 4:Debugging Techniques
Debugging by Printing printk lets you classify messages accoring to their severity by associating di ...
- <<linux device driver,third edition>> Chapter 3:Char Drivers
The Internal Representation of Device Numbers Within the kernel,the dev_t type(defined in linux/type ...
- linux device driver —— ioctl
实现了应用程序和设备驱动通过ioctl通信.还是对设备驱动没什么感觉,贴一下代码吧. 在Ubuntu 16.04 64bit中测试通过 ioctldemo.c #include <linux/m ...
- linux device driver —— 字符设备
现在对linux设备驱动还没有什么认识,跟着书上敲了一个字符驱动,这里把代码贴一下. 测试环境是 Ubuntu 16.04 64bit 驱动程序: #include <linux/fs.h> ...
- <<linux device driver,third edition>> Chapter 2: Building and Running Modules
Kernel Modules Versus Applications Kernel modules programming is similar to event driven programming ...
随机推荐
- Context详解
前言 Context在android中的作用不言而喻,当我们访问当前应用的资源,启动一个新的activity的时候都需要提供Context,而这个Context到底是什么呢,这个问题好像很好回答又好像 ...
- 为iOS7重新设计你的App
在 WWDC 上看到 iOS 7 系统的发布后,我们重新审视了自己的应用 Grocery List,并且意识到:iOS 7 对于开发者来说是一个全新的开始,就像七年前 iPhone 首次发布一样.现在 ...
- [MySql] - 解决部署的服务器没有安装MySql Connector
1. 在C盘安装mysql的位置找到三个DLL,复制到Bin文件夹下. 2. 在配置文件的web下添加引用,PubulishKeyToken 根据版本来. <system.data> &l ...
- C++中的冒泡排序,选择排序,插入排序
最简单的插入排序:思想,两两之间比较,时间复杂度o(n^2) void bubblesort(vector<int>&vec, int n) { if (&vec==NUL ...
- Qt实现指定线程执行回调
说明 同线程时,直接调用回调(block参数没意义) 创建invoker所在的线程,需要有Qt的消息循环(比如UI线程) 直接上代码 typedef std::function<void()&g ...
- C# 数组CopyTo
private void button1_Click(object sender, RoutedEventArgs e) { int[] copy1 = { 1, 2, 3, 4 }; int[] c ...
- 2875: [Noi2012]随机数生成器 - BZOJ
DescriptionInput 包含6个用空格分割的m,a,c,X0,n和g,其中a,c,X0是非负整数,m,n,g是正整数. Output 输出一个数,即Xn mod gSample Input ...
- Jquery 查看DOM上绑定的事件列表
$(dom).data( "events" ); 包括事件类型和关联的处理函数 下面是firefox的截图
- c库函数之scanf
scanf()函数的原理 想象输入设备(键盘)连接着一个叫“缓冲”的东西,把缓冲认为是一个字符数组. 当你的程序执行到scanf时,会从你的缓冲区读东西,如果缓冲区是空的,就阻塞住,等待你从键盘输入. ...
- 【BZOJ】【3275】Numbers
网络流/最小割 Orz了Jiry_2神犇,蒟蒻网络流建模什么的完全不会啊T_T 按奇偶性来分组实在太巧妙了……然后相关的点之间连边表示只能选其一,来求最小割…… /****************** ...