Attaching Vista Target to WinDbg

Dear All,

I developed a Hello World driver and launching it using OSRDriverLoader on Windows Vista.

I connected the system to Server 2003 machine which has WinDbg:6.7.005.1 installed on it.

Inorder to view the Hello World message on WinDbg I followed the following steps:

  1. Enabled bcdedit/dbgsettings serial debugport:1 baudrate:115200

  2. Connected both machine serial ports using NULL Modem cable.

  3. Launched WinDbg and selected Kernel Debugging with same 115200 COM1 settings.

Windbg gives the message "Opened \.\com1 Waiting to reconnect…

Status bar shows Debuggee not connected.

Do I need to do modify any other setting inorder to view the driver output message on WinDbg.

Regards.

Yes.

  • Press Ctrl+Break to break in to the debugger.

  • Make sure that you have symbols loaded correctly:

.symopt+ 0x80000000
.sympath srv*c:\symbols*http://msdl.microsoft.com/download/symbols
.reload -f -n
lml

This should list all modules, the vast majority of which should have a
pdb file listed; this needs to be true at least for ‘nt.’

  • Turn on all output from KdPrint(), which is disabled by default on
    Vista/Longhorn.

ed nt!Kd_DEFAULT_Mask 0x0F

Resume the machine:

g

Good luck,

mm

xxxxx@gmail.com wrote:

Dear All,

I developed a Hello World driver and launching it using OSRDriverLoader on Windows Vista.

I connected the system to Server 2003 machine which has WinDbg:6.7.005.1 installed on it.

Inorder to view the Hello World message on WinDbg I followed the following steps:

  1. Enabled bcdedit/dbgsettings serial debugport:1 baudrate:115200

  2. Connected both machine serial ports using NULL Modem cable.

  3. Launched WinDbg and selected Kernel Debugging with same 115200 COM1 settings.

Windbg gives the message "Opened \.\com1 Waiting to reconnect…

Status bar shows Debuggee not connected.

Do I need to do modify any other setting inorder to view the driver output message on WinDbg.

Regards.

It is not clear from the list below so I will ask:

Did you reboot the Vista (target) system after enabling kernel debugging?
The setting only takes effect after a reboot. The debugger must be attached
at the time the target boots for the target to recognize that the KD is
connected.

When you do get it working, remember that driver (kernel) debug output is
suppresess in Vista/LH and that you will need to modify the
nt!Kd_DEFAULT_MASK value. Doron explains it better than I could in his
blog post

http://blogs.msdn.com/doronh/archive/2006/11/14/where-did-my-debug-output-go
-in-vista.aspx

Good Luck,
-dave

David R. Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, December 12, 2007 1:40 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Attaching Vista Target to WinDbg

Dear All,

I developed a Hello World driver and launching it using OSRDriverLoader on
Windows Vista.

I connected the system to Server 2003 machine which has WinDbg:6.7.005.1
installed on it.

Inorder to view the Hello World message on WinDbg I followed the following
steps:

  1. Enabled bcdedit/dbgsettings serial debugport:1 baudrate:115200

  2. Connected both machine serial ports using NULL Modem cable.

  3. Launched WinDbg and selected Kernel Debugging with same 115200 COM1
    settings.

Windbg gives the message "Opened \.\com1 Waiting to reconnect…

Status bar shows Debuggee not connected.

Do I need to do modify any other setting inorder to view the driver output
message on WinDbg.

Regards.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Also, the com port you specify to windbg is the com port the serial cable is
plugged into on the system that is running windbg, not the system being
debugged. Check your serial cable and verify that it is plugged into com1 on
both systems.

On Dec 12, 2007 7:13 AM, Martin O’Brien wrote:

