Books & Videos

Table of Contents

  1. Chapter 1 Building and Running Modules

    1. Types of Device Drivers

    2. Loadable Kernel Modules

    3. Hello, world!

    4. Compiling and Loading

    5. Character Drivers

    6. Mostly Harmless

    7. Block Drivers Are Gone

    8. Conclusion

  2. Chapter 2 Allocating Memory

    1. Memory Management Routines

    2. malloc_type Structures

    3. Tying Everything Together

    4. Contiguous Physical Memory Management Routines

    5. A Straightforward Example

    6. Conclusion

  3. Chapter 3 Device Communication and Control

    1. ioctl

    2. Defining ioctl Commands

    3. Implementing ioctl

    4. Invoking ioctl

    5. sysctl

    6. Implementing sysctls, Part 1

    7. sysctl Context Management Routines

    8. Creating Dynamic sysctls

    9. Implementing sysctls, Part 2

    10. Conclusion

  4. Chapter 4 Thread Synchronization

    1. A Simple Synchronization Problem

    2. A More Complex Synchronization Problem

    3. Preventing Race Conditions

    4. Mutexes

    5. Mutex Management Routines

    6. Implementing Mutexes

    7. Shared/Exclusive Locks

    8. Shared/Exclusive Lock Management Routines

    9. Implementing Shared/Exclusive Locks

    10. Reader/Writer Locks

    11. Reader/Writer Lock Management Routines

    12. Condition Variables

    13. Condition Variable Management Routines

    14. General Guidelines

    15. Conclusion

  5. Chapter 5 Delaying Execution

    1. Voluntary Context Switching, or Sleeping

    2. Implementing Sleeps and Condition Variables

    3. Kernel Event Handlers

    4. Callouts

    5. Callouts and Race Conditions

    6. Taskqueues

    7. Conclusion

  6. Chapter 6 Case Study: Virtual Null Modem

    1. Prerequisites

    2. Code Analysis

    3. Conclusion

  7. Chapter 7 Newbus and Resource Allocation

    1. Autoconfiguration and Newbus Drivers

    2. Tying Everything Together

    3. Hardware Resource Management

    4. Conclusion

  8. Chapter 8 Interrupt Handling

    1. Registering an Interrupt Handler

    2. Interrupt Handlers in FreeBSD

    3. Implementing an Interrupt Handler

    4. Generating Interrupts on the Parallel Port

    5. Conclusion

  9. Chapter 9 Case Study: Parallel Port Printer Driver

    1. Code Analysis

    2. Conclusion

  10. Chapter 10 Managing and Using Resources

    1. I/O Ports and I/O Memory

    2. Memory Barriers

    3. Tying Everything Together

    4. Conclusion

  11. Chapter 11 Case Study: Intelligent Platform Management Interface Driver

    1. Code Analysis

    2. Conclusion

  12. Chapter 12 Direct Memory Access

    1. Implementing DMA

    2. Creating DMA Tags

    3. Tearing Down DMA Tags

    4. DMA Map Management Routines, Part 1

    5. Loading (DMA) Buffers into DMA Maps

    6. DMA Map Management Routines, Part 2

    7. A Straightforward Example

    8. Synchronizing DMA Buffers

    9. Conclusion

  13. Chapter 13 Storage Drivers

    1. disk Structures

    2. disk Structure Management Routines

    3. Block I/O Structures

    4. Block I/O Queues

    5. Tying Everything Together

    6. Block I/O Completion Routines

    7. Conclusion

  14. Chapter 14 Common Access Method

    1. How CAM Works

    2. A (Somewhat) Simple Example

    3. SIM Registration Routines

    4. Action Routines

    5. Conclusion

  15. Chapter 15 USB Drivers

    1. About USB Devices

    2. More About USB Devices

    3. USB Configuration Structures

    4. USB Transfers (in FreeBSD)

    5. USB Configuration Structure Management Routines

    6. USB Methods Structure

    7. Tying Everything Together

    8. Conclusion

  16. Chapter 16 Network Drivers, Part 1: Data Structures

    1. Network Interface Structures

    2. Network Interface Structure Management Routines

    3. Network Interface Media Structures

    4. Network Interface Media Structure Management Routines

    5. Hello, world!

    6. mbuf Structures

    7. Message Signaled Interrupts

    8. Implementing MSI

    9. MSI Management Routines

    10. Conclusion

  17. Chapter 17 Network Drivers, Part 2: Packet Reception and Transmission

    1. Packet Reception

    2. Packet Transmission

    3. Post Packet Transmission

    4. Conclusion

  1. References

  2. Colophon

  3. Appendix UPDATES