Debug the driver using VMware and windbg

Source: Internet
Author: User

I always feel that SoftICE is coming to the end. In 2006, compuare announced that SoftICE development was stopped. The message here does hurt a lot of people. But at the same time, Windows's supporting debuggers, such as windbg and CDB, are constantly updated and feature constantly powerful. You must choose it, although its kernel debugging speed is not ideal. Later, I learned about syser debuger, a good debugger written by Chinese people. Basically, SoftICE commands are similar. It is easy to get started and can be debugged on a single machine. The speed is quite fast. However, to develop a Windows Kernel Program, we recommend that you use windbg. At least windbg is compatible with the system. Because my machine configuration is not high, I usually use syser when playing, but windbg is used when the company actually solves the problem. In addition to slow speed (and tolerable, our company's machine is amd dual-core), windbg is also difficult to use and prepare for the first time, if you use two machines for debugging, there may be more problems. Every time I reinstall the system, I have to go online to find information and then make the preparations over and over again. This is a summary.

First, Download the http://msdl.microsoft.com/download/symbols/packages/windowsxp/WindowsXP-KB835935-SP2-slp-Symbols.exe first? Symbol table, and then install it in the real system.
Download the http://msdl.microsoft.com/download/symbols/debuggers/dbg_x86_6.5.3.8.exe again? The latest version of the windbg program is also installed in the real system.

NextWe have to install the system in the virtual machine. I use WINXP SP2. Modify the boot. ini file after installation. Add a line to the [operating systems] section,
"Multi (0) disk (0) RDISK (0) Partition (1) \ Windows =" Microsoft Windows? XP Professional-Debug "/fastdetect/debug/debugport = COM1/baudrate = 115200"

ThenShut down the system. Prepare the virtual machine hardware, click "Edit Virtual Machine Settings", add a serial port, and select "output to named pipe". Next, keep the default "\\. \ PIPE \ com_1"
Select "this end is the server." In the second frame ."
In the third box, select "the other end is an application ."
Select "connect at power on"
Click "Advanced>" and select "yield CPU on Poll" in the new window ". Save and exit.
Well, all the above is what the virtual machine system has to do.

InReal SystemIn the Device Manager. Find the COM1 port and modify its speed to 115200 on the property page.
Create a windbg shortcut for ease of use. Shortcut Command Behavior
"C: \ Program Files \ debugging tools for Windows \ windbg.exe"-y c: \ windows \ symbols \-B-K COM: Port = \\. \ PIPE \ com_1, baud = 115200, pipe
Here, the path after-Y is the path of the installation symbol table.

In use,First, run the virtual machine system. When bootloader selects the system to enter, we will first press it up and down to stop the countdown. Then run the windbg shortcut we just created in the real system. After running, select the system with the debugging mark in the virtual system. Return to the real system. After a while, we can see that the windbg output tells us that the two systems are connected. Now that the debugger has been connected to the VMWare virtual machine, you can perform the long-awaited debugging.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.