Nicht aus der Schweiz? Besuchen Sie lehmanns.de
The Windows NT Device Driver Book - Art Baker

The Windows NT Device Driver Book

A Guide for Programmers

Art Baker (Autor)

Media-Kombination
544 Seiten
1997
Prentice Hall
978-0-13-184474-2 (ISBN)
CHF 75,35 inkl. MwSt
zur Neuauflage
  • Titel erscheint in neuer Auflage
  • Artikel merken
Zu diesem Artikel existiert eine Nachauflage
This is a guide book with software for programmers writing device drivers for Windows NT. This is the only book and sample software available on Device Drivers--NT.
18447-3 The most comprehensive, authoritative guide to Windows NTA (R) driver development. Now that Windows NT is rapidly becoming the business operating system of choice, more and more programmers are faced with developing Windows NT drivers. To write NT drivers well, you first need to understand the Windows NT driver architecture. But you'll also know a myriad of practical details that are rarely, if ever, documented. The Windows NT Device Driver Book tells you all you need to know. It clarifies the murky Microsoft Driver Development Kit (DDK) documentation, and contains extensive detail that's missing from the DDK. This information is invaluable right now-and it will prepare you for the future, when Microsoft introduces the common Win32 Driver Model for Windows NT and WindowsA (R) 95. You'll learn about the NT I/O Manager and its data structures, and discover how various hardware issues will impact the design of your driver. Once you know the fundamentals, Windows NT device driver expert Art Baker presents basic and advanced NT driver-writing techniques in unprecedented detail.Learn about: *Full-duplex driver architecture *Techniques for handling time-out conditions *Logging device errors *Kernel-mode threads, higher-level drivers, and class drivers for SCSI devices.
The Windows NT Device Driver Book is replete with practical detail, including: *The mechanics of setting up a driver development environment *How to analyze crash dumps and make WINDBG work for you *Detailed information on common bugcheck codes There's also extensive sample code on diskette, designed to help streamline your own development projects. Whether you're designing or coding Win NT driver or porting an existing driver from another operating system environment, The Windows NT Device Driver Book contains all the information you'll need to get the job done.

