By manually set the network cable kernel mode debugger

Debugging Tools for Windows kernel debugging support via Ethernet. This topic describes how to manually set the Ethernet debugging.
Running the debugger called the host computer, the computer being debugged is called the target computer. The host must be running Windows XP or later, the destination computer must be running Windows 8 or later. Compared with other types of cables, for debugging the network has the following advantages.
  • Host and target computer can be anywhere on the local network.
  • Debugging multiple target computers from a single host computer is easy.
  • Cable cheap and readily available.
  • For any two computers that have Ethernet adapter. They are less likely to have a serial port or 1394 port.

Supported Network Adapters

The host can use any network adapter, but the destination computer must use the Windows debugging tools to support network adapters.

To determine the IP address of the host

Determine the IP address of the host using one of the following procedures.

  •   On the host, open a command prompt window and enter the following command: ipconfig
    next note IPv4 address debugging network adapter to be used.
  • On the target computer, open a command prompt window and enter the following command, where host name is the host name: the ping -4 HostName

Select Network Debug Port

Select the port number to be used for debugging on the host and target computers. You can choose any number between 49152-65535. You choose the port will be run on the host debugger open for exclusive access. Please note that the selected port number to any other applications running on the host computer is not in use. Range of port numbers that can be used to debug network may be limited corporate network policies. What you can not tell from the host restriction Yes. To determine whether the company's strategy to limit the scope of the network ports can be used for debugging, please contact your network administrator. If you connect multiple target computers to a single host, each connection must have a unique port number. For example, if the target computer 100 is connected to a host, port 50000 can be assigned to the first connection, the second connection port 50001 to assign the connection to a third distribution ports 50002, and so on. Port different hosts can use the same range (50000-50099) 100 is connected to another target computer.

Setting the target computer

1, verify whether the target computer has a supported network adapter.
2, or using standard Cat5 cable to better support the adapter connected to a network hub or switch. Do not use a crossover cable, do not use the hub or cross port switch.
3, at an elevated command prompt window, enter the following command, where wxyz is the host's IP address, n is the port number of your choice:

bcdedit /debug on 
bcdedit /dbgsettings net hostip:w.x.y.z port:n 

4, bcdedit displayed key automatically generated. Copy key and on a removable storage device (such as a USB flash drive) in its storage. When you start a debugging session on a host, you need a key. It is strongly recommended that you use auto-generated keys. However, you can create your own key, as will "create your own key" section.

5, if the destination computer has multiple network adapters, use the Device Manager to determine the PCI bus, device, and function number to be used for debugging adapter. Then elevated command prompt window, enter the following commands, wherein b, d, and f is the bus number, device number and function number of the adapter:

bcdedit /set "{dbgsettings}" busparams b.d.f 

6, restart your computer

If the target computer is located in the docking station, and a network debugging is enabled docking station in the network adapter, do not remove the computer from the docking base. If you need to remove the target computer from the docking station, disable kernel debugging. To disable kernel debugging on the target computer, open a command prompt window as an administrator, and then enter the command bcdedit / debug off. Restart the target computer.

Set Host

Using standard Cat5 (or higher) cable to connect the network adapter to the host network hub or switch. Do not use a crossover cable, do not use the hub or cross port switch.

Start a debugging session

On the host, open windbg. On the "File" menu, select "Kernel Debugging." In the "kernel debugger" dialog box, open the "Network" tab. Enter the port number and key. Click "OK." You may also be prompted by opening a command window and enter the following command to start the session with windbg, where n is the port number, key to set the target computer is automatically generated by the bcdedit key:
windbg -k net:port=n,key=Key

If you are prompted to allow access to the port through the firewall windbg, windbg is allowed access to all the different types of network ports. The first time you try to establish a network debugging connection, you may be prompted to allow debug applications (windbg or kd) access through the firewall. The client version of Windows displays a prompt, but the server version of Windows does not display the prompt. You should be prompted to respond by selecting the domain, private and public three network types check box. If you are not prompted or not prompted to select the check box is available, you must use the "Control Panel" to allow access through the firewall. Open the "Control Panel> System and Security" and then click "Allow applications through Windows Firewall." In the application list, locate the Windows GUI symbolic debugger and the Windows kernel debugger. Use the check boxes allow both applications through the firewall. Restart debug applications (windbg or kd).

How debugger obtain the IP address of the target computer

Kernel debugger drivers on the target computer tries to use Dynamic Host Configuration Protocol (DHCP) to obtain a routable IP address is used for debugging network adapter. If the driver get a DHCP address assignment, then the target computer can be debugged by the host located anywhere on the network. If the driver is unable to obtain a DHCP address assignment, it uses the automatic private IP address (the APIPA) to obtain a link-local IP address. Link-local IP address is not routable, so the host and target link-local IP address can not communicate through a router. In this case, if the host and target computer into the same network hub or switch, network debugging will work.

Guess you like

Origin www.cnblogs.com/yilang/p/11428744.html