The Windows NT Device Driver Book: A Guide for Programmers - Softcover

9780131844742: The Windows NT Device Driver Book: A Guide for Programmers
View all copies of this ISBN edition:
 
 
Finally, there's a book that makes it easier to write device drivers for Windows NT. This book serves as a tutorial on Windows NT's I/O processing mechanisms, driver installation and performance issues--and as a "cookbook" containing complete, easy-to-adapt code for developing your own drivers. The disk contains all the code discussed in the book.

"synopsis" may belong to another edition of this title.

From the Publisher:
The most comprehensive, authoritative guide to Windows NT 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. This book explains the complex Windows driver architecture, and presents insights into a myriad of practical details that are rarely, if ever, documented. It clarifies the murky Microsoft Driver Documentation Kit (DDK) documentation, and contains extensive detail missing from the DDK. This information is essential now, and will prepare developers for the future, when Microsoft introduces the common Win32 Driver Model for Windows NT and Windows 95. Learn about the NT I/O Manager and its data structures, and discover how various hardware issues impact driver design. Learn about full-duplex driver architecture, techniques for handling time-out conditions, logging device errors, kernel-model threads, higher-level drivers, and class drivers for SCSI devices. Understand how to set up a driver development environment and analyze crash dumps. Includes extensive sample code on diskette, designed specifically to help streamline development projects. For all Windows programmers who have a role in writing device drivers.
From the Inside Flap:


In case you haven't guessed, this book explains how to write, install, and debug kernel-mode device drivers for Windows NT. If you're in the process of designing or coding an NT driver, or if you're porting an existing driver from some other operating system, this book is a valuable companion to the Microsoft DDK documentation.

This book might also have something to say to you if you just need a little more insight into the workings of Windows NT, particularly the I/O subsystem. Perhaps you're trying to decide if NT is a reasonable platform for some specific purpose. Or you may be studying operating systems, and you want to see how theory gets applied in the real world.

And of course, we mustn't discount the power of morbid curiosity. The same fascination that forces us to slow down as we drive past a car accident can also motivate us to pull a volume off the bookstore shelf.

What You Should Already Know

Throughout this book, I make several assumptions about what you already know. First of all, you need to have all the basic Windows NT user skills such as logging in and running various utilities. Since driver installation requires you to have administrator-level privileges, you can trash things pretty badly if you don't know how to use the system.

Second, you'll need decent C-language programming skills. I've tried to avoid the use of “cleverness” in my code examples, but you still have to be able to read them.

Next, some experience with Win32 user-mode programming is helpful, but it isn't really required. If you haven't worked with the Win32 API, you might want to browse through volume two of the Win32 Programmers Reference. This is the one that describes system services. Take a look at the chapters on the I/O primitives (CreateFile, ReadFile, WriteFile, and DeviceIoControl) and the thread-model. See the bibliography for other books on Win32 programming.

Finally, you need to understand something about hardware in order to write drivers. It would be helpful if you already had some experience working with hardware, but if not, Chapter 2 will give you a basic introduction. Again, the bibliography will point you toward other, more-detailed sources for this kind of information.

What You'll Find Here

One of the most difficult choices any author has to make is deciding what to write about and what to leave out. In general, I've attempted to focus on core issues that are crucial to kernel-mode driver development. I've also tried to provide enough background information so that you'll be able to read the sample code supplied with the NT DDK, and make intelligent design choices for your own drivers.

The overall flow of the book goes from the theoretical to the practical, with earlier chapters providing the underpinnings for later topics. Here's what's covered:

Chapters 1-5: The first part of this book provides the basic foundation you'll need if you plan to write drivers. This includes a general examination of the Windows NT driver architecture, a little bit about hardware, and a rather detailed look at the NT I/O Manager and its data structures. This group of topics ends with some general kernel-mode coding guidelines and techniques.