Preface. Acknowledgments. 1 Introduction to Windows NT Drivers. Overall System Architecture. Design Goals for Windows NT. Hardware Privilege Levels in Windows NT. Base Operating System Components. Whats in the Executive. Extensions to the Base Operating System. More about the Win32 Subsystem. Kernel-Mode I/O Components. Design Goals for the I/O Subsystem. Layered Drivers in Windows NT. SCSI Drivers. Network Drivers. Special Driver Architectures. Video Drivers. Printer Drivers. Multimedia Drivers. Drivers for Legacy 16-bit Applications. Summary. 2 The Hardware Environment. Hardware Basics. Device Registers. Accessing Device Registers. Device Interrupts. Data Transfer Mechanisms. Direct Memory Access (DMA) Mechanisms. Device-Dedicated Memory. Requirements for Autoconfiguration. Buses and Windows NT. ISA-The Industry Standard Architecture. MCA-The Micro Channel Architecture. EISA-The Extended Industry Standard Architecture. PCI-The Peripheral Component Interconnect. Hints for Working with Hardware. Learn about the Hardware. Make Use of Hardware Intelligence. Test the Hardware. Summary. 3 Kernel-Mode I/O Processing. How Kernel-Mode Code Executes. Exceptions. Interrupts. Kernel-Mode Threads. Use of Interrupts by NT. CPU Priority Levels. Interrupt Processing Sequence. Software-Generated Interrupts. Deferred Procedure Calls (DPCs). Operation of a DPC. Behavior of DPCs. Access to User Buffers. Buffer-Access Mechanisms. Structure of a Kernel-Mode Driver. Driver Initialization and Cleanup Routines. I/O System Service Dispatch Routines. Data Transfer Routines. Resource Synchronization Callbacks. Other Driver Routines. I/O Processing Sequence. Request Preprocessing by NT. Request Preprocessing by the Driver. Data Transfer. Postprocessing by the Driver. Postprocessing by the I/O Manager. Summary. 4 Drivers and Kernel-Mode Objects. Data Objects and Windows NT. Windows NT and OOP. NT Objects and Win32 Objects. I/O Request Packets (IRPs). Layout of an IRP. Manipulating IRPs. Driver Objects. Layout of a Driver Object. Device Objects and Device Extensions. Layout of a Device Object. Manipulating Device Objects. Device Extensions. Controller Objects and Controller Extensions. Layout of a Controller Object. Manipulating Controller Objects. Controller Extensions. Adapter Objects. Layout of an Adapter Object. Manipulating Adapter Objects. Interrupt Objects. Layout of an Interrrupt Object. Manipulating Interrupt Objects. Summary. 5 General Development Issues. Driver Design Strategies. Use Formal Design Models. Use Incremental Development. Use the Sample Drivers. Coding Conventions and Techniques. General Recommendations. Naming Copnventions. Header Files. Status Return Values. NT Driver Support Routines. Discarding Initialization Routines. Controlling Driver Paging. Driver Memory Allocation. Memory Available to Drivers. Working with the Kernel Stack. Working with the Pool Areas. System Support for Memory Suballocation. Unicode Strings. Unicode String Datatypes. Working with Unicode. Interrupt Synchronization. The Problem. Interrupt Blocking. Rules for Blocking Interrupts. Synchronization Using DFeferred Procedure Calls. Synchronizing Multiple CPUs. How Spin Locks Work. Using Spin Locks. Rules for Using Spin Locks. Linked Lists. Singly-Linked Lists. Doubly-Linked Lista. Removing Blocks from a List. Summary. 6 Initialization and Cleanup Routines. Writing a DriverEntry Routine. Execution Context. What a DriverEntry Routine Does. Initializing DriverEntry Points. Creating Device Objects. Choosing a Buffering Strategy. NT and Win32 Device Names. Code Example: Driver Initialization. INIT.C. Writing Reinitialize Routines. Execution Context. What a Reintializae Routine Does. 6.4 Writing an Unload Routine. Execution Context. What an Unload Routine Does. Code Example: Driver Cleanup. UNLOAD.C. Writing Shutdown Routines. Execution Context. What a Shutdown Routine Does. Enabling Shutdownb Notification. Testing the Driver. Testing Procedure. The WINOBJ Utility. Summary. 7 Hardware Initialization. Finding Auto-Detected Hardware. How Auto-Detectoin Works. Auto-Detected Hardware and the Registry. Querying the Hardware Database. What a ConfigCallback Routine Does. Using Configuration Data. Traqnslating Configuration Data. Code Example: Locating Auto-Detected Hardware. AUTOCON.C. Finding Unrecognized Hardware. Adding Driver Parameters to the Registry. Retrieving Parameters from the Registry. Other Sources of Device Information. Code Example: Querying the Registry. REGCON.C. Allocating and Releasing Hardware. How Resource Allocation Works. How to Claim Hardware Resources. How to Release Hardware. Mapping Device Memory. Loading Device Microcode. Code Example: Allocating Hardware. RESALLOC.C. Summary. 8 Driver Dispatch Routines. Enabling Driver Dispatch Routines. I/O Request Dispatching Mechanism. Enabling Specific Function Codes. Deciding Which Function Codes to Support. Extending the Dispatch Interface. Defining Private IOCTL Values. IOCTL Argument-Passing Methods. Writing IOCTL Header Files. Writing Driver Dispatch Routines. Execution Context. What Dispatch Routines Do. Exiting the Dispatch Routine. Processing Specific Kinds of Requests. Processing Read and Write Requests. Processing IOCTL Requests. Managing IOCTL Buffers. Testing Driver Dispatch Routines. Testing Procedure. Sample Test Program. Summary. 9. Programmed I/O Data Transfers. How Programmed I/O Works. What Happens during Programmed I/O. Synchronizing Various Driver Routines. Driver Initialization and Cleanup. Initializing the Start I/O Entry Point. Initializing a DpcForlsr Routine. Connecting to an Interrupt Source. Disconnecting from an Interrupt Source. Writing a Start I/O Routine. Execution Context. What the Start I/O Routine Does. Writing an Interrupt Service Routine (ISR). Execution Context. What the Interrupt Service Routine Does. Writing a DpcForIsr Routine. Execution Context. What the DpcForlsr Routine Does. Priority Increments. Some Hardware: The Parallel Port. How the Parallel Port Works. Device Registers. Interrupt Behavior. A Driver for the Parallel Port. Code Example: Parallel Port Driver. XXDRIVER.H. INIT.C. TRANSFER.C. Testing the Data Transfer Routines. Testing Procedure. Summary. 10 Timers. Handling Device Timeouts. How I/O Timer Routines Work. How to Catch Device Timeout Conditions. Code Example: Catching Device Timeouts. XXDRIVER.H. INIT.C. TRANSFER.C. TIMER.C. Managing Devices without Interrupts. Working with Noninterrupting Devices. How CustomTimerDpc Routines Work. How to Set Up a CustomTimerDpc Routine. How to Specifiy Expiration Times. Other Uses for CustomTimerDpc Routines. Code Example: A Timer-Based Driver. XXDRIVER.H. INIT.C. TRANSFER.C. Summary. 11 Full-Duplex Drivers. Doing Two Things at Once. Do You need to Process Concurrent IRPs? How the Modified Driver Architecture Works. Data Structures for a Full-Duplex Driver. Implementing the Alternate Path. Using Device Queue Objects. How Device Queue Objects Work. How to Use Device Queue Objects. Writing CustomDpc Routines. How to Use a CustomDpc Routine. Execution Cointext. Canceling I/O Requests. How IRP Cancellation Works. Synchronization Issues. What a Cancel Routine Does. What a Duispatch Cleanup Routine Does. Some More Hardware: The 16550 UART. What the 16550 UART Does. Device Registers. Interrupt Behavior. Code Example: Full-Duplex UART Driver. What to Expect. DEVICE_EXTENSION in XXDRIVER.H. DISPATCH.C. DEVQUEUE.C. INPUT.C. ISR.C. CANCEL.C. Summary. 12 DMA Drivers. How DMA Works Under Windows NT. Hiding DMA Hardware Variaitons with Adapter Objects. Solving the Scatter/Gather Problem with Mapping Registers. Managing I/O Buffers with Memory Descriptor Lists. Maintaining Cache Coherency. Categorizing DMA Drivers. Limitations of the NT DMA Architecture. Working with Adapter Objects. Fiding the Right Adapter Object. Acquiring and Releasing the Adapter Object. Setting Up the DMA Hardware. Flushing the Adapter Object Cache. Writing a Packet-Based Slave DMA Driver. How Packett-Based Slave DMA Works. Splitting DMA Transfers. Code Example: A Packet-Based Slave DMA Driver. XXDRIVER.H. REGCON.C. TRANSFER.C. Writing a Packet-Based Bus Master DMA Driver. Setting Up Bus Master Hardware. Hardware with Scatter/Gather Support. Building Scatter/Gather Lists with IoMapTransfer. Writing a Common Buffer Slave DMA Driver. Allocating a Common Buffer. Using Common Buffer Slave DMA to Maintain Throughput. Writing a Common Buffer Bus Master DMA Driver. How Common-Buffer Bus Master DMA Works. Summary. 13 Logging Device Errors. Event-Logging in Windows NT. Deciding What to Log. How Event Logging Works. Working with Messages. How Message Codes Work. Writing Message Definition Files. A Small Example: XXMSG.MC. Compiling a Message Definition Files. Adding Message Resources to az Driver. Registering a Driver as an Event Source. Generating Log Entries. Preparing a Driver for Error Logging. Allocating an Error-Log Packet. Logging the Error. Code Example: An Error-Logging Routine. EVENTLOG.C. Summary. 14 System Threads. System Threads. When to Use Threads. Creating and Terminating System Threads. Managing Thread Priority. System Worker Threads. Thread Synchronization. Time Synchronization. General Synchronization. Using Dispatcher Objects. Event Objects. Sharing Events between Drivers. Mutex Objects. Semaphore Objects. Timer Objects. Thread Objects. Variations on the Mutex. Synchronization Deadlocks. Code Example: A Thread-Based Driver. How the Driver Works. The DEVICE__EXTENSION Structure in XXDRIVER.H. The XxCreateDevice Function in INIT.C. The XxDispatchReadWrite Function in DISPATCH.C. THREAD.C. TRANSFER.C. Summary. 15 Higher-Level Drivers. An Overview of Intermediate Drivers. What Are Intermediate Drivers? Should You Use a Layered Architecture? Writing Layered Drivers. How Layered Drivers Work. Initialization and Cleanup in Layered Drivers. Code Fragment: Connecting to Another Driver. Other Initialization Concerns for Layered Drivers. I/O Request Processing in Layered Drivers. Code Fragment: Calling a Lower-Level Driver. Writing I/O Completion Routines. Requesting an I/O Completion Callback. Execution Context. What I/O Completion Routines Do. Code Fragment: An I/O Completion Routine. Allocating Additional IRPs. The IRPs I/O Stack Revisited. Controlling the Siz of the IRP Stack. Creating IRPs with IoBuildSynchronousFsdRequest. Creating IRPs with IoBuildAsynchronouysFsdRequest. Creating IRPs with IoBuildDeviceIoControlRequest. Creating IRPs from Scratch. Setting Up Buffers for Lower Drivers. Keeping Track of Driver-Allocated IRPs. Writing Filter Drivers. How Filter Drivers Worl. Initialization and Cleanup in Filter Drivers. What Happens behind the Scenes. Making the Attachment Transparent. Code Example: A Filter Driver. YYDRIVER.H-Driver Data Structures. INIT.C-Initialization Code. DISPATCH.C-Filter Dispatch Routines. COMPLETE.C-I/O Completions Routines. Writing Tightly Coupled Drivers. How Tightly Coupled Drivers Work. Initialization and Cleanup in Tightly Coupled Drivers. I/O Request Processing in Tightly Coupled Drivers. Summary. 16. Building and Installing Drivers. Building Drivers. What BUILD Does. How to Build a Driver. Writing a SOURCES File. Log Files Generated by BUILD. Recursive BUILD Operations. Miscellaneous BUILD-Time Activities. Using Precompiled Headers. Including Version Information in a Driver. Incl.uding Nonstandard Components in a BUILD. Moving Driver Symbol Data into .DBG Files. Installing Drivers. How to Install a Driver by Hand. Driver Registry Entries. End-User Installation of Standard Drivers. End-User Installation of Nonstandard Drivers. Controlling Driver Load Sequence. Changing the Drivers Start Value. Creating Explicit Dependenceies between Drivers. Establishing Global Group Dependencies. Controlling Load Sequence within a Group. Summary. 17. Testing and Debugging Drivers. Some Guidelines for Driver Testing. The General Approach to Testing Drivers. Using the Microsoft Hardware Compatibility Tests (HCTs). Some Thoughts about Driver Bugs. Categories of Driver Errors. Reproducing Driver Errors. Coding Strategies That Reduce Debugging. Keeping Track of Driver Bugs. Reading Crash Screens. What Happens When the System Crashes. Layout of a STOP Message. Deciphering STOP Messages. An Overview of WINDBG. The Key to Source-Code Debugging. A Few WINDBAG Commands. Analyzing a Crash Dump. Goals of the Analysis. Starting the Analysis. Tracing the Stack. Indirect Methods of Investigation. Analyzing Crashes with DUMPEXAM. Interactive Debugging. Starting and Stopping a Debug Session. Setting Breakpoints. Setting Hard Breakpoints. Writing WINDBG Extensions. How WINDBG Extensions Work. Initialization and Version-Checking Functions. Writing Extension Commands. WINDBG Helper Functions. Building and Using and Extension DLL. Code Example: A WINDBG Extension. XXDBG.C. XXDBG.DEF. SOUIRCES file. Sample Output. Miscellaneous Debugging Techniques. Leaving Debug Code in the Driver. Catching Incorrect Assumptions. Using BugCheck Callbacks. Catching Memory Leaks. Using Counters, Bits, and Buffers. Summary. 18. Driver Performance. General Guidelines. Know Where Youre Going. Get to Knowe the Hardware. Explore Creative Driver Designs. Optimize Code Creatively. Measure Everything You Do. Performance Monitoring in Windows NT. Some Terminology. How Performance Monitoring Works. How Drivers Export Performance Data. Adding Counter Names to the Registry. Counter Definitions in the Registry. Writing LODCTR Command Files. Using LODCTR and UNLODCTR. The Format of Performance Data. Overall Structure of Performance Data. Types of Counters. Objects with Multiple Instances. Writing the Data-Collection DLL. Contents of the Data-Collection DLL. Error Handling in a Data-Collection DLL. Installing the DLL. Code Example: A Data-Collection DLL. XXPERF.C. Building and Installing this Example. Summary. Appendix A: The Development environment. Hardware and Software Requirements. Connecting the Host and Target. Debug Symbol Files. Enabling Crash Dumps on the Target System. If You Dont Get Any Crash Dump Files. Enabling the Target Systems Debug Client. Appendix B: Common Bugcheck Codes. General Problems with Drivers. Synchronization Problems. Corrupted Driver Data Structures. Memory Problems. Hardware Failures. Configuration Manager and Registry Problems. File System Problems. System Initialization Failures. Internal System Failures. Bibliography. About the Author. Index.

Erscheint lt. Verlag 7.1.1997
Verlagsort Upper Saddle River
Sprache englisch
Maße 178 x 235 mm
Gewicht 793 g
Themenwelt Informatik Betriebssysteme / Server Windows
Informatik Betriebssysteme / Server Windows Server
Mathematik / Informatik Informatik Netzwerke
ISBN-10 0-13-184474-1 / 0131844741
ISBN-13 978-0-13-184474-2 / 9780131844742
Zustand Neuware
Haben Sie eine Frage zum Produkt?