2016-06-30

How to start Windows Kernel debugging on Virtual marchine with Serial port

How to start Windows Kernel debugging on Virtual marchine with Serial port .

Test Setting
Debugger and Debugee have same settings.

  1. Windows 2012 R2
  2. Visual Studio 2013
  3. WDK 8.1
  4. 1 NIC
  5. 1 Serial port

Basically, Kernel debugging dodel is a diagram that is following <fig .1>.

<fig .1>


Therefore, It needs 2 PC for debugging.

Steps for the Debuggee

In other word, Debuggee is called “Target PC”.
  1. Power off  the VM (debuggee).
  2. VM Workstation > Setting> click ‘add…’ > click ‘Serial port’
  3. Choose ‘Named Pipe’ and Enter a pipe name with format. ( ex ‘\\.\pipe\debug’)
  4. Choose “this is … server “ for the near end.
  5. Choose “this is … Application” for the Far end.
  6. Dselect the “Yield on CPU Poll” on the check box
  7. Click ‘ok’ ( Remeber new added serial Port Number )
  8. Power on the VM.

    After booting
  9. Open ‘Device Manager’
  10. Expand the ports that is tree item.
  11. Confirm the new serial port  that you added is working nomally.
    (Recommend to use view menu ‘hidden device show’.
  12. Check the Properties if it is corrent value or not when you had added a new serial port.
  13. Setting up the debug mode with a serial port you made before a step.
bcdedit /debug on
bcdedit /dbgsettings serial debugport:2 baudrate:115200

And, you can see your debug settings with following command.
(bcdedit /dbgsettings)

  1. and Reboot.




Steps for The Debugger

  1. Start  a Windbg.
  2. Click on the File > ‘Kernel Debug’
  3. Move on ‘COM’ tab of the popup window.
  4. Enter value a pipe name on port. ( ex ‘\\.\pipe\debug’ - you entered before )
  5. Select the ‘pipe’ check box, then click ‘OK’
  6. It will printed “Waiting connect..” .

    If it still connecting…
  7. Reboot debuggee , and click on the Debug > break .

    After it is connected, you want to boot debugee continually.
  8. Click on the Debug > go.

No comments:

Post a Comment