<2024年12月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

文章分类

导航

订阅

通过USB接口进行内核调试

至少两年前就听说Windows将支持通过USB 2.0接口进行内核调试。Vista推出后从它的配置文件中终于看到了配置USB的选项,安转WinDbg6.6后,在建立内核调试的对话框中也可以看到USB的TAB了。

但是帮助文档中却没有详细的说明介绍如何具体操作。于是很多人开始询问:

Yeah yeah yeah ... we've heard THAT before ... :)

Gary G. Little

-----Original Message-----
From: bounce-247538-27300@lists.osr.com
[mailto:bounce-247538-27300@lists.osr.com] On Behalf Of sh_alex
Sent: Thursday, April 06, 2006 1:16 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] softice nms + DDK Suite

Gosh! Sorry...
Will _read_ the question next time, I swear:-)


----- Original Message -----
From: "Brown, Beverly" <bbrown@mc.com>
To: "Windows System Software Devs Interest List" <ntdev@lists.osr.com>
Sent: Thursday, April 06, 2006 1:21 PM
Subject: RE: [ntdev] softice nms + DDK Suite


That's 1394, not USB.

Beverly

-----Original Message-----
From: bounce-247526-9926@lists.osr.com
[mailto:bounce-247526-9926@lists.osr.com] On Behalf Of sh_alex
Sent: Thursday, April 06, 2006 12:15 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] softice nms + DDK Suite

> how do you setup the target to use USB?
> Don't the docs outline how to do this?
They do.

Here's the contents of my target's boot.ini (it's a Media Center, hence
WinMc) for you.  Just match the channel numbers on the host and the
target.

[boot loader]
timeout=5
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="WxpMc + 1394/62 + ntbtlog"
/noexecute=optin /fastdetect /debug /debugport=1394 /channel=62 /bootlog
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="WxpMc" /noexecute=optin
/fastdetect C:\CMDCONS\BOOTSECT.DAT="MS Win Recovery Console" /cmdcons

 

----- Original Message -----
From: "Doron Holan" <Doron.Holan@microsoft.com>
To: "Windows System Software Devs Interest List" <ntdev@lists.osr.com>
Sent: Thursday, April 06, 2006 10:48 AM
Subject: RE: [ntdev] softice nms + DDK Suite


Don't the docs outline how to do this?

d

-- I can spell, I just can't type.
-----Original Message-----
From: bounce-247497-26293@lists.osr.com
[mailto:bounce-247497-26293@lists.osr.com] On Behalf Of Brown, Beverly
Sent: Thursday, April 06, 2006 7:31 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] softice nms + DDK Suite

It's all well and good for windbg to use USB but how do you setup the
target to use USB?

Beverly

-----Original Message-----
From: bounce-247421-9926@lists.osr.com
[mailto:bounce-247421-9926@lists.osr.com] On Behalf Of Doron Holan
Sent: Thursday, April 06, 2006 12:08 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] softice nms + DDK Suite

I asked the debugger guys.  They said things change so fast that by the
time they have a doc on the website, it would be stale.  Perhaps OSR can
do the same thing for usb debugging that they have for 1394.

d

-----Original Message-----
From: bounce-247347-26293@lists.osr.com
[mailto:bounce-247347-26293@lists.osr.com] On Behalf Of David J. Craig
Sent: Wednesday, April 05, 2006 12:15 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] softice nms + DDK Suite

It would be nice if the docs gave specific USB host cable part numbers.
It
is like all the 1394 chipsets on the market.  The TI chipset works best
with Via usually acceptable but not quite as stable.

"Doron Holan" <Doron.Holan@microsoft.com> wrote in message
news:76979@ntdev...
USB2 support is in and in the latest debugger package.  IIRC you need
the OEM to supply a header and you need a "fat" usb cable that acts as a
device between the 2 connectors.

d

-----Original Message-----
From: bounce-247248-26293@lists.osr.com
[mailto:bounce-247248-26293@lists.osr.com] On Behalf Of David J. Craig
Sent: Tuesday, April 04, 2006 9:33 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] softice nms + DDK Suite

