Developing Windows NT Device Drivers: A Programmer's
Handbook offers programmers a comprehensive and
in-depth guide to building device drivers for
Windows NT.
Written by two experienced
driver developers, Edward N.
Dekker and Joseph M. Newcomer, this book provides detailed
coverage of techniques, tools, methods, and pitfalls to
help make the often complex and byzantine "black art" of
driver development straightforward and accessible.
This book is designed for anyone involved in the
development of Windows NT Device Drivers, particularly
those working on drivers for nonstandard devices that
Microsoft has not specifically supported. Because Windows
NT does not permit an application program to directly
manipulate hardware, a customized kernel mode device driver
must be created for these nonstandard devices. And since
experience has clearly shown that superficial knowledge can
be hazardous when developing device drivers, the authors
have taken care to explore each relevant topic in
depth.
This book's coverage focuses on drivers for polled,
programmed I/O, interrupt-driven, and DMA devices. The
authors discuss the components of a kernel mode device
driver for Windows NT, including background on the two
primary bus interfaces used in today's computers: the ISA
and PCI buses. Developers will learn the mechanics of
compilation and linking, how the drivers register
themselves with the system, experience-based techniques for
debugging, and how to build robust, portable, multithread-
and multiprocessor-safe device drivers that work as
intended and won't crash the system. The authors also show
how to call the Windows NT kernel for the many services
required to support a device driver and demonstrate some
specialized techniques, such as mapping device memory or
kernel memory into user space. Thus developers will not
only learn the specific mechanics of high-quality device
driver development for Windows NT, but will gain a deeper
understanding of the foundations of device driver
design.
Table of contents :
List of Figures ..... xxv
List of Tables ..... xxxi
Code Listings ..... xxxv
Preface ..... xxxix
Chapter 1: Driver Overview ..... 1
Chapter 2: I/O: User Level Overview ..... 31
Chapter 3: Planning a Device Driver ..... 45
Chapter 4: I/O Hardware: Internal Busses ..... 71
Chapter 5: Device Driver Basics ..... 95
Chapter 6: Overview of Kernel Memory: Caching, Paging and
Pipelining ..... 107
Chapter 7: Driver Data Structures ..... 129
Chapter 8: Device Driver Structure ..... 151
Chapter 9: Debugging a Device Driver ..... 169
Chapter 10: Approaching Reality: Moving Data .....
221
Chapter 11: Approaching Reality: Synchronization .....
247
Chapter 12: Achieving Reality: Memory Management .....
265
Chapter 13: Achieving Reality: Touching the Hardware .....
279
Chapter 14: Achieving Reality: Interrupts and the Driver
..... 291
Chapter 15: Achieving Reality: Timers ..... 311
Chapter 16: Achieving Reality: Driver Initialization .....
325
Chapter 17: Achieving Reality: Direct Memory Access .....
337
Chapter 18: Achieving Reality: The Rest of the Details
..... 353
Chapter 19: Mapping Kernel and Device Memory to User Space
..... 363
Chapter 20: I/O Hardware: The ISA Bus ..... 383
Chapter 21: I/O Hardware: The PCI Bus ..... 395
Chapter 22: Serialization within the Driver ..... 433
Chapter 23: Layered Drivers ..... 461
Chapter 24: Driver Threads ..... 491
Chapter 25: Specialized Drivers in NT: An Overview .....
525
Chapter 26: Useful Driver Techniques ..... 553
Chapter 27: A Hardware Simulator ..... 605
Chapter 28: Windows 2000 Preview ..... 635
Chapter 29: I/O Hardware: The Universal Serial Bus .....
683
Chapter 30: The Win32 Driver Model ..... 739
Appendix A: Reference ..... 779
Appendix B: Error Codes and NTSTATUS Codes ..... 1001
Appendix C: BugCheck Codes ..... 1107
Index ..... 1119