Home > Store

Windows NT Device Driver Development

Register your product to gain access to bonus material or receive a coupon.

Windows NT Device Driver Development

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 1998
  • Dimensions: 6 X 9
  • Pages: 704
  • Edition: 1st
  • Book
  • ISBN-10: 1-57870-058-2
  • ISBN-13: 978-1-57870-058-5

Windows NT Device Driver Development is the definitive and comprehensive technical reference for software engineers, systems programmers, and any engineer who needs to understand Windows NT systems internals. You will learn: vital information about the internal design and architecture of the Windows NT operating system; Critical information on the implementation of standard Windwows NT kernel mode drivers; Key information on the workings of Windows NT I/O Manager, including how I/O requests are described and passed among drivers; and detailed technical information on interrupt management and synchronization issues.

Sample Content

Table of Contents

I. WINDOWS NT ARCHITECTURE.

1. Windows NT Operating System Overview.

Windows NT Major Characteristics. Multithreading. Multitasking. Demand Paged Virtual Memory. Multiprocessing. Processor Architecture Independence. Microkernel Model. Integrated Networking. Multiple Operating System Emulation. User Mode Programs and Environment Subsystems. Bypassing the Environment Subsystem. The Native Windows NT API. The Win32 Environment Subsystem. The Windows NT Executive. I/O Manager. Security Reference Monitor. Process Manager. Local Procedure Call Facility. Memory Manager and Cache Manager. Win32 Support Components. Windows Support Components. Windows NT Microkernel. Hardware Abstraction Layer.

2. Achieving Hardware Independence with the HAL.

The HALs Role in the Windows NT Operating System. Device Addressing. I/O Architecture. Choosing the correct HAL Function for Device Access. HAL Buffer Functions. Interrupt Management. DMA Operations. Other HAL Facilities. Processor Architecture Differences Not Handled by the HAL.

3. Virtual Memory.

Demand Paged Virtual Memory. Rationale for Demand Paged Virtual Memory. Memory Manager Operations. Address Space Separation and Control. Memory Sharing. Copy-On-Write. Memory-Mapped Files. Paging. Address Translation. Page Tables. Virtual-t o-Physical Address Translation. Virtual Address Descriptor. Context. Physical Memory Management. Page Frame Database. The Page Recovery Algorithm. Section Object. Memory-Manager Tuning. Drivers and VM. Memory Descriptor Lists. Structured Exception Handling.

4. The Registry.

Viewing and Modifying the Registry. Registry Organization. Subkeys, Values, and Data Types. Managing Wide Character Strings. Registry Keys of Interest to Device Driver Developers. HARDWARE. SOFTWARE. The SYSTEM Subkey and Control Sets.

5. Dispatching and Scheduling.

Dispatching. Scheduling. Thread Properties. Pre-emption. The Impact of Scheduling on Drivers.

6. Interrupt Request Levels and DPCs.

Understanding Interrupt Request Levels (IRQLs). IRQLs Are Not Scheduling Priorities. Determining the IRQL. How IRQLs Are Used. IRQL PASSIVE_LEVEL. IRQL APC_LEVEL. IRQL DISPATCH_LEVEL. DIRQLS. IRQL HIGH_LEVEL. Deferred Procedure Calls (DPCs). DPC Objects. Invoking and Servicing DPCs. DPC Object Characteristics. The DpcForIsr.

7. Multiprocessor Issues.

The Problem with Shared Data. Using Locks to Serialize Access to Shared Data. Spin Locks. Executive Spin Locks. Interrupt Spin Locks. Spin Lock Implementations on Uniprocessor Systems. Spin Lock Issues.

II. THE I/O MANAGER AND DEVICE DRIVER DETAILS.

8. I/O Architectures.

Programmed I/O Devices. Busmaster DMA Devices. Two Categories of Busmaster DMA Devices. Logical Addresses. Scatter/Gather. System DMA Devices.

9. The I/O Manager.

I/O Subsystem Design Characteristics: An Overview. The NT I/O Subsystem Is Consistent and Highly Structured. The NT I/O Subsystem Is Portable Across Platforms. The NT I/O Subsystem Is Configurable. The NT I/O Subsystem Is Pre-emptible and Interruptible. The NT I/O Subsystem Is Multiprocessor Safe. The NT I/O Subsystem Is Object-Based. File Objects. Driver Objects. Device Objects. Interrupt Objects. Adapter Objects. The NT I/O Subsystem Is Asynchronous. The NT I/O Subsystem Is Packet-Driven. The NT I/O Subsystem Is Layered.