> Yes.
>
> - Press Ctrl+Break to break in to the debugger.
>
> - Make sure that you have symbols loaded correctly:
>
> .symopt+ 0x80000000
> .sympath srvc:\symbolshttp://msdl.microsoft.com/download/symbols
> .reload -f -n
> lml
>
> This should list all modules, the vast majority of which should have a
> pdb file listed; this needs to be true at least for ‘nt.’
>
> - Turn on all output from KdPrint(), which is disabled by default on
> Vista/Longhorn.
>
> ed nt!Kd_DEFAULT_Mask 0x0F
>
> Resume the machine:
>
> g
>
> Good luck,
>
> mm
>
> xxxxx@gmail.com wrote:
> > Dear All,
> >
> > I developed a Hello World driver and launching it using OSRDriverLoader
> on Windows Vista.
> >
> > I connected the system to Server 2003 machine which has WinDbg:6.7.005.1http:</http:>installed on it.
> >
> > Inorder to view the Hello World message on WinDbg I followed the
> following steps:
> >
> > 1. Enabled bcdedit/dbgsettings serial debugport:1 baudrate:115200
> >
> > 2. Connected both machine serial ports using NULL Modem cable.
> >
> > 3. Launched WinDbg and selected Kernel Debugging with same 115200 COM1
> settings.
> >
> > Windbg gives the message "Opened \.\com1 Waiting to reconnect…
> >
> > Status bar shows Debuggee not connected.
> >
> > Do I need to do modify any other setting inorder to view the driver
> output message on WinDbg.
> >
> > Regards.
> >
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

Shouldn’t the com port be specified as debugport=com1 not debugport=1?

Bill Wandel


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of Mark Roddy
Sent: Wednesday, December 12, 2007 7:47 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Attaching Vista Target to WinDbg

Also, the com port you specify to windbg is the com port the serial cable is
plugged into on the system that is running windbg, not the system being
debugged. Check your serial cable and verify that it is plugged into com1 on
both systems.

On Dec 12, 2007 7:13 AM, Martin O’Brien wrote:

Yes.

- Press Ctrl+Break to break in to the debugger.

- Make sure that you have symbols loaded correctly:

.symopt+ 0x80000000
.sympath srvc:\symbolshttp://msdl.microsoft.com/download/symbols
.reload -f -n
lml

This should list all modules, the vast majority of which should have a
pdb file listed; this needs to be true at least for ‘nt.’

- Turn on all output from KdPrint(), which is disabled by default on
Vista/Longhorn.

ed nt!Kd_DEFAULT_Mask 0x0F

Resume the machine:

g

Good luck,

mm

xxxxx@gmail.com wrote:
> Dear All,
>
> I developed a Hello World driver and launching it using OSRDriverLoader on
Windows Vista.
>
> I connected the system to Server 2003 machine which has WinDbg:6.7.005.1
http:</http:> installed on it.
>
> Inorder to view the Hello World message on WinDbg I followed the following
steps:
>
> 1. Enabled bcdedit/dbgsettings serial debugport:1 baudrate:115200
>
> 2. Connected both machine serial ports using NULL Modem cable.
>
> 3. Launched WinDbg and selected Kernel Debugging with same 115200 COM1
settings.
>
> Windbg gives the message "Opened \.\com1 Waiting to reconnect…
>
> Status bar shows Debuggee not connected.
>
> Do I need to do modify any other setting inorder to view the driver output
message on WinDbg.
>
> Regards.
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars http:

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Mark Roddy — NTDEV is sponsored by OSR For our schedule of WDF, WDM,
debugging and other seminars visit: http://www.osr.com/seminars To
unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:>

I don’t believe so. It’s just one of bcdedit’s many fine features. Not
that it’s inherently bad; just different than boot.ini which is what
everyone knows and, I think, was reasonably happy with.

mm

Bill Wandel wrote:

Shouldn’t the com port be specified as debugport=com1 not debugport=1?

Bill Wandel


*From:* xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] *On Behalf Of *Mark Roddy
*Sent:* Wednesday, December 12, 2007 7:47 AM
*To:* Windows System Software Devs Interest List
*Subject:* Re: [ntdev] Attaching Vista Target to WinDbg

Also, the com port you specify to windbg is the com port the serial
cable is plugged into on the system that is running windbg, not the
system being debugged. Check your serial cable and verify that it is
plugged into com1 on both systems.