Windbg works well with 1394a if you use cards with the TI chipset, which
OSR sells.  It also works well with serial.  I use serial on the target
computers to a serial to USB adapter on my notebook.  I use a RJ-45
network cable to connect the two since those cables are much better
serial cables than serial cables.  The adapter blocks are cute and you
wire them yourself using the docs from windbg.  You can wire them as
full null modem serial

cables even though windbg won't use the handshaking pins.  I heard a
rumor that windbg will work on USB in the future, but I would rather
have 1394a or even 1394b.  Just don't try to debug something on 1394 if
you use it for

debugging.  Use serial then and do the opposite if you need the serial
port for another use.

"Michal Vodicka" <michal.vodicka@upek.com> wrote in message
news:76976@ntdev...
Well, I use it for 10 years for all w9x and NT versions. There were
problems and some betas were unstable but for me it definitely produced
more usefulness than problems. I still have SI installed and start it
when need it for something. It isn't loaded always just because I
usually don't need a debugger; DbgView is quite sufficient for debugging
any reasonably written code :)

As for WinDbg, I don't think its importance ever depended on SoftICE or
DS.
Yes, it was improved and it is great tool for crash dump analysis. Much
better than DS ever was (the GUI part was almost unusable, at least for
me).
But for debugging you have to connect two computers using a cable which
is a PITA and slow. Can it be already connected by USB or Ethernet? I
guess I'll have to subscribe WinDbg list.

BTW, I tried to send an e-mail to former SI lead developer and it was
undeliverable...

Best regards,

Michal Vodicka
UPEK, Inc.
[michal.vodicka@upek.com, http://www.upek.com]


> ----------
> From:
>
bounce-247245-14933@lists.osr.com[SMTP:bounce-247245-14933@lists.osr.com
]
> on behalf of David J. Craig[SMTP:Drivers@yoshimuni.com] Reply To:
> Windows System Software Devs Interest List
> Sent: Wednesday, April 05, 2006 6:05 AM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] softice nms + DDK Suite
>
> It produced more instability than usefulness.  I had tried to use
> BoundsChecker last year and it couldn't find the IRQL correctly.  I
got
> the
> update and it still had problems running on an old video card.  The
serial
> connection wouldn't work either.  I gave up.
>
> When I had to do 9x and NT/2000 it was nice to have one debugger to
work
> on
> both and windbg was really unstable.  Now windbg is much better, but
with
> the demise of SoftIce I hope they don't let it drop in importance.  We
can
> hope, but I am not optimistic.
>
>
> "Michal Vodicka" <michal.vodicka@upek.com> wrote in message
> news:76969@ntdev...
> Ugh. Bad news. I can live without debugger as traces are superior for
> debugging but SI was really useful for quick examination of something
> running in system.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [michal.vodicka@upek.com, http://www.upek.com]
>
> > ----------
> > From:
> >
bounce-247231-14933@lists.osr.com[SMTP:bounce-247231-14933@lists.osr.com
]
> > on behalf of Pankaj Garg[SMTP:xx_pankaj_xx@hotmail.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Wednesday, April 05, 2006 2:48 AM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] softice nms + DDK Suite
> >
> > Looks like DriverStudio (i think including SoftIce) is no more.
From:
> > http://www.compuware.com/products/devpartner/
> > DriverStudio
> > As of April 3rd, 2006 the DriverStudio product family has retired.
For
> > customer support information please contact our FrontLine website.
> >
> > Why don't companies make their products open source before they
> > abandoned them.
> >
> > --
> > Pankaj Garg
> > This posting is provided "AS IS" with no warranties and confers no
> > rights.
> >
> >
> > "Michal Vodicka" <michal.vodicka@upek.com> wrote in message
> > news:76962@ntdev...
> > > ----------
> > > From:
> >
bounce-247109-14933@lists.osr.com[SMTP:bounce-247109-14933@lists.osr.com
]
> > on
> > behalf of Nikolas Stylianides[SMTP:nstyl@4plus.com]
> > > Reply To: Windows System Software Devs Interest List
> > > Sent: Tuesday, April 04, 2006 8:16 AM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] softice nms + DDK Suite
> > >
> > > > My softice version is 4.05.
> > > >
> > > The traditional way does not work. I have tried that long ago. The