10. How I/O Requests Are Described.

IRP Structure. Fields in the IRP's Fixed Part. Fields in the IRP I/O Stack Location. Describing Data Buffers. Describing Data Buffers with Direct I/O. Describing Data Buffers with Buffered I/O. Describing Buffers with Neither I/O. Evaluating Available Data Buffer Descriptor Options. I/O Function Codes. Understanding Device I/O Control Functions (IOCTLs). Defining Custom IOCTLs. I/O Request Parameters. Handling and Processing IRPs. Case Study: When Neither I/O Was the Only Alternative.

11. The Layered Driver Model.

Kernel Mode Drivers. File System Drivers. Intermediate Drivers. Device Drivers. Mini-Drivers. Intermediate and Device Driver Layering. File System Driver Layering. Finding the Driver at the Top of the Stack. Understanding Driver Structure. Processing I/O Requests in Layers. Processing the IRP Itself. Passing IRPs to Lower-Layer Drivers. Creating Additional IRPs to Be Passed to Lower-Level Drivers. Advantages of the Layered Driver Model. Completion Notification. Driver Capabilities in a Completion Routine. Special Understandings Between Drivers. Filter Drivers. Filter Driver Usage Guidelines. Fast I/O. Case Study: The Importance of Load Order.

12. Driver Structure.

Driver Entry Points. Understanding Driver Organization. Loading and Initialization. Request Processing for Device Drivers. Request Processing for Intermediate Drivers. Dynamic Unloading. Request Processing Context.

13. Driver Entry.

Determining Device Configuration. Resource Lists, Descriptors, and Partial Descriptors. Querying System Configuration Data. Querying Bus- Configuration Data. Querying the Registry. Creating Device Objects. Device Extensions. Device Names. Device Types and Characteristics. Device Exclusivity. Device-Naming Considerations. Device Symbolic Links. Claiming Hardware Resources. Translating Bus Addresses. Mapping Logical Addresses to Kernel Virtual. Address Space. Examples: Translating Bus Addresses. Highlights of Bus Address Translation. Exporting Entry Points. Connecting to Interrupts and the Registering DpcForIsr. Translating Interrupt Levels and Vectors. Connecting Driver ISR to Interrupts. Initializing the DPC Object for the DpcForIsr. Getting an Adapter Object. Performing Device Initialization. Other DriverEntry Operations. Intermediate Buffers for DMA Devices. I/O Timers. Intermediate and Filter Drivers. Dynamic Driver Unloading.

14. Dispatch Entry Points.

Validating Requests. Completing Requests. Boosting I/O Request Thread Priority. How the I/O Manager Completes Requests. Pending and Queuing Requests. System Queuing. Driver Queuing. Supplementary Device Queues. Request Processing. Synchronous Processing and Completion. Asynchronous Processing and Completion. Combining Synchronous and Asynchronous Approaches. Shutdown Notification. Cancel Processing. System Queuing and IRP Cancellation. Driver Queuing and IRP Cancellation. Canceling In-Progress Requests. Summary.

15. Interrupt Service Routines and DPCs.

Interrupt Service Routines. Processing Within an ISR. Interrupt Sharing and ISRs. The DpcForIsr Entry Point. Processing Within the DpcForIsr. ISR and DpcForIsr Design. ISR Versus DPC. ISR to DPC Routine Latency. Case Study.

16. Programmed I/O Data Transfers.

Processing Programmed I/O Data Transfers. Getting the Requestor's Buffer Address. Getting the Requestor's Buffer Length. Manipulating the Device to Request and Control the Transfer. Moving the Data Between the Device and the Requestor's Buffer. Programmed I/O Example Driver. Dispatch and StartIo Routine. DPC Routine. DPC Versus ISR in the Example Driver. Design Issues for Programmed I/O Device Drivers. Mapping Device Memory into User Space. Polling. Synchronous Driver Implementations.

17. DMA Data Transfers.