On Dec 12, 2007 7:13 AM, Martin O’Brien > mailto:xxxxx> wrote:
>
> Yes.
>
> - Press Ctrl+Break to break in to the debugger.
>
> - Make sure that you have symbols loaded correctly:
>
> .symopt+ 0x80000000
> .sympath srvc:\symbolshttp://msdl.microsoft.com/download/symbols
> .reload -f -n
> lml
>
> This should list all modules, the vast majority of which should have a
> pdb file listed; this needs to be true at least for ‘nt.’
>
> - Turn on all output from KdPrint(), which is disabled by default on
> Vista/Longhorn.
>
> ed nt!Kd_DEFAULT_Mask 0x0F
>
> Resume the machine:
>
> g
>
> Good luck,
>
> mm
>
> xxxxx@gmail.com mailto:xxxxx wrote:
> > Dear All,
> >
> > I developed a Hello World driver and launching it using
> OSRDriverLoader on Windows Vista.
> >
> > I connected the system to Server 2003 machine which has
> WinDbg:6.7.005.1 http:</http:> installed on it.
> >
> > Inorder to view the Hello World message on WinDbg I followed the
> following steps:
> >
> > 1. Enabled bcdedit/dbgsettings serial debugport:1 baudrate:115200
> >
> > 2. Connected both machine serial ports using NULL Modem cable.
> >
> > 3. Launched WinDbg and selected Kernel Debugging with same
> 115200 COM1 settings.
> >
> > Windbg gives the message "Opened \.\com1 Waiting to reconnect…
> >
> > Status bar shows Debuggee not connected.
> >
> > Do I need to do modify any other setting inorder to view the
> driver output message on WinDbg.
> >
> > Regards.
> >
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars http:
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
> –
> Mark Roddy — NTDEV is sponsored by OSR For our schedule of WDF, WDM,
> debugging and other seminars visit: http://www.osr.com/seminars To
> unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer</http:></mailto:xxxxx></mailto:xxxxx>

Regrets for continuing the thread after a long gap. I find some time to do
some exercise of debugging the KMDF driver.

As the responses suggested I specified the symbol path under File menu and
then selected Kernel Debugging option with com1 and 115200 baud rate.

I restarted the target Vista machine. Even after pressing ctrl+Break in
Windbg shows Opened \.\com1
waiting to reconnect

Status bar indicates Debuggee not connected.

I tried by selected Pipe and Reconnect check boxes. Any pointers to debug
helloworld.sys using windbg.

Regards.

On Dec 12, 2007 5:25 AM, Martin O’Brien wrote:

> I don’t believe so. It’s just one of bcdedit’s many fine features. Not
> that it’s inherently bad; just different than boot.ini which is what
> everyone knows and, I think, was reasonably happy with.
>
>
> mm
>
>
> Bill Wandel wrote:
> > Shouldn’t the com port be specified as debugport=com1 not debugport=1?
> >
> > Bill Wandel
> >
> > ------------------------------------------------------------------------
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
> > Sent: Wednesday, December 12, 2007 7:47 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Attaching Vista Target to WinDbg
> >
> > Also, the com port you specify to windbg is the com port the serial
> > cable is plugged into on the system that is running windbg, not the
> > system being debugged. Check your serial cable and verify that it is
> > plugged into com1 on both systems.
> >
> >
> > On Dec 12, 2007 7:13 AM, Martin O’Brien > > mailto:xxxxx> wrote:
> >
> > Yes.
> >
> > - Press Ctrl+Break to break in to the debugger.
> >
> > - Make sure that you have symbols loaded correctly:
> >
> > .symopt+ 0x80000000
> > .sympath srv
c:\symbols
http://msdl.microsoft.com/download/symbols
> > .reload -f -n
> > lml
> >
> > This should list all modules, the vast majority of which should have
> a
> > pdb file listed; this needs to be true at least for ‘nt.’
> >
> > - Turn on all output from KdPrint(), which is disabled by default on
> > Vista/Longhorn.
> >
> > ed nt!Kd_DEFAULT_Mask 0x0F
> >
> > Resume the machine:
> >
> > g
> >
> > Good luck,
> >
> > mm
> >
> > xxxxx@gmail.com mailto:xxxxx wrote:
> > > Dear All,
> > >
> > > I developed a Hello World driver and launching it using
> > OSRDriverLoader on Windows Vista.
> > >
> > > I connected the system to Server 2003 machine which has
> > WinDbg:6.7.005.1 http:</http:> installed on it.
> > >
> > > Inorder to view the Hello World message on WinDbg I followed the
> > following steps:
> > >
> > > 1. Enabled bcdedit/dbgsettings serial debugport:1
> baudrate:115200
> > >
> > > 2. Connected both machine serial ports using NULL Modem cable.
> > >
> > > 3. Launched WinDbg and selected Kernel Debugging with same
> > 115200 COM1 settings.
> > >
> > > Windbg gives the message "Opened \.\com1 Waiting to reconnect…
> > >
> > > Status bar shows Debuggee not connected.
> > >
> > > Do I need to do modify any other setting inorder to view the
> > driver output message on WinDbg.
> > >
> > > Regards.
> > >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars http:
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> >
> >
> > –
> > Mark Roddy — NTDEV is sponsored by OSR For our schedule of WDF, WDM,
> > debugging and other seminars visit: http://www.osr.com/seminars To
> > unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></http:></mailto:xxxxx></mailto:xxxxx>

