WinDbg usage

hi all
Can any one explain/give pointers as to how to use Windbg to debug Kernel
mode drivers using a host and target machine.

thanks
Mayank

  1. Download latest windbg.
  2. Buy 2 firewire cards, 1 for development system, 1 for test, and
    connect cards via wire. But this presumes both are at least XP.
    Otherwise, connect serial ports via wire (eg, COM1 to COM1).
  3. Start a windbg session and supply the appropriate parameters for the
    connection mechanism.
  4. Change boot.ini on test system to have an entry designating chosen
    connection mechanism (firewire or serial). Reboot test system and choose
    the new entry.
  5. Point windbg to the Microsoft symbol server for OS symbols. Point to
    your own files for your driver’s symbols.
  6. Ponit windbg to the path(s) for your source. Ditto for executables.
  7. Before your driver is loaded, do something in windbg like ‘bp
    MyDriver!DriverEntry’, where “MyDriver” is actually whatever name you’ve
    given your driver. You should get control in windbg at the first
    statement in your DriverEntry when your driver is loaded. If, however,
    windbg says it cannot find the symbols, you’ve a problem, because windbg
    doesn’t have correct information; perhaps the executable on the test
    system doesn’t correspond to the symbols you’ve told windbg to use.
  8. Open the source file in windbg. If your executable has stopped at
    DriverEntry (see point 7 above), you should see the first line of the
    source file highlighted. You can step, statement by statement (or even
    instruction by instruction, depending on options) through the file.
  9. If your driver encounters a fatal error (eg, would result in BSOD),
    your test system will halt, and windbg will display some error message
    and give your the opportunity to get more information, eg, the stack.

Happy debugging.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini

“Mayank Kumar” wrote in message
news:xxxxx@ntdev…
>
> hi all
> Can any one explain/give pointers as to how to use Windbg to debug Kernel
> mode drivers using a host and target machine.
>

Good heavens! DUDE! Read the documentation. You DID do that, before
posting this note, right?? Nah, it’s easier just to send email I bet.

So, here you go:

In the DDK Docs, read the section Driver Development Tools for a good
overview of the process and the tools. Note the discussion of the
free/checked builds, and how to install just the checked O/S image and
kernel.

In the WinDbg documentation itself, look under “Usign Debugging Tools for
Windows”, “Installation and Setup”, “Kernel Mode Setup”. This has, in
exquisite detail, everything you need to know about setting up the debugger.

For info on using the debugger, look under “Debugger Operation”, “Debugger
Operation (Kernel Mode)” – Everything you need to know.

That is all,

Peter
OSR

Ahh, Peter you are so kind.

I had formulated it a bit more drastically:

RRRRRR TTTTTTTTTTTTTT FFFFFFFFFFF MM MM
RR R TT FF MMM MMM
RR R TT FF MM M M MM
RR R TT FFFFFFFF MM M M MM
RRRRRR TT FF MM M MM
RR R TT FF MM MM
RR R TT FF MM MM
RR R TT FF MM MM
RR R TT FF MM MM
RR R TT FF MM MM
RR R TT FF MM MM

but that would have not been in purpose of this list, then.

:slight_smile:

Norbert.

What’s the meaning ???
Can you explain it in more detail?
“Norbert Kawulski” ???:xxxxx@ntdev…
>
> Ahh, Peter you are so kind.
>
> I had formulated it a bit more drastically:
>
> RRRRRR TTTTTTTTTTTTTT FFFFFFFFFFF MM MM
> RR R TT FF MMM MMM
> RR R TT FF MM M M MM
> RR R TT FFFFFFFF MM M M MM
> RRRRRR TT FF MM M MM
> RR R TT FF MM MM
> RR R TT FF MM MM
> RR R TT FF MM MM
> RR R TT FF MM MM
> RR R TT FF MM MM
> RR R TT FF MM MM
>
> but that would have not been in purpose of this list, then.
>
> :slight_smile:
>
> Norbert.
> --------
>
>
>
>

Andy Hao wrote:

What’s the meaning ???
Can you explain it in more detail?

Read The Fine Manual. American slang for “please consult the
documentation.”


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com

Funny, I’ve always heard that “F” meant For Unlawful Carnal … not
“Fine”. I guess others and myself have been improperly defining “RTFM” all
these years :stuck_out_tongue_winking_eye:

“Walter Oney” wrote in message news:xxxxx@ntdev…
>
> Andy Hao wrote:
> > What’s the meaning ???
> > Can you explain it in more detail?
>
> Read The Fine Manual. American slang for “please consult the
> documentation.”
>
> –
> Walter Oney, Consulting and Training
> Basic and Advanced Driver Programming Seminars
> Check out our schedule at http://www.oneysoft.com
>
>