|
Chapter 1: Driver Development Environment
Chapter 1 Driver Development EnvironmentDeveloping drivers for Microsoft® Windows® 2000 requires at least two machines: one for development and one for debugging.If the driver depends on underlying devices that include high-end workstations and servers, the driver should also be debugged and tested on a multiprocessor machine. This chapter covers the following topics:
1.1 Free Build and Checked BuildThe testing and debugging of drivers for Microsoft Windows 2000 requires both the free build and the checked build of Windows® 2000.
Although the checked build provides extra protection, it consumes more memory and disk space than the free build. System and driver performance is slower for the following reasons:
New driver development usually involves the following steps
In the early stages of driver development it is necessary to use the checked build of Windows 2000 to debug the driver. The additional debugging code in the checked build has protections against many errors that drivers can make (such as recursive spin locks). Performance tuning, final testing, and verification of the driver should be done on the free build. The faster speed of the free build makes it possible to detect race conditions and other synchronization problems. Final testing and verification should also be done on the free build since the free build is the same as the retail version of Windows 2000. The driver code generally contains preprocessor symbols which allow it to be compiled into both free and checked versions. The DBG flag is a reserved symbol that can be used during compilation to determine what build of Windows 2000 is running. If the Windows 2000 checked build is running, DBG is set to 1. If the free build is running, DBG is undefined (or it is set to zero if either the wdm.h or ntddk.h header files are included). Drivers also should be tested and debugged on at least one multiprocessor platform and on at least one uniprocessor platform; both platforms should be running the current version of Windows 2000.
1.2 Debugging EnvironmentKernel-mode debugging requires a target machine and a host machine. The target machine is used to run the driver or another kernel-mode application. The host machine is used to run the debugger.Figure 1.1 shows the typical Microsoft® Windows® 2000 setup used to debug drivers.
Figure 1.1 Typical Windows 2000 debugging setup Kernel debugging does not require specific combinations of the free or checked builds. It is possible to debug a free system from a free or checked system or to debug a checked system from a free or checked system. However, there is generally no reason for the host machine to run the slower checked build. See Debugging Drivers in the online DDK and the Using Microsoft Debuggers documentation for more details.
Last Updated: Friday, July 6, 2001 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||