What are your bcdedit settings? Try bcdedit /enum /v and post the results.

Good luck,

mm

Bhaskar wrote:

Regrets for continuing the thread after a long gap. I find some time to
do some exercise of debugging the KMDF driver.

As the responses suggested I specified the symbol path under File menu
and then selected Kernel Debugging option with com1 and 115200 baud rate.

I restarted the target Vista machine. Even after pressing ctrl+Break
in Windbg shows Opened \.\com1
waiting to reconnect

Status bar indicates Debuggee not connected.

I tried by selected Pipe and Reconnect check boxes. Any pointers to
debug helloworld.sys using windbg.

Regards.

On Dec 12, 2007 5:25 AM, Martin O’Brien > mailto:xxxxx> wrote:
>
> I don’t believe so. It’s just one of bcdedit’s many fine features. Not
> that it’s inherently bad; just different than boot.ini which is what
> everyone knows and, I think, was reasonably happy with.
>
>
> mm
>
>
> Bill Wandel wrote:
> > Shouldn’t the com port be specified as debugport=com1 not
> debugport=1?
> >
> > Bill Wandel
> >
> >
> ------------------------------------------------------------------------
>
> > From: xxxxx@lists.osr.com
> mailto:xxxxx
> > [mailto:xxxxx@lists.osr.com
> mailto:xxxxx] On Behalf Of Mark Roddy
> > Sent: Wednesday, December 12, 2007 7:47 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Attaching Vista Target to WinDbg
> >
> > Also, the com port you specify to windbg is the com port the serial
> > cable is plugged into on the system that is running windbg, not the
> > system being debugged. Check your serial cable and verify that it is
> > plugged into com1 on both systems.
> >
> >
> > On Dec 12, 2007 7:13 AM, Martin O’Brien <
> xxxxx@evitechnology.com mailto:xxxxx
> > mailto:xxxxx> mailto:xxxxx>> wrote:
> >
> > Yes.
> >
> > - Press Ctrl+Break to break in to the debugger.
> >
> > - Make sure that you have symbols loaded correctly:
> >
> > .symopt+ 0x80000000
> > .sympath srv
c:\symbols

> http://msdl.microsoft.com/download/symbols
> > .reload -f -n
> > lml
> >
> > This should list all modules, the vast majority of which
> should have a
> > pdb file listed; this needs to be true at least for ‘nt.’
> >
> > - Turn on all output from KdPrint(), which is disabled by
> default on
> > Vista/Longhorn.
> >
> > ed nt!Kd_DEFAULT_Mask 0x0F
> >
> > Resume the machine:
> >
> > g
> >
> > Good luck,
> >
> > mm
> >
> > xxxxx@gmail.com mailto:xxxxx
> mailto:xxxxx> wrote:
> > > Dear All,
> > >
> > > I developed a Hello World driver and launching it using
> > OSRDriverLoader on Windows Vista.
> > >
> > > I connected the system to Server 2003 machine which has
> > WinDbg:6.7.005.1 http: http:</http:>
> installed on it.
> > >
> > > Inorder to view the Hello World message on WinDbg I
> followed the
> > following steps:
> > >
> > > 1. Enabled bcdedit/dbgsettings serial debugport:1
> baudrate:115200
> > >
> > > 2. Connected both machine serial ports using NULL Modem
> cable.
> > >
> > > 3. Launched WinDbg and selected Kernel Debugging with same
> > 115200 COM1 settings.
> > >
> > > Windbg gives the message "Opened \.\com1 Waiting to
> reconnect…
> > >
> > > Status bar shows Debuggee not connected.
> > >
> > > Do I need to do modify any other setting inorder to view the
> > driver output message on WinDbg.
> > >
> > > Regards.
> > >
> >
> > —
> > NTDEV is sponsored by OSR
> >
> > For our schedule of WDF, WDM, debugging and other seminars visit:
> > http://www.osr.com/seminars http:
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> >
> >
> > –
> > Mark Roddy — NTDEV is sponsored by OSR For our schedule of WDF,
> WDM,
> > debugging and other seminars visit: http://www.osr.com/seminars
> http: To
> > unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
></http:></http:></http:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

