
| 本书揭示了如何给大多数的设备编写驱动程序的信息,这些信息迄今仅通过口头或者隐晦的源代码注释被共享。你不必是一个内核高手就可以理解并享受本书,所需要的只是C以及Unix系统调用方面的背景知识。在不需要特殊的硬件设备就能编译和运行的详细示例的指引下,你将学会如何给字符设备、块设备和网络接口编写驱动程序。PCI、USB和tty(终端)子系统都单列一章。本书为那些对操作系统的工作机制好奇的人提供了地址空间、异步事件和I/O等方面的阐述。 |
| Preface 1. An Introduction to Device Drivers The Role of the Device Driver Splitting the Kernel Classes of Devices and Modules Security Issues Version Numbering License Terms Joining the Kernel Development Community Overview of the Book 2. Building and Running Modules Setting Up Your Test System The Hello World Module Kernel Modules Versus Applications Compiling and Loading The Kernel Symbol Table Preliminaries Initialization and Shutdown Module Parameters Doing It in User Space Quick Reference 3. Char Drivers The Design of scull Major and Minor Numbers Some Important Data Structures 49Char Device Registration open and release sculls Memory Usage read and write Playing with the New Devices Quick Reference 4. Debugging Techniques Debugging Support in the Kernel Debugging by Printing Debugging by Querying Debugging by Watching Debugging System Faults Debuggers and Related Tools 5. Concurrency and Race Conditions Pitfalls in scull Concurrency and Its Management Semaphores and Mutexes Completions Spinlocks Locking Traps Alternatives to Locking Quick Reference 6. Advanced Char Driver Operations ioctl Blocking I/O poll and select Asynchronous Notification Seeking a Device Access Control on a Device File Quick Reference 7. Time, Delays, and Deferred Work Measuring Time Lapses Knowing the Current Time Delaying Execution Kernel Timers Tasklets Workqueues Quick Reference 8. Allocating Memory 9. Communicating with Hardware 10. Interrupt Handling 11. Data Types in the Kernel 12. PCI Drivers 13. USB Drivers 14. The Linux Device Model 15. Memory Mapping and DMA 16. Block Drivers 17. Network Drivers 18. TTY Drivers Index |
商品评论(0条)