معرفی کتاب «Essential Linux Device Drivers (Prentice Hall Open Source Software Development Series)» نوشتهٔ Sreekrishnan Venkateswaran, Sreekrishnan Venkateswaran در سال 2010. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Essential Linux Device Drivers (Prentice Hall Open Source Software Development Series)» در دستهٔ بدون دستهبندی قرار دارد.
A unique resource that shows Linux kernel and Linux application programmers how to write bug-free code that's optimized for performance. This resource includes: debugging tools and techniques for the Linux kernel itself and Linux applications; performance tools and techniques that show how to supercharge the kernel and the applications that run on it; and sophisticated profiling techniques that teach programmers how to uncover application bottlenecks. Like all books in the Arnold Robbins series, this book is written by Linux practitioners for Linux practitioners, and like all books in the series, this book contains many hundreds of lines of example program code from the Linux kernel and from real-world Linux applications. Though this book presents debugging strategy, it is fundamentally a hands-on Linux software debugging and performance tuning book. Cover......Page 1 Title......Page 4 Copyright......Page 5 Contents......Page 8 Foreword......Page 22 Preface......Page 24 Summary of Chapters......Page 25 Conventions Used......Page 28 Acknowledgments......Page 30 About the Author......Page 31 1: Introduction......Page 32 Evolution......Page 33 The GNU Copyleft......Page 34 Mailing Lists and Forums......Page 35 Linux Distributions......Page 36 Looking at the Sources......Page 37 Building the Kernel......Page 41 Loadable Modules......Page 43 Before Starting......Page 45 2: A Peek Inside the Kernel......Page 48 Booting Up......Page 49 Process Context and Interrupt Context......Page 61 HZ and Jiffies......Page 62 Long Delays......Page 64 Pentium Time Stamp Counter......Page 67 Real Time Clock......Page 68 Spinlocks and Mutexes......Page 70 Atomic Operators......Page 76 Reader-Writer Locks......Page 77 Debugging......Page 79 Allocating Memory......Page 80 Looking at the Sources......Page 83 3: Kernel Facilities......Page 86 Creating a Kernel Thread......Page 87 Process States and Wait Queues......Page 92 User Mode Helpers......Page 94 Linked Lists......Page 96 Work Queues......Page 103 Notifier Chains......Page 105 Completion Interface......Page 109 Kthread Helpers......Page 112 Error-Handling Aids......Page 114 Looking at the Sources......Page 116 4: Laying the Groundwork......Page 120 Introducing Devices and Drivers......Page 121 Interrupt Context......Page 123 Device Example: Roller Wheel......Page 125 Softirqs and Tasklets......Page 130 Udev......Page 134 Sysfs, Kobjects, and Device Classes......Page 137 Hotplug and Coldplug......Page 141 Microcode Download......Page 142 Module Autoload......Page 143 Power Management......Page 145 Looking at the Sources......Page 146 5: Character Drivers......Page 150 Char Driver Basics......Page 151 Device Example: System CMOS......Page 152 Driver Initialization......Page 153 Open and Release......Page 158 Exchanging Data......Page 160 Seek......Page 167 Control......Page 168 Poll......Page 170 Fasync......Page 173 Talking to the Parallel Port......Page 176 Device Example: Parallel Port LED Board......Page 177 RTC Subsystem......Page 187 Pseudo Char Drivers......Page 188 Device Example: Watchdog Timer......Page 191 Character Caveats......Page 197 Looking at the Sources......Page 198 6: Serial Drivers......Page 202 Layered Architecture......Page 204 UART Drivers......Page 207 Device Example: Cell Phone......Page 209 RS-485......Page 222 TTY Drivers......Page 223 Line Disciplines......Page 225 Device Example: Touch Controller......Page 226 Looking at the Sources......Page 236 7: Input Drivers......Page 238 The Evdev Interface......Page 241 Input Device Drivers......Page 247 Keyboards......Page 248 Touch Controllers......Page 258 Output Events......Page 259 Debugging......Page 261 Looking at the Sources......Page 262 8: The Inter-Integrated Circuit Protocol......Page 264 What’s I2C/SMBus?......Page 265 I2C Core......Page 266 Bus Transactions......Page 268 Initializing......Page 269 Probing the Device......Page 272 Accessing the Device......Page 275 More Methods......Page 277 Device Example: Real Time Clock......Page 278 The Serial Peripheral Interface Bus......Page 282 Debugging......Page 285 Looking at the Sources......Page 286 9: PCMCIA and Compact Flash......Page 288 What’s PCMCIA/CF?......Page 289 Linux-PCMCIA Subsystem......Page 291 Host Controller Drivers......Page 293 Driver Services......Page 294 Data Structures......Page 295 Device Example: PCMCIA Card......Page 298 Tying the Pieces Together......Page 302 Serial PCMCIA......Page 303 Debugging......Page 304 Looking at the Sources......Page 306 10: Peripheral Component Interconnect......Page 308 The PCI Family......Page 309 Addressing and Identification......Page 312 Configuration Space......Page 316 I/O and Memory......Page 317 Direct Memory Access......Page 319 Device Example: Ethernet-Modem Card......Page 323 Initializing and Probing......Page 324 Data Transfer......Page 332 Looking at the Sources......Page 339 11: Universal Serial Bus......Page 342 USB Architecture......Page 343 Bus Speeds......Page 345 Transfer Types......Page 346 Addressing......Page 347 Driver Data Structures......Page 348 The usb_device Structure......Page 349 USB Request Blocks......Page 350 Pipes......Page 352 Descriptor Structures......Page 353 Device Example: Telemetry Card......Page 355 Initializing and Probing......Page 356 Accessing Registers......Page 363 Data Transfer......Page 366 Class Drivers......Page 369 Mass Storage......Page 370 USB-Serial......Page 376 Gadget Drivers......Page 379 Debugging......Page 380 Looking at the Sources......Page 382 12: Video Drivers......Page 386 Display Architecture......Page 387 Linux-Video Subsystem......Page 390 Display Parameters......Page 392 The Frame Buffer API......Page 393 Device Example: Navigation System......Page 396 Console Drivers......Page 411 Device Example: Cell Phone Revisited......Page 413 Debugging......Page 418 Looking at the Sources......Page 419 13: Audio Drivers......Page 422 Audio Architecture......Page 423 Linux-Sound Subsystem......Page 425 Device Example: MP3 Player......Page 427 Driver Methods and Structures......Page 430 ALSA Programming......Page 440 Looking at the Sources......Page 443 14: Block Drivers......Page 446 Storage Technologies......Page 447 Linux Block I/O Layer......Page 452 I/O Schedulers......Page 453 Block Driver Data Structures and Methods......Page 454 Device Example: Simple Storage Controller......Page 457 Initialization......Page 458 Block Device Operations......Page 461 Disk Access......Page 463 Advanced Topics......Page 465 Debugging......Page 467 Looking at the Sources......Page 468 15: Network Interface Cards......Page 470 Driver Data Structures......Page 471 Socket Buffers......Page 472 The Net Device Interface......Page 474 Data Transfer......Page 475 Statistics......Page 476 Configuration......Page 477 Receive Path......Page 479 Flow Control......Page 480 Buffer Management and Concurrency Control......Page 481 Device Example: Ethernet NIC......Page 482 ISA Network Drivers......Page 488 Asynchronous Transfer Mode......Page 489 Driver Performance......Page 490 Looking at the Sources......Page 492 16: Linux Without Wires......Page 496 Bluetooth......Page 498 BlueZ......Page 500 Device Example: USB Adapter......Page 502 RFCOMM......Page 504 Networking......Page 506 Audio......Page 508 Infrared......Page 509 Linux-IrDA......Page 511 Device Example: Super I/O Chip......Page 513 Device Example: IR Dongle......Page 514 Networking......Page 517 IrDA Sockets......Page 518 Linux Infrared Remote Control......Page 519 WiFi......Page 520 Configuration......Page 521 Device Drivers......Page 525 GPRS......Page 527 CDMA......Page 529 Current Trends......Page 531 17: Memory Technology Devices......Page 534 What’s Flash Memory?......Page 535 Linux-MTD Subsystem......Page 536 Device Example: Handheld......Page 537 NOR Chip Drivers......Page 542 NAND Chip Drivers......Page 544 Block Device Emulation......Page 547 JFFS2......Page 548 MTD-Utils......Page 549 Configuring MTD......Page 550 The Firmware Hub......Page 551 Looking at the Sources......Page 555 18: Embedding Linux......Page 558 Challenges......Page 559 Component Selection......Page 561 Embedded Bootloaders......Page 562 Memory Layout......Page 566 Kernel Porting......Page 568 Flash Memory......Page 569 Buttons and Wheels......Page 570 USB......Page 571 Video......Page 572 Domain-Specific Electronics......Page 573 More Drivers......Page 574 NFS-Mounted Root......Page 575 Compact Middleware......Page 577 Debugging......Page 579 Board Rework......Page 580 Debuggers......Page 581 19: Drivers in User Space......Page 582 The O(1) Scheduler......Page 584 Response Times......Page 586 Accessing I/O Regions......Page 589 Accessing Memory Regions......Page 593 User Mode SCSI......Page 596 User Mode USB......Page 598 User Mode I2C......Page 602 UIO......Page 604 Looking at the Sources......Page 605 20: More Devices and Drivers......Page 608 ECC Reporting......Page 609 Device Example: ECC-Aware Memory Controller......Page 610 Frequency Scaling......Page 614 Embedded Controllers......Page 615 ACPI......Page 616 ISA and MCA......Page 618 FireWire......Page 619 Intelligent Input/Output......Page 620 Voice over IP......Page 621 High-Speed Interconnects......Page 622 Fibre Channel......Page 623 iSCSI......Page 624 21: Debugging Device Drivers......Page 626 Kernel Debuggers......Page 627 Entering a Debugger......Page 628 Kernel Debugger (kdb)......Page 629 Kernel GNU Debugger (kgdb)......Page 631 GNU Debugger (gdb)......Page 635 JTAG Debuggers......Page 636 Kprobes......Page 640 Jprobes......Page 645 Return Probes......Page 648 Limitations......Page 650 Kexec......Page 651 Kexec with Kdump......Page 652 Kdump......Page 653 Kernel Profiling with OProfile......Page 660 Application Profiling with Gprof......Page 664 Linux Trace Toolkit......Page 665 Diagnostic Tools......Page 669 Kernel Hacking Config Options......Page 670 Test Equipment......Page 671 22: Maintenance and Delivery......Page 672 Change Markers......Page 673 Consistent Checksums......Page 674 Build Scripts......Page 676 Portable Code......Page 678 23: Shutting Down......Page 680 Checklist......Page 681 What Next?......Page 682 A: Linux Assembly......Page 684 Debugging......Page 690 B: Linux and the BIOS......Page 692 Real Mode Calls......Page 693 Protected Mode Calls......Page 696 BIOS and Legacy Drivers......Page 697 C: Seq Files......Page 700 The Seq File Advantage......Page 701 Updating the NVRAM Driver......Page 708 Looking at the Sources......Page 710 A......Page 712 B......Page 714 C......Page 715 D......Page 718 E......Page 720 F......Page 722 H......Page 723 I......Page 724 K......Page 726 L......Page 728 M......Page 729 N......Page 732 O......Page 733 P......Page 734 R......Page 737 S......Page 738 T......Page 741 U......Page 743 V......Page 744 Y-Z......Page 745
“probably The Most Wide Ranging And Complete Linux Device Driver Book I’ve Read.”
alan Cox, Linux Guru And Key Kernel Developer
“very Comprehensive And Detailed, Covering Almost Every Single Linux Device Driver Type.”
theodore Ts’o, First Linux Kernel Developer In North America And Chief Platform Strategist Of The Linux Foundation
the Most Practical Guide To Writing Linux Device Drivers
linux Now Offers An Exceptionally Robust Environment For Driver Development: With Today’s Kernels, What Once Required Years Of Development Time Can Be Accomplished In Days. In This Practical, Example-driven Book, One Of The World’s Most Experienced Linux Driver Developers Systematically Demonstrates How To Develop Reliable Linux Drivers For Virtually Any Device. Essential Linux Device Drivers Is For Any Programmer With A Working Knowledge Of Operating Systems And C, Including Programmers Who Have Never Written Drivers Before. Sreekrishnan Venkateswaran Focuses On The Essentials, Bringing Together All The Concepts And Techniques You Need, While Avoiding Topics That Only Matter In Highly Specialized Situations. Venkateswaran Begins By Reviewing The Linux 2.6 Kernel Capabilities That Are Most Relevant To Driver Developers. He Introduces Simple Device Classes; Then Turns To Serial Buses Such As I2c And Spi; External Buses Such As Pcmcia, Pci, And Usb; Video, Audio, Block, Network, And Wireless Device Drivers; User-space Drivers; And Drivers For Embedded Linux–one Of Today’s Fastest Growing Areas Of Linux Development. For Each, Venkateswaran Explains The Technology, Inspects Relevant Kernel Source Files, And Walksthrough Developing A Complete Example.
• Addresses Drivers Discussed In No Other Book, Including Drivers For I2c, Video, Sound, Pcmcia, And Different Types Of Flash Memory
• Demystifies Essential Kernel Services And Facilities, Including Kernel Threads And Helper Interfaces
• Teaches Polling, Asynchronous Notification, And I/o Control
• Introduces The Inter-integrated Circuit Protocol For Embedded Linux Drivers
• Covers Multimedia Device Drivers Using The Linux-video Subsystem And Linux-audio Framework
• Shows How Linux Implements Support For Wireless Technologies Such As Bluetooth, Infrared, Wifi, And Cellular Networking
• Describes The Entire Driver Development Lifecycle, Through Debugging And Maintenance
• Includes Reference Appendixes Covering Linux Assembly, Bios Calls, And Seq Files
“Probably the most wide ranging and complete Linux device driver book I've read.” --Alan Cox, Linux Guru and Key Kernel Developer “Very comprehensive and detailed, covering almost every single Linux device driver type.” --Theodore Ts'o, First Linux Kernel Developer in North America and Chief Platform Strategist of the Linux Foundation The Most Practical Guide to Writing Linux Device Drivers Linux now offers an exceptionally robust environment for driver development: with today's kernels, what once required years of development time can be accomplished in days. In this practical, example-driven book, one of the world's most experienced Linux driver developers systematically demonstrates how to develop reliable Linux drivers for virtually any device. Essential Linux Device Drivers is for any programmer with a working knowledge of operating systems and C, including programmers who have never written drivers before. Sreekrishnan Venkateswaran focuses on the essentials, bringing together all the concepts and techniques you need, while avoiding topics that only matter in highly specialized situations. Venkateswaran begins by reviewing the Linux 2.6 kernel capabilities that are most relevant to driver developers. He introduces simple device classes; then turns to serial buses such as I2C and SPI; external buses such as PCMCIA, PCI, and USB; video, audio, block, network, and wireless device drivers; user-space drivers; and drivers for embedded Linux–one of today's fastest growing areas of Linux development. For each, Venkateswaran explains the technology, inspects relevant kernel source files, and walks through developing a complete example. • Addresses drivers discussed in no other book, including drivers for I2C, video, sound, PCMCIA, and different types of flash memory • Demystifies essential kernel services and facilities, including kernel threads and helper interfaces • Teaches polling, asynchronous notification, and I/O control • Introduces the Inter-Integrated Circuit Protocol for embedded Linux drivers • Covers multimedia device drivers using the Linux-Video subsystem and Linux-Audio framework • Shows how Linux implements support for wireless technologies such as Bluetooth, Infrared, WiFi, and cellular networking • Describes the entire driver development lifecycle, through debugging and maintenance • Includes reference appendixes covering Linux assembly, BIOS calls, and Seq files This book is the most practical guide to writing Linux device drivers. Linux now offers an exceptionally robust environment for driver development: with today's kernels, what once required years of development time can be accomplished in days. In this practical, example-driven book, one of the world's most experienced Linux driver developers systematically demonstrates how to develop reliable Linux drivers for virtually any device. Essential Linux Device Drivers is for any programmer with a working knowledge of operating systems and C, including programmers who have never written drivers before. Sreekrishnan Venkateswaran focuses on the essentials, bringing together all the concepts and techniques you need, while avoiding topics that only matter in highly specialized situations. Venkateswaran begins by reviewing the Linux 2.6 kernel capabilities that are most relevant to driver developers. He introduces simple device classes; then turns to serial buses such as I2C and SPI; external buses such as PCMCIA, PCI, and USB; video, audio, block, network, and wireless device drivers; user-space drivers; and drivers for embedded Linux–one of today's fastest growing areas of Linux development. For each, Venkateswaran explains the technology, inspects relevant kernel source files, and walksthrough developing a complete example. - Publisher. About the author Introduction A peek inside the kernel Kernel facilities Laying the groundwork Character drivers Serial drivers Input drivers The inter-integrated circuit protocol PCMCIA and compact flash Peripheral component interconnect Universal serial bus Video drivers Audio drivers Block drivers Network interface cards Linux without wires Memory technology devices Embedding Linux Drivers in user space More devices and drivers Debugging device drivers Maintenance and delivery Shutting down Appendixes. Linux Assembly Linux and the BIOS Seq files