***************************************************************
bcdedit /enum /v
***************************************************************
Windows Boot Manager

identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795}
device partition=D:
description Windows Boot Manager
locale en-US
inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
default {0d4fc2c4-b218-11dc-98e2-99ae3f46ab1c}
displayorder {0d4fc2c4-b218-11dc-98e2-99ae3f46ab1c}
{5e3ec4a1-b221-11dc-8f76-0000000073bd}
toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d}
timeout 7

Windows Boot Loader

identifier {0d4fc2c4-b218-11dc-98e2-99ae3f46ab1c}
device partition=D:
path \Windows\system32\winload.exe
description Vista Business N
locale en-US
inherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
osdevice partition=D:
systemroot \Windows
resumeobject {0d4fc2c5-b218-11dc-98e2-99ae3f46ab1c}
nx OptIn

Windows Boot Loader

identifier {5e3ec4a1-b221-11dc-8f76-0000000073bd}
device partition=C:
path \Windows\system32\winload.exe
description Vista Ultimate
osdevice partition=C:
systemroot \Windows
resumeobject {e4bf8b63-3c31-11d8-ae2a-806e6f6e6963}

*****************************************************
bcdedit /dbgsettings results
*****************************************************

C:\Windows\system32>bcdedit /dbgsettings
debugtype Serial
debugport 1
baudrate 115200

You haven’t set your boot configuration to include kernel debugging. As
is the case with everything with bcdedit, this is less than obvious,
as well as inconvenient. Assuming that you want to set your current
default configuration to support debugging:

bcdedit /set {default} debug on
bcdedit /set {default} debugtype serial
bcdedit /set {default} debugport 1
bcdedit /set {default} baudrate 115200

That ought to do it.

Good luck,

mm

xxxxx@gmail.com wrote:

***************************************************************
bcdedit /enum /v
***************************************************************
Windows Boot Manager

identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795}
device partition=D:
description Windows Boot Manager
locale en-US
inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
default {0d4fc2c4-b218-11dc-98e2-99ae3f46ab1c}
displayorder {0d4fc2c4-b218-11dc-98e2-99ae3f46ab1c}
{5e3ec4a1-b221-11dc-8f76-0000000073bd}
toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d}
timeout 7

Windows Boot Loader

identifier {0d4fc2c4-b218-11dc-98e2-99ae3f46ab1c}
device partition=D:
path \Windows\system32\winload.exe
description Vista Business N
locale en-US
inherit {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
osdevice partition=D:
systemroot \Windows
resumeobject {0d4fc2c5-b218-11dc-98e2-99ae3f46ab1c}
nx OptIn

Windows Boot Loader

identifier {5e3ec4a1-b221-11dc-8f76-0000000073bd}
device partition=C:
path \Windows\system32\winload.exe
description Vista Ultimate
osdevice partition=C:
systemroot \Windows
resumeobject {e4bf8b63-3c31-11d8-ae2a-806e6f6e6963}

*****************************************************
bcdedit /dbgsettings results
*****************************************************

C:\Windows\system32>bcdedit /dbgsettings
debugtype Serial
debugport 1
baudrate 115200

Thanks for the guidance. I followed the same steps and after rebooting found “Debug Enabled” message in Boot Menu.

Now the WinDbg recognizes the Vista client and prints all the debugging messages.

Apart from viewing only output messages is it possible to debug the client code step by step. If yes do I need to specify the source file path from the network share. Any other setting needs to be considered.

Regards.