4.1.1 Establishing a Kernel Debugging Session
Set up a kernel debugging session as follows:
-
Connect the host and target machines with a null-modem serial cable, using any
available port. The connection should then be tested. For details on the cable
and how to test a connection, see Section
4.1.2.
-
On the target machine:
-
Install the checked build of Windows NT. It is necessary that this be the same
version of Windows NT as you install on the host. For more information on
installing a checked build of Windows NT, please see the Getting Started
guide.
-
Install your driver. For more information on installing Windows NT device
drivers, see Chapter 2 of this guide.
-
Enable kernel debugging for this system using the appropriate options for the
port that is connected to the host machine. For more information on enabling
debugging, see Section
4.1.4
-
On the host machine:
-
Install the free build of Windows NT. It is necessary that this be the same
version of Windows NT as you install on the target. For more information on
installing a free build of Windows NT, please see the Getting Started
guide.
-
Install the SDK, which also installs WinDbg.
-
Copy the symbols from the target machine to the host machine into the symbol
tree. For information on the exact layout of the symbol tree see Section
4.1.5.
-
Copy your driver’s source to the host machine.
-
Start WinDbg with kernel debugging enabled. For more information on
starting WinDbg as a kernel debugger, see Section
4.1.6
-
Using the User DLLs dialog box from the Options menu, specify the symbol
search path to the symbol tree where you copied the required symbols.
-
Using the Debug dialog box from the Options menu, specify the source search
path to where you copied the source for your driver.
-
Select Go from the Run menu and wait for “KD: waiting to connect...” message
to appear in the Command window.
-
Boot the target machine and select the version of Windows NT for which you
enabled kernel debugging. To have WinDbg automatically stop the system
at initial load time, you can set the Initial Breakpoint option in the Options
dialog.
-
To break into WinDbg, press CTRL+C on the host machine, or press SYSRQ
on the target machine. To continue execution, select Go from the Run menu.