Linux Device Drivers

Jonathan Corbet

出版时间

2005-02-16

ISBN

9780596005900

文件格式

EPUB

评分

★★★★★

内容简介

这是一本让读者又爱又恨的经典驱动开发著作,争议恰恰是它最真实的价值所在。有人觉得它线索不清、内容冗长,

作者简介

Jonathan Corbet got his first look at the BSD Unix source back in 1981, when an instructor at the University of Colorado let him "fix" the paging algorithm. He has been digging around inside every system he could get his hands on ever since, working on drivers for VAX, Sun, Ardent, and x86 systems on the way. He got his first Linux system in 1993, and has never looked back. Mr. Corbet is currently the co-founder and executive editor of Linux Weekly News (http://LWN.net/); he lives in Boulder, Colorado with his wife and two children. Alessandro installed Linux 0.99.14 soon after getting his degree as electronic engineer. He then received a Ph.D. in computer science at the University of Pavia despite his aversion toward modern technology. He left the University after getting his Ph.D. because he didn't want to write articles. He now works as a free lancer writing device drivers and, um...articles. He used to be a young hacker before his babies were born; he's now an old advocate of Free Software who developed a bias for non-PC computer platforms. Greg Kroah-Hartman has been writing Linux kernel drivers since 1999, and is currently the maintainer for the USB, PCI, I2C, driver core, and sysfs kernel subsystems. He is also the maintainer of the udev and hotplug userspace programs, as well as being a Gentoo kernel maintainer, ensuring that his email inbox is never empty. He is a contributing editor to Linux Journal Magazine, and works for IBM's Linux Technology Center, doing various Linux kernel related tasks.

AI 导读

核心看点
  • 本书是Linux设备驱动开发的权威指南,由内核社区核心维护者撰写,深入讲解字符设备、块设备、网络设备等驱动模型。内容涵盖内核模块加载机制、内存管理、中断处理、I/O映射等核心子系统,帮助读者理解Linux内核架构与硬件交互原理,是学习内核编程的必读经典。
  • 书中提供大量实际开发经验与API使用规范,详细解析kmalloc内存分配策略、GFP标志位含义、gendisk结构体初始化等关键实现细节。强调驱动开发中的安全性、稳定性要求,指导开发者避免常见陷阱,如睡眠上下文错误、资源竞争等问题,提升代码健壮性。
  • 尽管基于旧版内核编写,但书中关于驱动框架设计思想、内核接口规范、模块开发流程等内容仍具极高参考价值。读者可结合GitHub上社区维护的适配代码,在最新Linux内核环境中实践验证,实现从理论到工程落地的完整学习闭环,适合进阶开发者系统提升。
读者共识
  • 本书被广泛认为是Linux驱动开发领域的经典之作,内容全面覆盖驱动开发所需的核心知识点,具有不可替代的参考价值。尽管存在代码过时、翻译不佳等问题,但其对内核机制的深入剖析仍获业界高度认可,是驱动工程师案头必备的工具书,适合长期查阅与片段式学习。
  • 读者普遍反映本书不适合零基础入门,缺乏对基础概念的铺垫,学习曲线陡峭。许多初学者因无法理解上下文而中途放弃。建议仅作为进阶参考,配合官方文档、在线教程及实际项目实践使用。切勿将其作为唯一学习资源,需结合其他材料构建完整知识体系。
  • 书中关于驱动模型、内存映射、中断处理等章节评价较高,被认为讲解清晰、实用性强。但部分章节被认为冗长无趣、示例代码命名不规范、设计思想解释生硬。读者应摒弃通读幻想,聚焦具体技术点查阅,利用其作为API规范与最佳实践的权威依据,避免陷入无效阅读。

精彩摘录

  • "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."

目录

Preface
Jon's Introduction
Alessandro's Introduction
Greg's Introduction
Audience for This Book

显示全部

读者评论

插图太少,示例代码的命名过于简略,有些设计思想解释得生硬,但至少内容全面,且介绍很多api的应用场景、注意事项什么的,适合当工具书查阅。驱动模型和内存映射两章很不错。
kernel setup 1?but i read very hard.
https://lwn.net/Kernel/LDD3/
第三版看了一点... USB HotPlug 正好工作上用到
干一行爱一行
十年之后的重读。第一次真的没弄懂什么。
当我在虚拟化领域把整个计算机架构搞清楚再重读此书,很多东西变得很清晰。
过时的经典,看过本书,对我PCIE Driver的学习过程帮助不大。Kernel不断的变化、创新,做一个入门书籍还是不错,仔细学习还是不合适。
知识点清晰,循序渐进。不过语言有点复杂,插入语太多,经常读两遍才能读懂。
全部深度解读 →主题书单高分榜最近更新