No print in kernel debug: TARGET is WinXP, HOST is Win7

Hi,

I want to debug one of my driver but I still haven’t found a way to see the KdPrint or DebugPrintEx.

My setup is the following:

Target: (WinXP SP3)

It is where the driver is installed. I’ve also modified the boot.ini file by doing:

bootcfg /debug ON /port COM1 /baud 115200 /ID 1

The driver is compled under this PC.
This PC is then connected to the host using a DB9 NULL cable

Host: (Win7)

Where the WinDbg is running.

I have correctly setup the debug print register for Win Vista and upper (http://www.osronline.com/article.cfm?article=295)

C:\Users\Ben\>reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter"  
  
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug Print Filter  
 DEFAULT REG_DWORD 0xf  

And i’ve also tried to setup using “kd> ed Kd_DEFAULT_MASK 0xF” but this doesn’t work.
I think that all of this is not necessary because my target is winXP.

Finally, I have added the symbols path:

SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols

The connection and symbols are working and I can also setup a specific breakpoint function:

0: kd\> bm pcie_demo!StartDMA\*  
 1: ba418ec4 @!"pcie_demo!StartDMAWrite"  
 2: ba418d8c @!"pcie_demo!StartDMARead"  

However I have no way to see any printf from my driver
I have tried different type of printf function in my driver and none of them work

KdPrint((“Ben KdPrint: StartDMARead\n”));
DbgPrintEx(DPFLTR_IHVDRIVER_ID,DPFLTR_TRACE_LEVEL,“Ben DbgPrintEx: s3_1000.sys: StartDMARead\n”);
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT,“Ben TraceEvent: startDMA Built %s %s”, DATE, TIME);

But the function is correctly called and the breakpoint on this functon is correclty reached.

0: kd\> g  
NOD32 protected [MSAFD Tcpip [TCP/IP]]NOD32 protected [MSAFD Tcpip [UDP/IP]]NOD32 protected [MSAFD Tcpip [RAW/IP]]NOD32 protected [RSVP UDP Service Provider]NOD32 protected [RSVP TCP Service Provider]NOD32 protected [MSAFD Tcpip [TCP/IP]]NOD32 protected [MSAFD Tcpip [UDP/IP]]NOD32 protected [MSAFD Tcpip [RAW/IP]]NOD32 protected [RSVP UDP Service Provider]NOD32 protected [RSVP TCP Service Provider]Breakpoint 2 hit  
pcie_demo!StartDMARead:  
ba418d8c 8bff mov edi,edi  

I hope someone can help me!!!

Cheers,

What about a plain old DbgPrint call?

DbgPrint(“Here!\n”);

Note that the debug print filter stuff (i.e. the registry entry and global
variable) is only Vista+.

-scott
OSR

wrote in message news:xxxxx@windbg…

Hi,

I want to debug one of my driver but I still haven’t found a way to see the
KdPrint or DebugPrintEx.

My setup is the following:

Target: (WinXP SP3)

It is where the driver is installed. I’ve also modified the boot.ini file by
doing:

bootcfg /debug ON /port COM1 /baud 115200 /ID 1

The driver is compled under this PC.
This PC is then connected to the host using a DB9 NULL cable

Host: (Win7)

Where the WinDbg is running.

I have correctly setup the debug print register for Win Vista and upper
(http://www.osronline.com/article.cfm?article=295)

C:\Users\Ben\>reg query   
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug   
Print Filter"  
  
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Debug   
Print Filter  
 DEFAULT REG_DWORD 0xf  

And i’ve also tried to setup using “kd> ed Kd_DEFAULT_MASK 0xF” but this
doesn’t work.
I think that all of this is not necessary because my target is winXP.

Finally, I have added the symbols path:

SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols

The connection and symbols are working and I can also setup a specific
breakpoint function:

0: kd\> bm pcie_demo!StartDMA\*  
 1: ba418ec4 @!"pcie_demo!StartDMAWrite"  
 2: ba418d8c @!"pcie_demo!StartDMARead"  

However I have no way to see any printf from my driver
I have tried different type of printf function in my driver and none of them
work

KdPrint((“Ben KdPrint: StartDMARead\n”));
DbgPrintEx(DPFLTR_IHVDRIVER_ID,DPFLTR_TRACE_LEVEL,“Ben DbgPrintEx:
s3_1000.sys: StartDMARead\n”);
TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT,“Ben TraceEvent: startDMA
Built %s %s”, DATE, TIME);

But the function is correctly called and the breakpoint on this functon is
correclty reached.

0: kd\> g  
NOD32 protected [MSAFD Tcpip [TCP/IP]]NOD32 protected [MSAFD Tcpip   
[UDP/IP]]NOD32 protected [MSAFD Tcpip [RAW/IP]]NOD32 protected [RSVP UDP   
Service Provider]NOD32 protected [RSVP TCP Service Provider]NOD32 protected   
[MSAFD Tcpip [TCP/IP]]NOD32 protected [MSAFD Tcpip [UDP/IP]]NOD32 protected   
[MSAFD Tcpip [RAW/IP]]NOD32 protected [RSVP UDP Service Provider]NOD32   
protected [RSVP TCP Service Provider]Breakpoint 2 hit  
pcie_demo!StartDMARead:  
ba418d8c 8bff mov edi,edi  

I hope someone can help me!!!

Cheers,

Thanks, it is working now…
Could you explain me why the other method don’t ?

KdPrint: Only active in the checked build. I also vaguely remember a sample
that remapped KdPrint to be a WPP trace statement, which is evil and would
cause them to not appear even in the checked build.

DbgPrintEx: I never use it directly, so I don’t remember the filtering
levels to use to get messages by default.

TraceEvents: This is a WPP trace statement, which you need to run TraceView
to see (or use other mystic WinDbg commands to turn on).

DbgPrint: On in both the free and checked build.

-scott
OSR

wrote in message news:xxxxx@windbg…

Thanks, it is working now…
Could you explain me why the other method don’t ?