The debugging in kernel mode requires a destination machine and a DDH. The target machine runs the kernel-State Program, and the host machine runs the debugger.
There is no need to use the same system or version of Windows on the target and host machines.
The kernel-state debugging does not require a specific free version or a version (free version and checked version) build. There is no limit on free or checked for the host and target host.
The default debug output serial port of the target machine is com2. You can modify the variable debugport.
The default host Input Serial Port is com1. modify _ nt_debug_port to modify this.
Ready target machine
To allow the target machine to allow kernel-state debugging, modify the boot. ini file and add a/debug option to it. Boot. ini can be found in the C root directory. If you are using Windows XP, refer to the http://support.microsoft.com/kb/289022/zh-cn to find a way to modify boot. ini.
Example:
[Boot loader]
Timeout = 30
Default = multi (0) disk (0) RDISK (0) Partition (1) \ winnt
[Operating systems]
Multi (0) disk (0) RDISK (0) Partition (1) \ WINNT = "Microsoft Windows 2000 Professional"/fastdetect/maxmem = 512/debugport = COM1/baudrate = 115200
When Windows cannot be started and you have no chance to edit boot. ini, you can press F8 to start Windows in safe mode. In security mode, only the least necessary drivers and the least system devices are loaded at startup. If the boot is successful, you can edit boot. ini.
If the boot partition is formatted as fat, you can use MS-dos and edit boot. ini. because boot. INI is hidden. You can use the following command in DOS to view it: Dir/AH.
You can use the following command to remove its hidden and read-only attributes. Attrib-r-s-h boot. ini
Ready host machine
To start the debugging of the kernel or user State, the host must install all necessary symbol files and set some environment variables.
The following batch files help you quickly set some environment variables.
Set _ nt_symbol_path = z: \ symbols \ winnt \ 2195 \ symbols
Set _ nt_alt_symbol_path = z: \ symbols \ winnt \ 2195sp1 \ symbols
Set _ nt_debug_port = COM1
Set _ nt_debug_baud_rate = 115211
Set _ nt_log_file_open = z: \ debug \ Debug. Log
Z: \ debug \ kd.exe-v-n
Symbol File
The symbol file stores a variety of information that is not required to run binary files. This information is useful only when debugging is used. Typically, the symbol file contains
1. Global Variables
2. Local Variables
3. function names and their entry addresses
4. FPO data
5. source code line number
Both interactive debugging and crash dump files require the symbol file and the debugger needs to load them.
Note:: The symbol file installed on the host must match the Windows version installed on the target host.