Hi,
I want to debug our own WDM driver. I want that WinDbg will stop when DriverEntry is called during booting.
I tried and read a lot but it didn?t work.
On the Computer where the driver is running, Windows 7 is installed. In the command line (which I started with administrator rights ( run as admin ) ) I typed
bcdedit /dbgsettings serial debugport:1 baudrate:115200
bcdedit /debug on
On the other Computer With the latest WinDbg version I set correct values for the following environment variables:
_NT_DEBUG_PORT = com1
_NT_DEBUG_BAUD_RATE = 115200
_NT_SYMBOL_PATH = SRV*D:\Symbols*http://msdl.microsoft.com/download/symbols;D:\OurDriver\objchk_win7_x86\i386
_NT_SOURCE_PATH = D:\OurDriver
_NT_DEBUG_LOG_FILE_OPEN = D:\OurDriver\WinDbg.log
Then I started WinDbg ?k. It opend with the message
Opened \. \com1
Waiting to reconnect ?
Now I reseted the other prepared computer ( the computer with the driver ).
But the computer with the driver booted as it always did. It went up right into Windows without any breaks.
And the WinDbg on the other computer still showed:
Opened \. \com1
Waiting to reconnect ?
I googled a lot and tried several things. But nothing worked.
I used PuTTY to check whether the serial connection is ok. This is ok :=) One simple success :=)
Instead of bcdedit I also tried it with msconfig.
I inserted:
KdBreakPoint();
in the DriverEntry function. ? With the fresh compiled OurDriver.sys the Windows really stopped. But the WinDbg on the other machine still said:
Opened \. \com1
Waiting to reconnect ?
I deinstalled the driver of the com1 port on the computer which contains the driver. Since I read somewhere, that the com port must be legacy without any driver.
I googled a lot and tried this test several times. I have no more idea what else I can do.
+++++++++++++++++++
A. Please help me:
+++++++++++++++++++
Can you tell me please what might be wrong in my environment. What I missed to do. What else I can test.
- Thanks in advance for all your hints.
+++++++++++++++++++
B. Furhter questions:
+++++++++++++++++++
Can you also answer me please my questions:
- When I tried to set a break point in WinDbg, I got a dialog telling me ?Debugger must be stopped before breakpoint can be modified?. Even when I started the WinDbg without the option ?k I received this Dialog box when I tried to set a breakpoint.
- How can I stop the debugger ? (I wasn?t able to do this)
-
If everything would work fine. And there wouldn?t be any KdBreakPoint(); in my code. Where would the debugger break / stop, when Windows is booting?
-
Can somebody please tell me a link to a good ?Getting Started ? for debugging a WDM driver with WinDbg over a regular COM (com1) interface with a null modem cable?
-
May be there is another forum here in the MSDN which better fits may problem / questions. If so, can you please tell me it?s name.
Thanks in advance for all your help!