How to learn linux device driver

本文介绍了一种学习设备驱动开发的方法,首先从理论入手,推荐了关于操作系统和Linux内核开发的书籍,然后深入到设备驱动的实践,包括虚拟设备驱动和真实设备驱动的编写。文章还提到了将Android设备驱动移植到Linux的机遇。
摘要由CSDN通过智能技术生成

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/

转载于:https://www.cnblogs.com/Daniel-G/p/3214800.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值