home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / sysutl / diags.arc / DIAGS.DOC next >
Encoding:
Text File  |  1986-04-28  |  17.4 KB  |  395 lines

  1.                                    DIAGS.EXE
  2.       
  3.           Special Serial, Parallel, Video diagnostics for the PC
  4.   
  5.           Written by Joan Riff for: 
  6.       
  7.           Computerwise Consulting Services 
  8.           P.O. Box 813, McLean, VA 22101 
  9.           (703) 280-2809 
  10.       
  11.       
  12.      Introduction
  13.      ____________
  14.       
  15.      DIAGS is a tool for the advanced PC user, period. It is NOT for the
  16.      general public. This manual will not explain things in elementary terms.
  17.      If you know what a 6845 is, and what an 8250 is, and what parallel
  18.      handshaking lines are, then DIAGS will be extremely useful to you. If
  19.      not, then you may have better things to do with your time than try to
  20.      figure out this program. 
  21.       
  22.      DIAGS started out as a testbed for our new interrupt-driven RS232
  23.      libraries. The Serial Port Diagnostics were the first written, to test
  24.      the Microsoft version 3.0 'C' interface to these routines. 
  25.       
  26.      It has since grown. As we have added more assembler routines to our
  27.      library, we have added corresponding DIAGS functions to test them.
  28.       
  29.      Additionally, DIAGS has been expanded as we experienced the need for new
  30.      diagnostics capabilities. So the Parallel Port diagnostics were added
  31.      when we had to debug yet another unknown printer's handshaking. And the
  32.      6845 diagnostics were added when we needed to test various video tricks
  33.      like displaying 30 lines of text, smooth scrolling, etc. 
  34.       
  35.      As it now stands, DIAGS is a very powerful facility for: 
  36.       
  37.           1) Testing all sorts of asynch communications lines 
  38.       
  39.           2) Testing printer handshaking and cable wiring 
  40.       
  41.           3) Examining an unknown system's DOS environment, including:
  42.  
  43.                a) Interrupt vectors 
  44.                b) Resident device handlers 
  45.       
  46.           4) Directly manipulating the 6845. 
  47.      Main Menu
  48.      _________
  49.  
  50.      The main DIAGS menu displays information about the machine and about
  51.      DOS, and presents a list of the various diagnostics that are available.
  52.      When you exit a particular diagnostic, you are returned to this main
  53.      menu.
  54.  
  55.  
  56.      (D)isk Info
  57.      ___________
  58.       
  59.      Let's describe the weakest and least important diagnostic first.
  60.       
  61.      The DISK INFO selection from the main menu displays just about every-
  62.      thing that can be determined about a disk. Make sure that you have a
  63.      diskette in the indicated drive before selecting this option. 
  64.       
  65.      Since there are other utilities which do just about everything that you
  66.      may want to do with a disk, we haven't done much with this diagnostic.
  67.      We just display disk information as reported by DOS as well as by the
  68.      disk's Boot Record. 
  69.       
  70.      Once in the Disk Info screen, the following keypresses are available to
  71.      you: 
  72.       
  73.           ESC - return to the main DIAGS menu
  74.  
  75.           ALT-V - verify a diskette by reading every sector via DOS INT
  76.           025h. This is SLOW!!!! Think of this as a demo of just how
  77.           slow INT 025h can be. 
  78.       
  79.           ALT-R - reset drive. Doesn't do much, huh? That's what we
  80.           wanted to see. 
  81.  
  82.           A thru Z - select new drive for which statistics are to be
  83.           displayed. Again, be sure that you have a disk in whatever
  84.           drive you select. 
  85.       
  86.      That's it. Not much to it. If you need to do more, then use: 
  87.       
  88.           The Norton Utilities 
  89.           Quaid's Disk Explorer 
  90.           Central Point Software's Option Board 
  91.      (I)nterrupt Vector Display
  92.      __________________________
  93.       
  94.      This selection from the main menu displays the system's Interrupt
  95.      Vectors. For each interrupt, the following information is displayed:
  96.       
  97.           The interrupt number 
  98.           The interrupt vector's address within segment zero 
  99.           The Segment:Offset of its handler 
  100.           The interrupt's name and/or use 
  101.       
  102.      If an interrupt points to an IRET, then that fact is reported by a
  103.      highlighted "[IRET]" displayed after the name.
  104.  
  105.       
  106.      Once in the Interrupt screen, the following keypresses are available to
  107.      you: 
  108.       
  109.           ESC - exit back to main menu
  110.           Home - scroll display back to Interrupt 0
  111.           End - scroll display to the end of the interrupts (F0 thru FF)
  112.           PgDn - scroll to the next page of vectors
  113.           PgUp - scroll up to the previous page of vectors
  114.           Up Arrow - scroll up 1 line
  115.           Down Arrow - scroll down 1 line
  116.       
  117.  
  118.  
  119.      (P)arallel Diagnostics
  120.      ______________________
  121.       
  122.      This is a more complicated set of diagnostics. It allows you to do all
  123.      sorts of useful things with the parallel ports. We use these routines
  124.      when we're trying to figure out whether or not some new printer is
  125.      working properly with the system. 
  126.       
  127.      At the top of the screen is displayed: 
  128.       
  129.           The number of parallel ports on the system (1 thru 4) 
  130.           The number of the currently-selected printer (0 thru 3) 
  131.           The base I/O address of the currently-selected printer 
  132.           The trip character that is currently set (see below) 
  133.           Whether interrupts are allowed or disallowed during sampling
  134.       
  135.      The Parallel Port Diagnostics menu gives you the following choices:
  136.       
  137.           (I)nit printer - does a ROM BIOS "init printer" call.
  138.       
  139.           (E)nable Interrupts during sampling - toggles the indicator on
  140.           the top line, which indicates whether INTs are to be dis-
  141.           allowed during sampling. 
  142.       
  143.           (N)ew Trip character - allows you to specify a new character
  144.           to be sent to the printer to 'trip' it. This is initially a
  145.           Linefeed. 
  146.           (P)rinter switch - selects next printer (in sequence) as the
  147.           current printer. 
  148.       
  149.           (T)rip printer - sends the current Trip character to the
  150.           printer, and then captures the printer Status port lines using
  151.           a special high-speed capture routine. These lines are dis-
  152.           played in oscilloscope format, allowing you to see at a glance
  153.           the operation of the BUSY line, ACK line, etc. Interrupts will
  154.           be inhibited during the sampling if the top line of the
  155.           display shows "No Ints". Press ESC to exit from the display of
  156.           the status lines. 
  157.       
  158.           (U)nique Printer setup - sends custom codes to set various
  159.           specific printers into various modes. The printers currently
  160.           supported are: 
  161.       
  162.                Data Products 8070 (and perhaps IDS Color Prism) 
  163.                IBM Graphics Printer (and certain Epsons) 
  164.                Fujitsu DL-2600 (and perhaps Epson JX color series) 
  165.                Okidata Microline 93 
  166.                Diable 630 (and C.ITOH Starwriter, F-10, etc) 
  167.                C.ITOH Prowriter 
  168.       
  169.           Follow the prompts that are displayed when you make this
  170.           selection. 
  171.       
  172.           (Q)uit parallel diagnostics - to return to main menu
  173.       
  174.           The following three selections are invaluable for checking
  175.           proper printer cabling and handshaking: 
  176.       
  177.           (D)ata lines - displays the parallel port Data I/O port lines
  178.           in oscilloscope-like format. Press ESC to exit the oscillo-
  179.           scope display. 
  180.       
  181.           (S)tatus lines - as above, but lines displayed are from
  182.           the parallel Status I/O port. 
  183.       
  184.           (C)ontrol lines - as above, but lines displayed are from
  185.           parallel Control I/O port. 
  186.       
  187.           The following selections send various strings to the printer: 
  188.       
  189.           (F)ox message - sends a continuous FOX message to the printer
  190.           via direct I/O (bypassing the ROM BIOS). Press ESC to stop it.
  191.       
  192.           (A)scii character set - sends the complete ASCII character set
  193.           to the printer via direct I/O (bypassing the ROM BIOS). No
  194.           carriage returns are sent. Press ESC to stop it. 
  195.       
  196.           (H)oriz and vert alignment tests - send various Formfeed, Tab,
  197.           line spacing and Backspacing sequences to printer. This is
  198.           useful for testing the results of (U)nique printer setups, and
  199.           to see if the printer supports true backspacing. This selec-
  200.           tion has its own submenu, which is exited via ESC. 
  201.      (S)erial Port Diagnostics
  202.      _________________________
  203.       
  204.      If you do PC communications as much as we do, then this part of DIAGS is
  205.      for you! It provides a very powerful look at the comm line. Its most
  206.      intriguing feature is the ability to serve as a line monitor between two
  207.      serial devices. 
  208.  
  209.      When you select "Serial Diagnostics" from the main menu, your screen
  210.      becomes a terminal screen. At the top of the screen is displayed various
  211.      port information as follows: 
  212.       
  213.           Whether the port is open ("OP") or closed ("CL") 
  214.           The current serial port number 
  215.           The current baud rate 
  216.           The number of data bits being used 
  217.           The type of parity being used 
  218.           The number of stop bits being used 
  219.           Whether the existing 8250 parameters are being re-used (this
  220.                feature is only used by us, for internal testing) 
  221.           What port is being wrapped to (more on this later) 
  222.           Whether keypresses are echoed to the screen 
  223.           Whether DEBUG mode (HEX display) is set 
  224.       
  225.      To the right of this information are various stats, displayed only if
  226.      the port is open and stats have been enabled. These stats include:
  227.  
  228.           The size of the RS232 output queue (in HEX) 
  229.           The size of the RS232 input queue (in HEX) 
  230.           The status of Carrier Detect and DSR 
  231.           The number of times (in HEX) that the following have occurred:
  232.       
  233.                RING 
  234.                BREAK 
  235.                Framing Error 
  236.                Parity Error 
  237.                Overrun Error 
  238.       
  239.      Once the port has been opened, any "normal" keys that you press are sent
  240.      over the comm line by being queued into the output queue. Incoming data
  241.      appears on the screen. Incoming and outgoing characters are displayed in
  242.      different colors, so that you can tell what's what. 
  243.       
  244.      The RS232 routines are entirely interrupt-driven. The output queue will
  245.      be serviced only if the 8250 is properly interrupting the 8088. This in
  246.      itself is a valuable test of proper system operation. If the output or
  247.      input queue sizes stay "stuck" at a non-zero value, then something is
  248.      wrong with your system. 
  249.      Besides the "normal" keys, you may use the following key presses:
  250.  
  251.       
  252.           ALT-S - switch display between port 0 and port 1 (COM1: and
  253.           COM2:). 
  254.  
  255.           ALT-M - bring up a menu of miscellaneous features:
  256.  
  257.                HANGUP the phone by dropping DTR 
  258.                PICKUP the phone by raising DTR 
  259.                RESET the Hayes 1200b by OUT1 toggle 
  260.                FLUSH input and output queues 
  261.                CRLF control (how to display incoming CR and LF) 
  262.                STATS control - turning the stats off can speed up the
  263.                     terminal display considerable 
  264.                TRAP - control what happens when you press ALT-T to trap
  265.                     some 8250 register 
  266.       
  267.           ALT-X - initiate an XMODEM transfer. This we use to test the
  268.           accuracy of XMODEM as implemented in other software packages. 
  269.  
  270.           ALT-P - control port parameters. This includes:
  271.  
  272.                port OPEN and CLOSE 
  273.                BAUDRATE 
  274.                DATA bit selection 
  275.                PARITY setting 
  276.                STOP bit selection 
  277.                REUSE of the 8250 params (for our internal use) 
  278.                ECHO (of local keypresses) on/off 
  279.                WRAP of incoming data to another comm port 
  280.                DEBUG display toggle 
  281.       
  282.           ALT-T - to trap the data lines from a previously-defined 8250
  283.           register 
  284.  
  285.           ALT-R - display various 8250 registers
  286.  
  287.           ALT-B - to send a BREAK
  288.  
  289.           ALT-W - wait (do nothing) till next keypress. This is useful
  290.           for pausing a fast-miving display. 
  291.  
  292.           ALT-Q - quit back to main menu
  293.  
  294.           ALT-F - send a single FOX message over comm line
  295.       
  296.      Most of these functions contain their own prompts, and require no
  297.      further explanation. Some, however, need to be explained in detail.
  298.       
  299.      The continuous updating of the stats on the top line can slow down the
  300.      terminal display. Turning stats off (ALT-M S) can speed things up
  301.      considerably. 
  302.      The baud rate is continuously variable, from 2 to 38400. You are not
  303.      limited to "standard" PC baud rates. 
  304.       
  305.      If you want to clear the screen and reset the stats, try switching ports
  306.      twice (ALT-S ALT-S). 
  307.       
  308.      To trap and display an 8250 register in the middle of communication, you
  309.      must first define the register to be trapped (ALT-M T) and whether INTs
  310.      are to be allowed during the sampling that follows. 
  311.       
  312.      Having done that, you cause the trap by pressing ALT-T. At that instant,
  313.      a special high-speed assembler routine is executed which samples the
  314.      designated register once every 50 machine cycles or so until 420 samples
  315.      have been taken. These sample bytes are then displayed as a screenful of
  316.      HEX bytes. You may highlight a particular byte via the arrow keys. The
  317.      highlighted byte's interpretation is displayed on the message line
  318.      toward the top of the screen. Press ESC to exit this trap display.
  319.       
  320.      The "wrap" feature is very useful. It may be used to allow DIAGS to
  321.      serve as a line monitor located between two serial devices, among other
  322.      things. Every incoming character is "wrapped" as an output to whatever
  323.      port you have specified as the "wrap" port. If you select as the "wrap"
  324.      port the same port that you're using, then you have in effect become a
  325.      full-duplex system. The serial device connected to that port will see
  326.      its "keypresses" echoed back to itself. 
  327.       
  328.      Assuming that you have two serial ports, you may use DIAGS as a line
  329.      monitor by wrapping each port's input to the other port. You can then
  330.      switch between ports (ALT-S) and generally watch everything that goes in
  331.      either direction. You can turn on the DEBUG display (ALT-P G) to see
  332.      things in more detail. 
  333.       
  334.  
  335.  
  336.      (R)esident device handler display
  337.      _________________________________
  338.       
  339.      This main menu selection allows you to see a list of all resident device
  340.      handlers. As you highlight each handler's name (via the left and right
  341.      arrow keys), the device's attributes are expanded on the screen. Press
  342.      ESC to exit this display. 
  343.       
  344.      Block devices are indicated by device names of the form "BLOCKnnn",
  345.      where nnn is the number of devices supported by this block device
  346.      handler. 
  347.      (V)ideo Manipulation
  348.      ____________________
  349.       
  350.      If you want to do some fancy 6845 programming, then the Video diagnostic
  351.      will be of great interest to you. It allows you to examine and alter the
  352.      6845 registers in a most graphic fashion. 
  353.       
  354.      Toward the top of the screen is a two-column list of all 6845 registers,
  355.      and one or two of the special IBM PC video registers (the MODE and/or
  356.      COLOR registers). There is a ">" pointer, showing you which register is
  357.      being worked with. 
  358.       
  359.      For each 6845 register, two values are shown: 
  360.       
  361.           1) The original value, as set by the ROM BIOS 
  362.           2) The current value as set by you 
  363.       
  364.      You move the ">" pointer to various 6845 registers via the up and down
  365.      arrow keys. As you select each 6845 register, that register's bit
  366.      pattern is expanded on the bottom half of the screen. 
  367.       
  368.      You can change the currently-selected 6845 register's value by using the
  369.      "+" or "-" keypad keys to increment or decrement its value.
  370.       
  371.      You can also use the left and right arrow keys to move the "bit pointer"
  372.      across the various bits of the expanded byte on the bottom half of the
  373.      screen. Pressing "1" or "0" sets or clears the bit currently pointed
  374.      to. This is an alternate way to change the current value of a 6845
  375.      register.
  376.       
  377.      The updated 6845 registers are loaded into the 6845 ONLY WHEN YOU PRESS
  378.      RETURN. This allows you to make extensive changes to registers without
  379.      having intermediate states foul up the display. 
  380.       
  381.      If you hose things up and get an unreadable screen, just press ESC to
  382.      exit the Video Diagnostics, then enter it again. The 6845 is reset on
  383.      exit from the Video Diagnostics. 
  384.       
  385.      If you are using a Color/Graphics Adapter, then you may press "S" to
  386.      toggle Snow on or off. The upper-right corner of the display shows the
  387.      current status of snow as follows: 
  388.       
  389.           "Snow: YES" means that no effort is being made to eliminate
  390.           snow, and that snow is present (although you won't see it if
  391.           you have a good Color/Graphics board) 
  392.       
  393.           "Snow: NO" means that snow is being eliminated by our video
  394.           software. 
  395.