home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / HARDWARE / SPDIAGS.ZIP / DIAGS.DOC next >
Encoding:
Text File  |  1986-04-14  |  18.5 KB  |  412 lines

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