Linux设备驱动程序

科波特

出版时间

2005-12-31

ISBN

9787508338637

评分

★★★★★
书籍介绍

本书是经典著作《Linux设备驱动程序》的第三版。如果您希望在Linux操作系统上支持计算机外部设备,或者在Linux上运行新的硬件,或者只是希望一般性地了解Linux内核的编程,就一定要阅读本书。本书描述了如何针对各种设备编写驱动程序,而在过去,这些内容仅仅以口头形式交流,或者零星出现在神秘的代码注释中。

本书的作者均是Linux社区的领导者。Jonathan Corbet虽不是专职的内核代码贡献者,但他是备受关注的LWN.net新闻及信息网站的执行编辑。Alessandro Rubini是一名Linux代码贡献者,也是活跃的意大利Linux社区的灵魂人物。Greg Kroah-Hartman是目前内核中USB、PCI和驱动程序核心子系统(本书均有讲述)的维护者。

本书的这个版本已针对Linux内核的2.6.10版本彻底更新过了。内核的这个版本针对常见任务完成了合理化设计及相应的简化,如即插即用、利用sysfs文件系统和用户空间交互,以及标准总线上的多设备管理等等。

要阅读并理解本书,您不必首先成为内核黑客;只要您理解C语言并具有Unix系统调用的一些背景知识即可。您将学到如何为字符设备、块设备和网络接口编写驱动程序。为此,本书提供了完整的示例程序,您不需要特殊的硬件即可编译和运行这些示例程序。本书还在单独的章节中讲述了PCI、USB和tty(终端)子系统。对期望了解操作系统内部工作原理的读者来讲,本书也深入阐述了地址空间、异步事件以及I/O等方面的内容。

AI导读
核心看点
  • Linux内核驱动开发经典指南
  • 涵盖字符块设备及PCI USB子系统
  • 深入解析内核并发与内存管理
适合谁读
  • 具备C语言基础的Linux开发者
  • 希望理解内核机制的系统工程师
  • 从事嵌入式硬件驱动开发的工程师
读前提醒
  • 注意书中代码基于旧版内核
  • 建议结合英文版阅读以避歧义
  • 需搭建Linux环境配合示例实践
读者共识
  • 驱动入门必读经典著作
  • 中文翻译质量有待提升
  • 内容较深需一定内核基础

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "GFP_ATOMIC Used to allocate memory from interrupt handlers and other code outside of a process context. Never sleeps. GFP_KERNEL Normal allocation of kernel memory. May sleep."
  • "struct gendisk is a dynamically allocated structure that requires special kernel manipulation to be initialized; drivers cannot allocate the structure on their own. Instead, you must call:"
  • "The minors argument should be the number of minor numbers this disk uses; note that you cannot change the minors field later and expect things to work properly. When a disk is no longer needed, it should be freed with:"
  • "A gendisk is a reference-counted structure (it contains a kobject). There are get_disk and put_disk functions available to manipulate the reference count, but drivers should never need to do that. Normally, the call to del_gendisk removes the final reference to a gendisk, but there are no guarantees"
  • "But this book is also about how the Linux kernel works and how to adapt its workings to your needs or interests."
  • "My hope is that this edition helps to bring that fun and opportunity to a new set of Linux developers. Whether your interests are in the kernel or in user space, I hope you find this book to be a useful and interesting guide to just how the kernel works with the hardware."
  • "I am honored that I’ve had the ability to contribute to this book. I hope that it enables others to learn the details about the kernel, discover that driver development is not a scary or forbidding place, and possibly encourage others to join in and help in the collective effort of making this opera"
  • "We hope this book is useful as a starting point for people who want to become kernel hackers but don’t know where to start."
作者简介
Jonahan Corbet早在1981年就开始接触BSD Unix的源代码。那时,科罗拉多大学的一名讲师让他“修正”其中的分页算法。从那时起直到现在。他深入研究了他所遇到的每一个系统,其中包括VAX、Sun、Arden以及x86系统的驱动程序。他在1993年第一次接触Linux系统,从此以后一直从事Linux的开发。Corbet先生是《Linux Weekly News》的创始人和执行主编。他和妻子及两个孩子生活在科罗多州的玻尔得市。
目录
前言
第一章 设备驱动程序简介
设备驱动程序的作用
内核功能划分
设备和模块的分类

显示全部
用户评论
大四毕设时读的
算是理解Linux内核必读的书了
书的内容是不错,但中文翻译实在是不敢恭维
原文精彩,看了前几章,翻译的也不错。很优秀的图书。
我读过最简单易懂的内核的书,不过都是api的详细介绍
有点老
有一说一,翻译的挺垃圾的
1023更新——看完了,不过有些章节已经过时 翻译得太垃圾了,可以换几个人翻译吗?!!!
这书刚工作的时候读的,感觉比较老了,然后内容写的既不详细又不全。这书应该是早些年代资料缺乏时候比较珍贵的参考书,但是在现在资料这么多的情况下感觉这本并不是必读书了,看这个还不如看宋宝华老师的那本。
我能力有限,不过感觉翻译的也有问题,以后有机会再看一遍吧。
收藏