home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / COMM / IOMON2.ZIP / IOMON.DOC < prev    next >
Text File  |  1992-02-20  |  8KB  |  176 lines

  1. IOMON - Protected mode I/O port monitor
  2. ---------------------------------------
  3. IOMON is a protected mode I/O monitor written by Rick Knoblaugh and
  4. published in an article in Programmer's Journal (volume 9, number 5).
  5. The program files for IOMON are copyright 1991 ASMicro and distributed
  6. here with their permission.
  7.  
  8. IORPT is a reporting program that reads the memory resident data buffer
  9. maintained by IOMON and produces several reports. IORPT was written by
  10. Terry Hughes of TurboPower Software and is released to the public
  11. domain.
  12.  
  13. Version 1.0
  14. 1/92
  15.  
  16.  
  17. Overview
  18. --------
  19. IOMON and IORPT can be used to monitor and report on the serial port I/O
  20. performed by any communications program. As you might guess by their
  21. names, IOMON does the monitoring and IORPT does the reporting.
  22.  
  23. This combination of programs can add some powerful and convenient
  24. debugging capabilites to your toolbox. Previously, if you wanted to
  25. monitor the exchange of data in a serial link you needed a data scope or
  26. an extra PC (and cables) equipped with data scope-like software. While
  27. there will still probably be times when only a data scope will do, IOMON
  28. and IORPT make it possible to monitor many such communication exchanges
  29. directly on one of the participating machines.
  30.  
  31. IOMON is a memory resident monitor that tracks all accesses to a
  32. specified range of I/O ports. As presented here, its intended purpose is
  33. to monitor the range of I/O ports that belong to a UART. The tremendous
  34. utility of such a program is that it can monitor communications programs
  35. as they run, without interfering with them, and note all serial data
  36. input and output as well as modem and line control performed by that
  37. program.
  38.  
  39. IOMON was originally published in Programmer's Journal as a general
  40. purpose I/O port monitor. We've made one small modification to it to
  41. allow the its information buffer to be truly circular (as published, the
  42. buffer was cleared everytime it wrapped).
  43.  
  44. We've supplied the file IOMON.EXE executable file as well as the source
  45. code files distributed with the Programmer's Journal article (with our
  46. small modification). For more information about how IOMON works we
  47. suggest you read Rick Knoblaugh's article on the program in Programmer's
  48. Journal 9.5.
  49.  
  50. IORPT is a reporting program that reads IOMON's memory resident data
  51. buffer and produces two reports -- a "trace" and "audit" report. The
  52. trace report is identical to the Tracing facility provided by Async
  53. Professional. The audit report is similar to Async Professional's event
  54. logging report except that it lacks a time stamp.
  55.  
  56. Note that while IOMON is a general purpose I/O monitor, IORPT assumes
  57. that IOMON is currently being used to monitor the UART ports of COM
  58. port. Running IORPT while IOMON is monitoring some non-UART port
  59. addresses will give unpredictable results.
  60.  
  61.  
  62. Using IOMON and IORPT
  63. ----------------------
  64. In a nutshell, a typical testing scenario will consist of
  65.  
  66.   1) loading IOMON with desired UART addresses
  67.   2) running the communications program you wish to monitor
  68.   3) running IORPT to build a report of what the communications program did
  69.  
  70. Here's a bit more detail about each step.
  71.  
  72. IOMON.EXE is a TSR that takes two command line arguments -- the starting
  73. and ending port addresses you wish to monitor. For example:
  74.  
  75.   IOMON 3F8 3FE
  76.  
  77. will monitor all inputs and outputs to I/O ports $3F8 through $3FF. It
  78. maintains an internal 8K buffer of information about all accesses to
  79. those port addresses. For each access it saves the exact port address,
  80. the data input or output and whether the access was a word or byte
  81. access.
  82.  
  83. These addresses are assumed to be in hexadecimal notation and the first
  84. address must be less than the second address. When using IORPT in
  85. conjuction with IOMON, these addresses will be the UART port addresses
  86. of the COM port you wish to monitor. Below are the standard addresses
  87. for COM ports:
  88.  
  89.   COM1  3F8 3FF
  90.   COM2  2F8 2FF
  91.   COM3  3E8 3EF
  92.   COM4  2E8 2EF
  93.  
  94. IOMON isn't restricted to just these addresses. It will attempt to
  95. monitor whatever range you give it. However, IORPT assumes that you are
  96. using it to monitor a UART. To report on other addresses, you'll need to
  97. use the more simple-minded IODISP.EXE program that is part of the
  98. original IOMON package.
  99.  
  100. To perform its monitoring, IOMON must run in virtual-86 protected mode.
  101. This provides two obvious restrictions on its use: 1) it requires a 386,
  102. 486 or later, and 2) the machine cannot already be running in protected
  103. mode. Since most memory managers (QEMM and 386Max) also place the
  104. processor in protected mode, they must be removed before running IOMON.
  105.  
  106. An additional restriction of the way IOMON operates is that it cannot be
  107. uninstalled by itself or by using external mark/release programs. Once
  108. you are finished with your monitoring tests you will need to reboot your
  109. machine to remove IOMON.
  110.  
  111. Assuming you've installed IOMON correctly, the next thing to do is run
  112. the communications program you wish to monitor. Each time that program
  113. accesses one of the ports in IOMON's range, an I/O exception will be
  114. generated and IOMON will temporarily gain control. It will allow the I/O
  115. to continue but will peek at the data that was input or output and add
  116. an entry to its circular log. The circular log will contain the last
  117. 8192 I/O events.
  118.  
  119. When the communications program is finished you will use IORPT to read
  120. that circular buffer and produce its reports. IORPT has the following
  121. command line arguments:
  122.  
  123.   Usage: IORPT [options]
  124.     /T      build standard APRO trace to IORPT.TRC
  125.     /D      build detailed audit report to IORPT.AUD
  126.     /F      filename to use (no extension)
  127.  
  128. The /T option builds a report identical to Async Professional's Tracing
  129. report. Here's a short sample:
  130.  
  131.   Transmit:
  132.   ATZ[13][10]
  133.  
  134.   Receive:
  135.   ATZ[13][10][13][10]OK[13][10]
  136.  
  137. The program begin monitored sent an 'ATZ' to the serial port and
  138. received back on echo of that command plus an 'OK' response.
  139.  
  140. The /D option builds a report similar to Async Professional's Event
  141. Logging report. However, this report doesn't provide and timestamp and
  142. is otherwise different enough that we gave it a different name -- an
  143. audit report. Here's a short sample:
  144.  
  145.  Addr  Direction  Value   Message
  146.  ----  ---------  -----   -------
  147.  02F9     In        00    Reading interrupt enable mask
  148.  02FA     In        01    Reading interrupt type
  149.  02FC     In        00    Reading modem control register
  150.  02F9     In        00    Reading interrupt enable mask
  151.  02F9     Out       00    Setting interrupt enable mask
  152.  02F9     In        00    Reading interrupt enable mask
  153.  02F9     Out       00    Setting interrupt enable mask
  154.  02F9     In        00    Reading interrupt enable mask
  155.  02FC     In        00    Reading modem control register
  156.  02FB     In        03    Reading line control register
  157.  02FB     Out       83    Enabling DLAB
  158.  02F8     In        30    Reading baud rate
  159.  02F9     In        00    Reading interrupt enable mask
  160.  02FB     Out       03    Setting line control register (DLAB off)
  161.  02FF     In        F0    Reading scratch register
  162.  02FF     Out       F0    Writing scratch register
  163.  
  164. The information should be fairly self-explanatory. Each line represents
  165. one access to a UART port. Addr has the exact address, Direction tells
  166. whethe this was due to and IN or OUT instruction and Value contains the
  167. value input or output. Message is a short text explanation that IORPT
  168. attaches to each address, direction and value, assuming that the address
  169. range being monitored is part of a UART address range.
  170.  
  171. Note that you can produce both reports by specifying both /T and /D on
  172. the command line. When debugging information exchanges, like protocols,
  173. you probably find the /T report helpful. When debugging low-level
  174. problems (like modem control issues) you'll probably find the /D report
  175. more helpful.
  176.