Search code examples
debuggingwindows-xpdriverkernel

How do I get to see DbgPrint output from my kernel-mode driver?


I'm finding it difficult to see the debug output from a kernel-mode driver I'm working on.

I'm new to driver development. I'm trying to debug a USB driver on Windows XP. I've installed the DDK, and built a "checked mode" build of my driver. I've installed the driver and if I use a hex editor to look at my driver's .sys file in windows/drivers, I can see the text of my debug output strings.

If I run an app that uses my driver under Visual Studio, my debug output doesn't appear in the output window, as the application's own debug output does. Searching the web, I find many different claims about how one is supposed to display debug output from the kernel. For kernel debugging in general, people seem to either do remote debugging over a NULL modem cable (Crikey, it's 2012) or use a virtual machine and a virtual com port. Both these approaches seem like a massive amount of work just to be able to see debug output. Is there an alternative?

I've tried using WinDbg in "Local" kernel debugging mode but it doesn't show anything. It warned that I should reboot windows with "/debug" enabled. I did that, but it didn't help.

Any other ideas? Or am I asking for the impossible?


Solution

  • DebugView will show you the trace messages from your driver:

    http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx

    However, you really do need a two machine setup to do any real development work.