> > > nmsym
> > > reports that no debug information found in either sys or pdb.
> > > Did you try this and worked?
> > >
> > Your SI/DS version is very old and obsolete. Support for handling
VC7
> > symbols which DDK compiler uses was added later. You have two
options:>
> > update SI or force DDK compiler to generate VC6 symbols. It is
> > undocumented but I wrote here several times how to do it. Search
> > archives.
However,
> > even
> > if you persuade compiler to generate symbols your old SI can handle,
I
> > seriously doubt such an old version will work with current OSes.
Maybe
> > if
> > you're using w2k SP0 or XP SP0.
> >
> > Best regards,
> >
> > Michal Vodicka
> > UPEK, Inc.
> > [michal.vodicka@upek.com, http://www.upek.com]

下面是OSR的老大Peter(也是那本NT device driver的第一作者)的最终回答:

As promised, I did some checking and here's what I found out regarding USB 2.0 debugging support:

Support for debugging a target system via USB 2.0 is natively in Vista. 

To make USB-based debugging work, you need a special cable that's referred to as a "USB debugger cable" -- The only one that I'm aware of is the PLX Net20DC.  You can google for the part number, but I found them for sale at www.semiconductorstore.com (search for Net20DC in the store, click "order online" to see the price) for a mere $80.  Each.

EnableUSB debugging on the target with the following BCDEdit commands:

bcdedit - debug on
bcdedit -dbgsettings usb targetname:

You must plug the USB debugger cable into PORT 1 of the root hub on the target machine.  You might want to use the USBVIEW utility from the DDK to help you figure out which port is port 1.

On the host machine, you start by plugging BOTH ends of the cable into USB 2.0 ports on the host machine to get the driver loaded.  Then unplug one end and plug it into Port 1 of the root hub on the target (as mentioned above).

I'm going to pass this info on to Hector and ask him to write a memo on this for OSR Online.

Peter
OSR
下面是提供USB线缆的一家公司的产品介绍:

NET20DC™
Hi-Speed USB 2.0 Debug Cable

The NET20DC is a Hi-Speed USB 2.0 Host-to-Host debug cable.  It supports Windows kernel-level debugging with the debugger tool, WinDbg.  At this time, the NET20DC is supported in Windows Vista only.  The NET20DC can be used with any USB host that supports the "Debug Port" defined in the Enhanced Host Controller Interface Specification for Universal Serial Bus.  Debugging with the NET20DC aids mobile systems (without 1394/serial ports) debugging.  For other systems, the NET20DC provides a backup to debugging over the 1394/serial ports. 

 

Hardware requirements include an EHCI host controller that supports kernel debugging and a kernel debugging cable that meets the USB2 Debug Device Functional Specification (.pdf), like the NET20DC.

 

Software requirements include having specific USB kernel debugging driver files.  The BIOS must support Hi-Speed USB 2.0 device communication and must be able to identify the Debug Port # on the Target PC.

Kernel Debugging over USB 2.0

Here's how kernel debugging over USB 2.0 looks:

  • USB 2.0 debug cable must be directly connected to specific Debug Port on Target PC

  • Multiple debug sessions from a single Host are allowed

How to setup the USB 2.0 debug cable:

Microsoft provides instructions on how to setup the USB 2.0 debug cable with Windows Vista.  To obtain these instructions, go to http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

1) Install the 6.6.3.5 version of the 32-bit Windows debugging tools

2) After installation, open the Help file from the Programs group in the Start Menu

3) Search for 'USB' and double-click on the "Setting Up a USB 2.0 Debug Cable Connection" topic.

The NET20DC is available from here: http://www.semiconductorstore.com/pages/search/searchinventory.asp?query=net20dc

看来理普遍使用USB进行内核调试还要有一段时间,一是这个线缆(严格说已经不只是一条线)不多见,而且有些贵。二是配置起来也有点麻烦。

posted on 2006年4月7日 22:40 由 Raymond

Powered by Community Server Powered by CnForums.Net