Microsoft KB Archive/175416

From BetaArchive Wiki

HOWTO: Obtain a NDIS Trace on Win95 for an NDIS Driver

Q175416



The information in this article applies to:


  • Microsoft Win32 Device Driver Kit (DDK) Windows 95





SUMMARY

You can get a NDIS trace for your driver by following the instructions below. You can use this to debug your driver and as a tool to understand and compare your driver to other NDIS drivers.



MORE INFORMATION

Tools

  • Debug binaries of NDIS.VXD, and the symbol file NDIS.SYM, obtained from the web site http://www.microsoft.com/support.
  • WDEB386.EXE (Windows kernel debugger), included in the Win32 SDK and Windows 95 DDK.
  • Terminal application to be run on a host machine.
  • Null modem cable.

Preparation for a NDIS Debug Session

On the host machine:


  • Copy the terminal application in a convenient directory.

On the target machine:


  1. Copy the debug version of NDIS.VXD and NDIS.SYM in the \WINDOWS\SYSTEM directory.
  2. Create a file WDEB31E.CMD to load symbols for a debugging session. The following sample file is set up to load the symbols for NDIS.VXD:

          <Start of file>
          /X
          /b
          /S:C:\WINDOWS\SYSTEM\NDIS.SYM
          <<MORE SYMBOL Files if needed >>
          C:\WIN95\WIN.COM
          <End of file> 
  3. Create a file called WD31E.BAT to start WDEB386.EXE. The WDEB31E.BAT file calls the WDEB31E.CMD file to load Windows 95 and the symbols for a debugging session:

          <start of file>
          C:\WDEB386.EXE /r:19200 /c:2 /F:c:\WDEB31E.CMD
          <End of file> 
  4. Modify your AUTOEXEC.BAT file to call the WD31E.BAT file:

          <Start of file>
          [ASCII 133]..
          [ASCII 133]..
          C:\WD31E.BAT
          [ASCII 133].
          [ASCII 133].
          <End of file> 

Test the Null Modem Connection

Connect the COM ports (for example, COM2) on the host and the target machine via a null modem cable. Configure the terminal application on the host and the target machine to run at the same baud. Make sure that data flows from the target to the host. Once data flows from the target to the host, you are ready to start a debugging session.

Start the Debugging Session

  • Start the terminal application on the host.
  • Reboot the target machine.

The /b option in the WDEB31E.CMD file will cause the debugger to break in VMM. At this point the NDIS symbols are loaded and the debugger output on the terminal will look as follows:


   "
   Kernel Debugger  Version 4.0.4 06/29/95 19:16:07  [80386]
   Symbols linked (NDIS)
   Broken in at start of VMM32 init because of /B option to wdeb386
   AX=0000F001  BX=00000000  CX=00000001  DX=00037774  SI=C03682BC
   DI=C0320204  IP=C0360862  SP=C036810C  BP=C03681E8  CR2=00000000
   CR3=004C0  IOPL=3  F=-- -- CS=0028  SS=0030  DS=0030  ES=0030  FS=0030
   GS=0030 -- NV UP DI PL NZ NA PO NC
   0028:C0360862  MOV     ESI,DWORD PTR [C036827C]
   DS:C036827C=00030856
   #
   " 


To enable NDIS trace, set the NdisTraceImpt flag as follows:


    #e _NdisTraceImpt 1
    #g 


As a result, NDIS outputs information on the serial port, which will appear on the terminal application on the target machine.



REFERENCES

For more information on WDEB386.EXE debugger commands refer to the documentation in the SDK and DDK.

Keywords : ntddkndis
Issue type : kbhowto
Technology :


Last Reviewed: March 5, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.