Chapters 6-13: These eight chapters form the nucleus of the book and present all the details of writing kernel-mode NT device drivers. You'll also find discussions here of full-duplex driver architectures, handling timeout conditions, and logging device errors. Unless you're already familiar with NT's driver architecture, you should probably read these chapters in order.

Chapters 14 and 15: The next two chapters deal with alternative driver architectures supported by Windows NT. This includes the use of kernel-mode threads in drivers and higher-level drivers.

Chapters 16-18: The final part of the book deals with various practical details of writing NT drivers. Chapter 16 takes a look at all the things your mother never told you about the BUILD utility. Chapter 17 covers various aspects of testing and debugging drivers, including how to analyze crash dumps and how to really get WINDBG to work. If you're actually writing a driver while you read this book, you may want to read these chapters out of order. Chapter 18 examines the crucial issue of driver performance and how to tie your driver into NT's performance monitoring mechanisms.

Appendices: The appendices cover various topics that people in my classes have asked about. The first one deals with the mechanics of setting up a driver development environment.

The second appendix contains a list of the bugcheck codes you're most likely to encounter, along with descriptions of their various parameters. Used in conjunction with the material in Chapter 17, this may help you track down the cause of a blue screen or two.

What You Won't Find

I excluded topics from this book for several reasons. Some subjects were just too large to cover. Others addressed the needs of too small a segment of the driver-writing community. Finally, some areas of driver-development are simply unsupported by Microsoft. Specifically, you won't find anything here about the following items:

File system drivers: At the time this book went to press, Microsoft still hadn't released any kind of developer's kit for NT file system drivers. In fact, there seemed to be a great deal of resistance to the idea within Microsoft. Until this situation changes, there's not much point in talking about the architecture of file system drivers.

Net-card and network protocol drivers: NDIS and TDI drivers are both very large topics—large enough to fill a book of their own. Unfortunately, there just wasn't enough room for all of it here. I can offer one bit of consolation: The material in this book will give you much of the background you need in order to understand what's happening inside the NDIS/TDI framework.

SCSI miniport and class drivers: Although SCSI HBA miniport drivers are vital system components, the number of people actually writing them is (I suspect) rather small. Consequently, the only reference to SCSI miniports is the overview material in Chapter 1.

I would have liked to include a discussion of SCSI class drivers in this book, but unfortunately there just wasn't any time to write it. The material on developing intermediate drivers in Chapter 15 will give you much of the necessary background. Fro m there, take a look at the sample SCSI class driver for CD-ROMs that comes with the NT DDK.

Video, display, and printer drivers: This is another area where I had to make a tradeoff between the number of people writing these kinds of drivers and the time available to finish the book. Unfortunately, graphics drivers for video and hardcopy de vices didn't make the cut this time. Perhaps in a later, expanded version of the book.

Virtual DOS device drivers: In my opinion, the best way to run 16-bit MS-DOS and Windows applications under Windows NT is to port the source code to Win32. In any event, the Microsoft documentation does a decent job describing the mechanics of writing VDDs so I haven't included anything about them here.

About the Sample Code

There's a great deal of sample driver code scattered throughout this book. You'll find all of it on the accompanying floppy disk. I've created separate directories on the floppy for each chapter, and where appropriate, subdirectories for each component or driver in the chapter.

Coding style: Since the purpose of this book is instruction, I've done a couple things to improve the clarity of the samples. First, I've adopted a coding style that avoids smart tricks. Some of the examples could probably have been written in fewer lines of code, but I don't think they would have been as easy to understand. Also in the name of clarity, I've eliminated everything except the bare essentials from each sample. For example, most of the drivers don't contain any error-logging or debugging code, although a real driver ought to include these things. These topics have their own chapters, and you shouldn't have too much trouble back-fitting the code into other sample drivers.

