home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / UT / UT042.ZIP / PRODIAGS.DOC < prev    next >
Text File  |  1987-01-22  |  17KB  |  393 lines

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