Sysprogs forums › Forums › VisualDDK/VirtualKD discussion › Setting up seperate target machine to debug with VisualDDK
- This topic has 1 reply, 1 voice, and was last updated 13 years, 1 month ago by joewac.
-
AuthorPosts
-
October 19, 2011 at 15:43 #374joewacParticipant
Can anyone tell me the specific steps needed to happen on both the Host and a Target to perform kernel level debugging with VisualDDK? Specifically, I am running VisualDDK on a Windows 7 host, with a Windows XP target, and want to debug over IEEE1394.
Is it necessary to be running a checked version of the OS on the target for kernel debugging to work?
Thanks.
October 27, 2011 at 20:09 #1996joewacParticipantI have found the solution. And simple it is.
Target Setup
1) Set up the target for dual boot. Note, this does not mean having two instances of an operating system loaded, just that you can load the same OS with different options. For a Windows XP target, follow directions on the web to easily set up your boot.ini file so that you can dual boot, with one being a normal boot, and the other being a debug boot. Here is what my boot.ini file looks like, which sets up the IEEE1394 interface to work on channel 3 for the debug load.
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)WINDOWS=”1394 Debug Windows XP Professional” /fastdetect /debug /debugport=1394 /channel=3
multi(0)disk(0)rdisk(0)partition(1)WINDOWS=”Microsoft Windows XP Professional” /fastdetectFor Vista and later, check out http://msdn.microsoft.com/en-us/windows/hardware/gg487520 (My target is Windows XP, so I cannot explicitly vouch for this method, though it sounds reasonable).
2) Also on the target, ensure that you have a working IEEE1394 device, then disable it with Device Manager (i.e. in Windows XP, goto Start, Run, and type devmgmt.msc). Open up the IEEE 1394 Bus host controller. Right click on the specific host controller that is attached to you particular IEEE1394 controller, and select disable. I know it sounds strange, but documentation I have found suggests that it improves debugging performance, and there needs to be no active device driver for it to work as a debug port.
3) Reboot your target machine, and select the debug load (in my example above, it would be the first option).
Host Setup
4) On the host machine, ensure that you have a working IEEE1394 device. Bring up Device Manager and ensure that there is an IEEE 1394 host controller installed and working. Note that kernel debugging does not work through this controller, but it will let you know that you have a working controller.
5) Assuming you have the Windows Device Driver Kit installed on the host, and the debuggers installed, bring up the WinDbg debugger as an Administrator. In Windows 7, that can be done simple by right-clicking on the WinDbg application, and select “Run as administrator”. You must be logged in as an Administrator, or if logged in as a standard user, you will need the Administrator password.
6) From WinDbg, select File, Kernel Debug… Then select the 1394 tab, and make sure the Channel is set to 3 (or whatever you selected for your boot.ini on the target above). Hit OK, then Yes to save workspace.
7) If this is the first time bringing up the debugger and selecting the 1394 interface, WinDbg will automatically load the Debugger Drivers for kernel debugging. You can verify this by bringing up Device Manager and seeing that a new class driver was loaded under the class 1394 Debugger Device. Under that class there will be a 1394 Windows Debug Driver (Kernel Mode) driver loaded.
8) Now that the proper drivers are loaded, you can kill WinDbg, and bring up Visual Studio. Select Tools, Attach to Process… In the Transport: pull down, select Kernel-mode connections. Under the Qualifier: pulldown, select, or type, 1394://3, and hit RETURN. Your host should attach to your target.
9) From a Visual Studio VisualDDK project, you get can setup to debug over the 1394 interface by selecting Debug, Driver Launch Settings… and make sure that the 1394 port, channel = radial box is checked, and make sure the channel is set to 3. Then, just select Debug, Start Debugging Driver.
Hope this helps.
-
AuthorPosts
- You must be logged in to reply to this topic.