Processing DMA Data Transfers. Adapter Objects. Map Registers. DMA Device Architectures. Packet-Based DMA. Common-Buffer DMA. Comparing Packet-Based DMA with Common-Buffer DMA. Packet-Based DMA Transfers. Preparing for the Transfer. Programming the Device. Completing the Transfer. Propogating Driver Execution. Common-Buffer DMA Transfers. Allocating the Common Buffer. Performing the Transfer. Propogating Driver Execution. Packet-Based DMA Driver Example. Dispatch Routine. Preparing for the Transfer. Programming the Device. Interrupt Service Routine. Completing the Transfer and Propogating Driver Execution. Design Issues for DMA Device Drivers. Alignment Restrictions. System DMA.

18. Building and Debugging Drivers.

Setting Up the Driver Development Environment. Getting the Necessary Software. Setting Up the Systems. Setting Up Debugging. Building Drivers. Driver Debugging. Kernel Debugger Extensions. Debugging and Testing Hints and Tips. Displaying Output in WinDbg. Where to Build Your Project. Installing Multiple System Images on Your Test System. Turning Up the Serial Port Speed. SysRq Stops the Test System. Asserting Assumptions. ASSERT () Works Only in the Checked Build. Define Your Own ASSER T () Macro. Test on MP Systems. Use the Tools Supplied in the DDK. Check Your Driver Performance Monitor. Enable Pool Checking. Test on Both the Free and Checked Builds. Stay Up-to-Date. Turn to the World for Help. Behind the Blue Screen. Blue Screen Format. Reporting on Interpreting Blue Screens. Crash Dumps.

19. Creating a Finished Driver.

Driver Error Logging. Defining Error Messages. Allocating the Error Log Packet. Writing Packets to the Event Log. Invoking the Message Compiler with BUILD. Registering Your Driver As an Event Logging Source. Defining Driver Version Resources. Defining .RC Files from the Microsoft- Supplied Templates. Creating Your Own Resource-Definition File.

20. Installing and Starting Drivers.

How Drivers Are Started. Driver Service Entries. Driver- and Device-Specific Parameters. Driver Installation. Text Setup. GUI Setup. Custom Setup.

III. ALTERNATE NT DRIVER ARCHITECTURES.

21. File System Drivers.

File System Driver Characteristics. FSDs Are Called in the Context of the Requesting Thread. FSDs Are Tightly Integrated with the VM Subsystem. FSDs Are Closely Intertwined with the I/O and Object Managers. Learning More About Developing File System Drivers.

22. Video Miniport Drivers.

Video Port/Miniport Drivers. Video Port Drivers. Video Miniport Drivers. Display Drivers. Device Display Interface (DDI) Drivers. DMA and Video Display Drivers. Learning More About Developing Video Display Drivers.

23. SCSI Miniport Drivers.

SCSI Miniport Driver Characteristics. SCSI Miniport Driver Structure. Initialization. Request Initiation. Interrupt Service. Learning More About Developing SCSI Miniport Drivers.

24. NDIS Miniport Drivers.

The NDIS Family of Standards. The Windows NT Networking Architecture. NDIS Driver Types and the NDIS Library. NDIS LAN Miniport Drivers. Initialization. Transmit Processing. Interrupt and DPC Processing. Transmit Completion. Message Reception. Serialization. Learning More About Developing NDIS Drivers.

IV. APPENDIXES.

Appendix A: Windows NT Status Codes/Win 32 Error Codes.
Appendix B: Sources of Information for Driver Writers.

This Book's Web Pages. Periodicals and Journals. The NT Insider. Windows NT Magazine. Dr Dobb's Journal;. Microsoft's Knowledge Base. Newsgroups, Mailing List, and FAQs. comp.os.ms- windows.programmer.nt.kernel.mode. microsoft.public.win32.p rogrammer.kernel. NTDEV Mailing List. NTSFD Mailing List. DDK-L Mailing List. The Windows NT Kernel-Mode Driver FAQ. Seminars. OSR Open Systems Resources, Inc (http://ww.osr.com). David Solomon Expert Seminars (http://www.solsem.com).

Appendix C: Changes in NT V5.0.

NT V4.0 Device Drivers on NT V5.0.0. Driver Entry Changes. Driver Entry in NT V5.0. The AddDevice Entry Point. Processing Plug and Play IRPs. DMA Implementation Changes. Power Management. IRP_MN_QUERY_POWER. IRP_MN_SET_POWER. IRP_MN_WAIT_WA KE.

Index.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.