The terminology of the debug environment for drivers should be clear. The target machine executes the driver under test. The host machine, sometimes referred to as the development system, runs the debugger (e.g., WinDbg) and therefore controls the operation of the target. The two machines are connected together using a null-modem serial cable. Another important but confusing term is debug client. The target machine must be booted into a special environment whereby it installs the debug client between the serial port and its operating system code. The debug client is the small block of code that allows the host debugger, via the serial port, to control the operation of the target system. The term can be confusing because the target installs and executes the debug client, yet the code makes the target a slave of the host. For convenience, a network connection between machines is usually established. This ensures that files can be quickly exchanged providing that both machines are operational. (Never forget that while the target is paused by WinDbg, it cannot participate in network operations.) Host SystemThe host system is typically used to compile and link the test driver, and it runs WinDbg as a kernel debugger. Therefore, if a choice exists, choose the machine with the more powerful set of hardware resources as the host system. The list of software that a host should contain follows:
The host does not necessarily need to execute the same OS version as the target, but it is more convenient. The host requires the symbol file for the OS version running on the target (and it cannot be networked from the target). Thus, if the host and target OS versions do not match, two versions of OS symbols may conceivably be present on the host system. With each launch of WinDbg, thought must be given to which OS symbol file set to use for the session. Target SystemThe target system provides the execution environment for the test driver. It is typically configured with the following:
As explained later in this chapter, the BOOT.INI file on the target must be configured to allow selection of the appropriate Windows 2000 kernel (retail or checked). The checked version runs with considerable assertion and debug code enabled (at the cost of reduced OS performance). The extra code can produce intermediate output that is helpful for tracing some driver or driver-related bugs. Connecting the Host and TargetTo debug a driver interactively with WinDbg, the host and target must be connected using serial ports on each machine. A standard null-modem cable can be used. Since COM ports come in two flavors of connectors, DB-9 and DB-25 (both male on the computer), a dual-headed cable (Y DB-9 and DB-25 female connectors at each end) is the preferred accessory. For the do-it-yourselfer, Table A.1 shows the necessary connections. The debug client does not use the flow control mechanisms of RS-232, but the universal jumpering scheme of DTR to DSR (Data Terminal Ready to Data Set Ready) and RTS to CTS (Request To Send to Clear To Send) is a good idea and cannot hurt. Table A.2 shows the signal assignments for the different cable connectors.
|