Naming conventions: You'll notice that almost all the sample drivers appearing in this book are called “XXDRIVER.” (The only exception is the higher-level driver Chapter 15. Its name is “YYDRIVER.” ) This makes it somewhat easier to interchange the parts of different samples. It also reduces the amount of clutter that you'll be adding to the Registry while you're playing with these drivers. Within any particular driver, I've also adopted the convention of adding the prefix, Xx to the names of any driver-defined functions. Similarly, device registers, driver structures, and constants are also prefixed with XX_. This makes it easy to see which things you have to write and which ones come from the folks at Microsoft.

Platform dependencies: It's worth mentioning that

"About this title" may belong to another edition of this title.

  • PublisherPrentice Hall
  • Publication date1996
  • ISBN 10 0131844741
  • ISBN 13 9780131844742
  • BindingPaperback
  • Edition number1
  • Number of pages544

Top Search Results from the AbeBooks Marketplace

Stock Image

Art Baker
Published by Prentice Hall (1996)
ISBN 10: 0131844741 ISBN 13: 9780131844742
New Paperback Quantity: 1
Seller:
GoldenWavesOfBooks
(Fayetteville, TX, U.S.A.)

Book Description Paperback. Condition: new. New. Fast Shipping and good customer service. Seller Inventory # Holz_New_0131844741

More information about this seller | Contact seller

Buy New
US$ 46.72
Convert currency

Add to Basket

Shipping: US$ 4.00
Within U.S.A.
Destination, rates & speeds
Stock Image

Art Baker
Published by Prentice Hall (1996)
ISBN 10: 0131844741 ISBN 13: 9780131844742
New Paperback Quantity: 1
Seller:
Wizard Books
(Long Beach, CA, U.S.A.)

Book Description Paperback. Condition: new. New. Seller Inventory # Wizard0131844741

More information about this seller | Contact seller

Buy New
US$ 48.41
Convert currency

Add to Basket

Shipping: US$ 3.50
Within U.S.A.
Destination, rates & speeds
Stock Image

Art Baker
Published by Prentice Hall (1996)
ISBN 10: 0131844741 ISBN 13: 9780131844742
New Paperback Quantity: 1
Seller:
Grumpys Fine Books
(Tijeras, NM, U.S.A.)

Book Description Paperback. Condition: new. Prompt service guaranteed. Seller Inventory # Clean0131844741

More information about this seller | Contact seller

Buy New
US$ 47.93
Convert currency

Add to Basket

Shipping: US$ 4.25
Within U.S.A.
Destination, rates & speeds
Stock Image

Art Baker
Published by Prentice Hall (1996)
ISBN 10: 0131844741 ISBN 13: 9780131844742
New Paperback Quantity: 1
Seller:
GoldBooks
(Denver, CO, U.S.A.)

Book Description Paperback. Condition: new. New Copy. Customer Service Guaranteed. Seller Inventory # think0131844741

More information about this seller | Contact seller

Buy New
US$ 50.77
Convert currency

Add to Basket

Shipping: US$ 4.25
Within U.S.A.
Destination, rates & speeds
Stock Image

Baker, Art
Published by Prentice Hall (1996)
ISBN 10: 0131844741 ISBN 13: 9780131844742
New Paperback Quantity: 1
Seller:
The Book Spot
(Sioux Falls, SD, U.S.A.)

Book Description Paperback. Condition: New. Seller Inventory # Abebooks30870

More information about this seller | Contact seller

Buy New
US$ 59.00
Convert currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, rates & speeds
Stock Image

Art Baker
Published by Prentice Hall (1996)
ISBN 10: 0131844741 ISBN 13: 9780131844742
New Softcover Quantity: 1
Seller:
BennettBooksLtd
(North Las Vegas, NV, U.S.A.)

Book Description Condition: New. New. In shrink wrap. Looks like an interesting title! 1.75. Seller Inventory # Q-0131844741

More information about this seller | Contact seller

Buy New
US$ 58.06
Convert currency

Add to Basket

Shipping: US$ 5.43
Within U.S.A.
Destination, rates & speeds