home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 4 Drivers / 04-Drivers.zip / sio160d.zip / SIOREF.TXT < prev    next >
Text File  |  1997-03-17  |  87KB  |  2,126 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                        SIO
  25.                            Technical Reference Manual
  26.  
  27.  
  28.  
  29.                      Copyright (c) 1995 by Raymond L. Gwinn
  30.                                 26 Tanager Place
  31.                           Beckley, West Virginia 25801
  32.                                All Rights Reserved
  33.  
  34.                                  January 1, 1997
  35.  
  36.  
  37.                              CompuServe: 72662,3547
  38.                              InterNet: ray@gwinn.com
  39.                               Voice: 1-304-255-7900
  40.                                FAX: 1-303-255-7902
  41.                      BBS: 1-304-255-7903 or vmbbs.gwinn.com
  42.                             WEB http://www.gwinn.com
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                                   INTRODUCTION
  66.  
  67.      Documentation of software is often more difficult than writing the
  68.      program itself (at least it is for this author).  I will do my best
  69.      though.
  70.  
  71.      But who do I document for?  The user that is setting up a BBS just
  72.      wants to get SIO installed and to move on to more important things. 
  73.      The user that is having problems needs information about serial I/O
  74.      communications in general and the PC specifically.  The application
  75.      developer (programmer) needs detailed information about each
  76.      individual function and the information generated.
  77.  
  78.      The answer is, more than one manual is needed.  This manual is
  79.      intended as a reference for use by application programmers that
  80.      desires to use SIO.  A separate Users Manual is included in the
  81.      distribution file(s).
  82.  
  83.      This manual and the software described is provided as is and with no
  84.      guarantees.  Use at your own risk.
  85.  
  86.  
  87.  
  88.  
  89.      ii
  90.  
  91.  
  92.      WHAT IS SIO . . . . . . . . . . . . . . . . . . . . . . . . . . .    1
  93.  
  94.      DISTRIBUTION, ORDERING AND SUPPORT  . . . . . . . . . . . . . . .    2
  95.           Distribution and Ordering  . . . . . . . . . . . . . . . . .    2
  96.                SIO Distribution and Support BBS  . . . . . . . . . . .    2
  97.            . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    2
  98.                OS/2 Vendor Forum on
  99.                     CompuServe . . . . . . . . . . . . . . . . . . . .    2
  100.           Updates  . . . . . . . . . . . . . . . . . . . . . . . . . .    3
  101.  
  102.      Development and Debugging Tools . . . . . . . . . . . . . . . . .    4
  103.           The Poor Man's Line Monitor (PMLM.EXE) . . . . . . . . . . .    4
  104.           VIEWPMLM.EXE . . . . . . . . . . . . . . . . . . . . . . . .    5
  105.           SIO's Utility (SU.EXE) . . . . . . . . . . . . . . . . . . .    5
  106.                IRQs that currently free for use  . . . . . . . . . . .    5
  107.  
  108.      File System Requests  . . . . . . . . . . . . . . . . . . . . . .    6
  109.           Driver Initialization  . . . . . . . . . . . . . . . . . . .    6
  110.           Read . . . . . . . . . . . . . . . . . . . . . . . . . . . .    6
  111.           Input Status . . . . . . . . . . . . . . . . . . . . . . . .    6
  112.           Input Flush  . . . . . . . . . . . . . . . . . . . . . . . .    7
  113.           Write  . . . . . . . . . . . . . . . . . . . . . . . . . . .    7
  114.           Output Status  . . . . . . . . . . . . . . . . . . . . . . .    7
  115.           Output Flush . . . . . . . . . . . . . . . . . . . . . . . .    7
  116.           Open . . . . . . . . . . . . . . . . . . . . . . . . . . . .    7
  117.                Initial Open  . . . . . . . . . . . . . . . . . . . . .    7
  118.                Additional Open . . . . . . . . . . . . . . . . . . . .    8
  119.           Close  . . . . . . . . . . . . . . . . . . . . . . . . . . .    8
  120.                Intermediate Close  . . . . . . . . . . . . . . . . . .    8
  121.                Last Close  . . . . . . . . . . . . . . . . . . . . . .    8
  122.  
  123.      Device I/O Control (IOCtl) Commands . . . . . . . . . . . . . . .    9
  124.           IOCtl Functions From a DOS Session . . . . . . . . . . . . .   10
  125.           41h - Set Bit Rate . . . . . . . . . . . . . . . . . . . . .   11
  126.           42h - Set Line Characteristics . . . . . . . . . . . . . . .   12
  127.           43h - Extended Set Bit Rate  . . . . . . . . . . . . . . . .   13
  128.           44h - Transmit Byte Immediate  . . . . . . . . . . . . . . .   14
  129.           45h - Set Break Off  . . . . . . . . . . . . . . . . . . . .   14
  130.           46h - Set Modem Control Signals  . . . . . . . . . . . . . .   15
  131.           47h - Hold Transmit  . . . . . . . . . . . . . . . . . . . .   16
  132.           48h - Start Transmit . . . . . . . . . . . . . . . . . . . .   16
  133.           4Bh - Set Break on . . . . . . . . . . . . . . . . . . . . .   17
  134.           53h - Write Device Control Block (DCB)   . . . . . . . . . .   17
  135.           54h - Write Extended Mode Parameters . . . . . . . . . . . .   20
  136.           61h - Query Current Bit Rate . . . . . . . . . . . . . . . .   21
  137.           62h - Query Line Characteristics . . . . . . . . . . . . . .   21
  138.           63h - Query Extended Bit Rate  . . . . . . . . . . . . . . .   22
  139.           64h - Query SIO Status . . . . . . . . . . . . . . . . . . .   23
  140.           65h - Query Transmit Data Status . . . . . . . . . . . . . .   24
  141.           66h - Query Current Modem Output Control Signals . . . . . .   25
  142.           67h - Query Current Modem Input Signals  . . . . . . . . . .   25
  143.           68h - Query Number of Characters in Receive Buffer . . . . .   26
  144.           6Dh - Query SIO Error  . . . . . . . . . . . . . . . . . . .   27
  145.           72h - Query SIO Event Information  . . . . . . . . . . . . .   28
  146.  
  147.  
  148.  
  149.  
  150.                                                                         iii
  151.  
  152.           73h - Read Device Control Block (DCB)  . . . . . . . . . . .   29
  153.           74h - Read Enhanced Mode Parameters  . . . . . . . . . . . .   29
  154.  
  155.      Differences between SIO/VSIO and COM/VCOM . . . . . . . . . . . .   30
  156.  
  157.      Appendix A, Hardware Port and IRQ Assignments . . . . . . . . . .   31
  158.           Addresses and IRQs for COM1 and COM2 . . . . . . . . . . . .   31
  159.           Defacto standard for COM3 and COM4 . . . . . . . . . . . . .   31
  160.           Addresses and IRQ for COM3 through COM8 on the PS/2  . . . .   31
  161.  
  162.      Appendix B, SIO Chips . . . . . . . . . . . . . . . . . . . . . .   32
  163.           8250 . . . . . . . . . . . . . . . . . . . . . . . . . . . .   32
  164.           8250A  . . . . . . . . . . . . . . . . . . . . . . . . . . .   32
  165.           16450  . . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  166.           16C451 . . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  167.           16550 (Non A)  . . . . . . . . . . . . . . . . . . . . . . .   33
  168.           16550A . . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  169.           16550AF  . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  170.           16550AFN . . . . . . . . . . . . . . . . . . . . . . . . . .   33
  171.           16550s Made by Western Digital . . . . . . . . . . . . . . .   34
  172.           16C551 . . . . . . . . . . . . . . . . . . . . . . . . . . .   34
  173.           16C552 . . . . . . . . . . . . . . . . . . . . . . . . . . .   34
  174.           16C554 . . . . . . . . . . . . . . . . . . . . . . . . . . .   34
  175.           82510  . . . . . . . . . . . . . . . . . . . . . . . . . . .   34
  176.           16650  . . . . . . . . . . . . . . . . . . . . . . . . . . .   35
  177.           16750 from Texas Instruments . . . . . . . . . . . . . . . .   35
  178.           ComBic . . . . . . . . . . . . . . . . . . . . . . . . . . .   36
  179.  
  180.      Appendix C, Multi-Port Serial I/0 Cards . . . . . . . . . . . . .   37
  181.           Hayes ESP  . . . . . . . . . . . . . . . . . . . . . . . . .   37
  182.                ESP in Compatibility Mode . . . . . . . . . . . . . . .   37
  183.           Telcor Tport . . . . . . . . . . . . . . . . . . . . . . . .   37
  184.  
  185.      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   38
  186.           Gtek BBS550  . . . . . . . . . . . . . . . . . . . . . . . .   38
  187.           Neotech Quad Serial (MCA bus)  . . . . . . . . . . . . . . .   39
  188.  
  189.      Appendix D, Advanced SIO Options  . . . . . . . . . . . . . . . .   40
  190.           Protection . . . . . . . . . . . . . . . . . . . . . . . . .   40
  191.           Locked Baud Rate . . . . . . . . . . . . . . . . . . . . . .   40
  192.           IRQ Reflection to DOS Process  . . . . . . . . . . . . . . .   40
  193.           I/O Port Mapping to DOS Process  . . . . . . . . . . . . . .   40
  194.  
  195.      Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   41
  196.  
  197.  
  198.  
  199.  
  200.                                                                           1
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.                                    WHAT IS SIO
  219.  
  220.      SIO is a Serial Input/Output (SIO) communications character device
  221.      driver.  It provides an interface between application programs and the
  222.      serial communications hardware.
  223.  
  224.      SIO had been designed as a high performance replacement for the OS/2
  225.      device driver COM.SYS.  This manual documents the known differences
  226.      between COM.SYS and SIO.SYS.
  227.  
  228.      SIO only works with 8250 (type) serial I/O devices.  Such devices
  229.      include, but is not limited to the 8250A, 16450, 16550, 16550A and the
  230.      82510.  If you have a PC that is an IBM or near compatible which has a
  231.      serial communication port, it is likely that it contains one of these
  232.      devices.  SIO will identify the type of serial devices that it finds
  233.      at load time.
  234.  
  235.      Like other Device Drivers, SIO will do very little standing alone. 
  236.      There must be an application(s) program that makes use of SIO's
  237.      functions before one will benefit from the use of SIO.
  238.  
  239.  
  240.  
  241.  
  242.      2
  243.  
  244.                        DISTRIBUTION, ORDERING AND SUPPORT
  245.  
  246.      Distribution and Ordering
  247.  
  248.      The entire package collectively known as SIO is ShareWare.  It is not
  249.      free software or freeware.  See LICENSE.TXT and ORDER.TXT for
  250.      additional information.  The ShareWare version of SIO is distributed
  251.      electronically.  One may check their favorite electronic hangout for
  252.      the latest version of SIO.  The latest copy of the ShareWare version
  253.      is always posted for downloading from the BBS at 1-304-255-7903 or
  254.      vmbbs.gwinn.com and www.gwinn.com.
  255.  
  256.      Registered versions of SIO are distributed by US Mail and
  257.      electronically from the SIO Distribution and Support BBS.  Users
  258.      desiring to register electronically, may call the BBS and register on
  259.      line (1-304-255-7903 or vmbbs.gwinn.com) and www.gwinn.com, and
  260.      immediately download their registered version of SIO.  Use the ORDER
  261.      command at the main BBS prompt.
  262.  
  263.      Registrations/Orders can also be placed by phone, mail, FAX, and
  264.      email.  See the front cover of this manual for the phone numbers and
  265.      addresses.  Also see ORDER.TXT for and order form that may be used.
  266.  
  267.      Support
  268.      Extensive testing has been done to insure that this product works on
  269.      the widest possible range of OS/2 V2 (and up) systems.  In most cases,
  270.      problems can be resolved by reading this manual carefully.
  271.  
  272.      Support is provided in section 4 of the OS/2 Vendor Forum on
  273.      CompuServe (GO OS2BVEN).  Section 4 of the OS2BVEN Forum is dedicated
  274.      to the support of SIO.
  275.  
  276.      In addition, support is provided by BBS, Email and FAX.  Voice support
  277.      would overwhelm the author and is not available.  If, after reading
  278.      the manual carefully, you are unable to resolve a problem, you may
  279.      submit a problem report to one of the following: 
  280.                                       Email
  281.                               CompuServe 72662,3547
  282.                              Internet ray@gwinn.com
  283.                                FAX 1-304-255-7902
  284.                       BBS 1-304-255-7903 or vmbbs.gwinn.com
  285.  
  286.      Users should note that Support does not always result in a correction
  287.      of a problem.  In addition, the support provided is support of SIO,
  288.      and not the applications that use SIO.  Questions and/or problems
  289.      about applications programs (such as terminal or FAX programs) should
  290.      be directed to the available support for the application.
  291.  
  292.  
  293.  
  294.  
  295.                                                                           3
  296.  
  297.  
  298.      Updates
  299.  
  300.      In general, updates/upgrades of SIO are free of charge for all
  301.      releases of SIO with the same major version number.  However, there
  302.      may be a handling charge if the user requires the upgrade to be mailed
  303.      or emailed.
  304.  
  305.      Registered users of SIO can update to the latest version FREE of
  306.      charge using the BBS and its UPDATE command.  Be sure to have your SIO
  307.      serial number when you first log onto the BBS.  All variations (number
  308.      of ports) of SIO are available for immediate download from the BBS by
  309.      registered users.
  310.  
  311.      Users that have a registered copy of SIO can also use REREG.EXE to
  312.      transfer the registration information to a new version of SIO.  Simply
  313.      unzip the new SIO files into a temporary directory, change to that
  314.      directory, execute REREG and answer the questions.  After doing the
  315.      above, all of the files in the temporary directory will have been
  316.      registered.  You must then copy all the SYS and EXE files from the
  317.      temporary directory to their normal directory (overlaying the old
  318.      registered version) or execute the SIO install program (INSTALL.EXE). 
  319.      Then you must reboot.  You may also want to check your CONFIG.SYS for
  320.      the path of the SIO/VSIO being loaded and make sure both the new ones
  321.      are being loaded.
  322.  
  323.      If REREG will not transfer your registration information from a
  324.      previous version of SIO to the new version, then an upgrade must be
  325.      ordered on disk or obtained from the support BBS.
  326.  
  327.  
  328.  
  329.  
  330.      4
  331.  
  332.                          Development and Debugging Tools
  333.  
  334.      The Poor Man's Line Monitor (PMLM.EXE)
  335.  
  336.      PMLM is basically of interest to developers of comm applications and
  337.      those providing technical support for those applications.  This SIO
  338.      utility is released largely (in self defense) in the hope that some
  339.      users can diagnose their own problems.  PMLM's feature of saving trace
  340.      information to disk will only work with registered and beta versions
  341.      of SIO.
  342.  
  343.      PMLM provides basic line monitoring for OS/2, DOS and Windows comm
  344.      programs.  All characters sent or received by application programs are
  345.      displayed in the upper portion of the screen.  Receive characters are
  346.      displayed as "white on blue" and transmitted characters are displayed
  347.      "yellow on violet".  Line signals, such as CTS are displayed as "dim
  348.      white on red" when turned off and "bright white on red" when turned
  349.      on.  In addition, a signals transition to OFF is displayed in lower
  350.      case and a signals transition to ON is displayed in upper case.
  351.  
  352.      Status information is displayed in the lower part of the screen.  A
  353.      bright white display means the signal is on, a dim white indicates
  354.      that the signal is off.  In addition, when bright,  Rxoff and Txoff
  355.      indicate the SIO has sent (Txoff) or received (Rxoff) an Xoff, and an
  356.      Xon is pending.
  357.  
  358.      When a DOS or Windows session uses a comm port, an additional line of
  359.      signal status appears.  This status line shows the state of the
  360.      virtual UART's signals.  Only the signals which MAY be different from
  361.      the real UART's signals are shown.
  362.  
  363.      "Rx Chars" and "Tx Chars" reflects the number of characters in SIO's
  364.      receive and transmit buffers respectively.
  365.  
  366.      The last line on the screen shows the keys (from the keyboard) that
  367.      PMLM will recognize.  The bright character shows the key to hit for
  368.      the associated function.  The font keys will not work in a windowed
  369.      OS/2 session.
  370.  
  371.      PMLM's command line requires one parameter, the comm port number, and
  372.      optionally accepts an additional parameter giving a save trace file
  373.      name.  For example, PMLM 1 COM1INFO.TEC will monitor COM1 and save ALL
  374.      of the communications traffic in the file COM1INFO.TRC.  The trace
  375.      files created by PMLM contain exactly the same information that is
  376.      displayed by PMLM, video attributes and all.
  377.  
  378.  
  379.  
  380.  
  381.                                                                           5
  382.  
  383.  
  384.      VIEWPMLM.EXE may be used to view trace files created by PMLM. 
  385.      VIEWPMLM.EXE requires one parameter, the trace file name.  The user
  386.      can use the keys UP, DOWN, PAGEUP, PAGEDOWN, HOME, and END to navigate
  387.      the saved trace file.  Registered SIO users may send VIEWPMLM.EXE
  388.      (along with saved trace files) to anyone for technical support
  389.      purposes.
  390.  
  391.      VIEWPMLM can be used in native DOS, in DOS sessions under OS/2, and in
  392.      OS/2 sessions.  This means that even those developers and support
  393.      people need not have OS/2 to view the captured communications data
  394.      created by PMLM.
  395.  
  396.      SIO's Utility (SU.EXE)
  397.  
  398.      This utility program has several useful commands.  You can obtain a
  399.      list of the available commands by typing SU at any command line prompt
  400.      without any parameters.  One very useful command is SU IRQS.  This
  401.      command will show IRQs that currently free for use.  Commands are
  402.      provided allowing user control (missing from MODE) are available. 
  403.      Status commands provide a wealth of diagnostic information.
  404.  
  405.  
  406.  
  407.  
  408.      6
  409.  
  410.                               File System Requests
  411.  
  412.      SIO processes all file system requests made to it in one way or
  413.      another.  The following file system requests and how SIO processes
  414.      them may be of use to the application programmer.
  415.  
  416.      INIT           Driver initialization.
  417.      Read           Data transfer from driver to program.
  418.      Input Status   Get input status.
  419.      Input Flush    Terminate all pending input requests.
  420.      Write          Data transfer from program to driver.
  421.      Output Status  Get output status.
  422.      Output Flush   Terminate all pending output requests.
  423.      Open           Open the device for use.
  424.      Close          Close the device.
  425.      IOCTL          Device I/O control commands.
  426.  
  427.      Each of these file system requests are discussed in more detail in the
  428.      following.
  429.  
  430.                               Driver Initialization
  431.  
  432.      During device driver initialization the command line is parsed, memory
  433.      for data and control buffers is allocated and the system environment
  434.      is examined.
  435.  
  436.      Buffers are allocated for the maximum number of ports that the
  437.      installed version of SIO can support (up to 16).
  438.  
  439.      The mouse port is determined and if it is a serial mouse, that port is
  440.      excluded from use by SIO.
  441.  
  442.      In the absence of any command line parameters, SIO will only support
  443.      (look for) COM1 and COM2 at the standard addresses.  COM3 and up will
  444.      not be supported (or looked at) unless they are specifically
  445.      identified in the SIO command line.
  446.  
  447.                                       Read
  448.  
  449.      If another read is already in progress, the process issuing the
  450.      additional read is blocked (suspended) until the previous read command
  451.      completes.  When a read is started, that read is not interrupted by
  452.      additional reads.  If multiple reads are issued, they are not
  453.      necessarily processed in the order they were issued.  Thus,
  454.      applications may not see the read requests complete in the order in
  455.      which they were issued.
  456.  
  457.      The conditions that control when the read will complete are controlled
  458.      by the active (current) DCB when the read is started.
  459.  
  460.                                   Input Status
  461.  
  462.      This function returns with "device busy" set if there is no data in
  463.      the receive buffer.  That is, busy is returned if the process may be
  464.      blocked if the application issues a read command.
  465.  
  466.  
  467.  
  468.  
  469.                                                                           7
  470.  
  471.                                    Input Flush
  472.  
  473.      This function causes the receive buffer to be cleared (made empty). 
  474.      Any threads that are blocked, waiting for a read, will be restarted
  475.      when this function is issued.
  476.  
  477.  
  478.                                       Write
  479.  
  480.      If another write is already in progress, the process issuing the
  481.      additional write is blocked (suspended) until the previous write
  482.      command completes.  When a write is started, that write is not
  483.      interrupted by additional writes.  If multiple writes are issued, they
  484.      are not necessarily processed in the order they were issued.  Thus,
  485.      applications may not see the write requests complete in the order in
  486.      which they were issued.
  487.  
  488.      The conditions that control when the write will complete are
  489.      controlled by the current DCB when the write is started.
  490.  
  491.  
  492.                                   Output Status
  493.  
  494.      This function returns with "device busy" set if the output buffer is
  495.      more than three quarters full.  That is, busy is returned if the
  496.      process may be blocked if the application issues a write command.
  497.  
  498.                                   Output Flush
  499.  
  500.      This function causes the transmit buffer to be cleared (made empty). 
  501.      Any threads that are blocked, waiting for a write, will be restarted
  502.      when this function is issued.
  503.  
  504.  
  505.                                       Open
  506.  
  507.      There are basically two kinds of open.  They are an Initial Open and
  508.      Additional (shared) Opens. The IBM documentation calls the initial
  509.      open a First Level Open.  An Initial Open is an open that occurs when
  510.      no other process has the communications port open.  An Additional Open
  511.      is when an open occurs and another process already has the
  512.      communications port open.  For an Additional Open to occur, the
  513.      Initial Opener must have issued an open allowing shared access to the
  514.      port.
  515.  
  516.      Initial Open
  517.  
  518.      The IRQ associated with the comm port is claimed (taken) when the
  519.      Initial Open occurs.  If the associated IRQ is not available a "Port
  520.      in Use" error is returned.  At the time of this writing, the IRQ is
  521.      claimed allowing sharing.  However, the shared IRQ claiming is done to
  522.      circumvent anomalies in the OS, and in actuality SIO will not
  523.      concurrently share an IRQ with another device driver.  The author
  524.      found it necessary to claim (reset) all interrupts directed to the
  525.      interrupt service routine in order to prevent lock ups of a
  526.  
  527.  
  528.  
  529.  
  530.      8
  531.  
  532.      communications port.  The IRQ mess may be cleaned up at a future date
  533.      when the OS problems are corrected.
  534.  
  535.      During Initial Opens, DTR and RTS are set in accordance with the
  536.      current Device Control Block (DCB) settings.  If DTR Control Mode is
  537.      the "Enabled" option ( bits 1 and 0 of the DCB Flags1 byte equal 01),
  538.      then DTR is turned on.  Otherwise, DTR is unchanged by the Initial
  539.      Open.  Similarly, if RTS Control Mode is the "Enabled" option ( bits 7
  540.      and 6 of the DCB Flags1 byte equal 01), then RTS is turned on. 
  541.      Otherwise, RTS is unchanged by the Initial Open.
  542.  
  543.      The following actions also occur during an Initial Open:
  544.  
  545.           The Xon and Xoff characters are set to 11h and 13h respectively.
  546.  
  547.           The transmit and receive buffers and structures are cleared and
  548.           re-initialized.
  549.  
  550.           Status bits are reset.
  551.  
  552.      If the Initial Opener is an OS/2 process (not a DOS process) then the
  553.      Read time out processing is set to "Normal" in the current DCB.
  554.  
  555.      Additional Open
  556.  
  557.      A count of active opens is incremented.  No changes are made to
  558.      current comm settings.
  559.  
  560.                                       Close
  561.  
  562.      There are two basic kinds of closes.  They are an Intermediate Close
  563.      and a Last Close.
  564.  
  565.      Intermediate Close
  566.  
  567.      An intermediate close occurs when a process issues a close and other
  568.      processes still have the communications port opened.  This type of
  569.      close simply decrements an open count and returns.  No action or
  570.      changes take place at the communications port.
  571.  
  572.      Last Close
  573.  
  574.      The last close occurs when a process issues a close and no other
  575.      process has the communications port open.  If there are any writes
  576.      pending or incomplete, the process is blocked (suspended) until the
  577.      writes complete or time out.  If 60 seconds pass with no activity at
  578.      the communications port, the port is forced to close and all writes
  579.      are terminated.  If any processes are blocked (suspended) waiting on a
  580.      read, they are forced to return to the process that issued the read.
  581.  
  582.      If either DTR Control Mode or RTS Control Mode are set to "Enabled" by
  583.      the current DCB, then the appropriate signal(s) is turned off.
  584.  
  585.      Finally, the IRQ is released back to the OS.
  586.  
  587.  
  588.  
  589.  
  590.                                                                           9
  591.  
  592.                        Device I/O Control (IOCtl) Commands
  593.  
  594.      The following Generic IOCtl functions are supported by SIO.
  595.           41h - Set Bit Rate
  596.           42h - Set Line Characteristics
  597.           43h - Extended Set Bit Rate
  598.           44h - Transmit Byte Immediate
  599.           45h - Set Break Off
  600.           46h - Set Modem Control Signals
  601.           47h - Hold Transmit
  602.           48h - Start Transmit (after hold)
  603.           4Bh - Set Break On
  604.           53h - Write Device Control Block (DCB) 
  605.           54h - Write Extended Mode Parameters
  606.           61h - Query Current Bit Rate
  607.           62h - Query Line Characteristics
  608.           63h - Query Extended Bit Rate
  609.           64h - Query SIO Status
  610.           65h - Query Transmit Data Status
  611.           66h - Query Current Modem Output Control Signals
  612.           67h - Query Current Modem Input Signals
  613.           68h - Query Number of Characters in Receive Buffer
  614.           69h - Query Number of Characters in Transmit Buffer
  615.           6Dh - Query SIO Error
  616.           72h - Query SIO Event Information
  617.           73h - Read Device Control Block (DCB)
  618.           74h - Read Enhanced Mode Parameters
  619.  
  620.      Each of these IOCtl commands are described in detail on the following
  621.      pages.
  622.  
  623.  
  624.  
  625.  
  626.      10
  627.  
  628.  
  629.      All IOCtl functions are called with a uniform set of parameters.  This
  630.      uniform set of parameters is:
  631.           DWORD     Address of a data packet.
  632.           WORD      Size of the data packet in bytes.
  633.           DWORD     Address of the parameter packet.
  634.           WORD      Size of the parameter packet in bytes.
  635.           WORD      Function code.
  636.           WORD      Category code (01 for SIO).
  637.           WORD      Handle for the opened device. 
  638.  
  639.      Each IOCtl function may or may not have a data or parameter packet. 
  640.      If a given IOCtl function specifies a NULL parameter or data packet,
  641.      the address of the appropriate item must be NULL (zero) in the
  642.      parameters.  Passing an invalid data or parameter packet may result in
  643.      a General Protection Fault.
  644.  
  645.      IOCtl Functions From a DOS Session
  646.  
  647.      Additionally the following describes how to call an IOCtl function in
  648.      an OS/2 driver from a DOS session (VDM).  The "handle" is obtained
  649.      simply by issuing a normal DOS open of the device, ie COM1.  The Data
  650.      Packets (DataPkt below) and Parameter Packets (PrmPkt below) are
  651.      different for each IOCtl function.  The structure and contents of
  652.      these packets are described in the following pages.
  653.  
  654.              push    ds              ;save ds
  655.              mov     bx,handle       ;file handle to bx
  656.              mov     ch,1            ;category, 1=serial device control
  657.              mov     cl,41h          ;func code, 41h=extended set bit rate
  658.              mov     dx,Seg DataPkt  ;get segment of the data packet
  659.              mov     ds,dx           ;load ds with seg of the data packet
  660.              lea     dx,DataPkt      ;data packet address to ds:dx
  661.              mov     si,Seg PrmPkt   ;segment of command packet to si
  662.              lea     di,PrmPkt       ;offset of command packet to di
  663.              mov     ax,440ch        ;IOCtl function call, handle based
  664.              int     21h             ;issue IOCtl to OS/2 driver.
  665.              pop     ds              ;restore ds
  666.              jc      error           ;jump if error returned
  667.  
  668.  
  669.  
  670.  
  671.                                                                          11
  672.  
  673.  
  674.                                41h - Set Bit Rate
  675.  
  676.      Parameter Packet
  677.  
  678.           ┌──────────────────────────────────────┐
  679.           │         Item                Type     │
  680.           ├───────────────────────────┬──────────┤
  681.           │ Bit/Baud Rate             │ WORD     │
  682.           └───────────────────────────┴──────────┘
  683.  
  684.           "Bit Rate" is any number from 1 to 65535.  SIO does not attempt
  685.           to validate a given bit rate.  The minimum bit rate accepted by
  686.           SIO is 50, the maximum for this IOCtl function is 65535.
  687.  
  688.           Note that the hardware may not be able to generate the given bit
  689.           rate.  For example, if a computer has a standard communications
  690.           card installed and if a bit rate of 65500 is specified, the
  691.           nearest bit rate that can be generated will be set, 57600 in this
  692.           case.
  693.  
  694.           To set bit rates in excess of 57600, see IOCtl function 43h,
  695.           Extended Set Bit Rate.
  696.  
  697.           Some commonly used bit rates that can be set with this function
  698.           are:
  699.  
  700.           50        2000
  701.           75        2400
  702.           110       3600
  703.           150       4800
  704.           300       7200
  705.           600       9600
  706.           1200      19200
  707.           1800      28800
  708.           2000      38400
  709.           2400      57600
  710.  
  711.  
  712.      Data Packet - None
  713.  
  714.  
  715.  
  716.  
  717.      12
  718.  
  719.  
  720.                          42h - Set Line Characteristics
  721.  
  722.      Parameter Packet
  723.  
  724.           ┌──────────────────────────────────────┐
  725.           │         Item                Type     │
  726.           ├───────────────────────────┬──────────┤
  727.           │ Data Bits Per Character   │ BYTE     │
  728.           ├───────────────────────────┼──────────┤
  729.           │ Parity Setting            │ BYTE     │
  730.           ├───────────────────────────┼──────────┤
  731.           │ Stop Bit Setting          │ BYTE     │
  732.           └───────────────────────────┴──────────┘
  733.  
  734.           Data Bits Per Character may be 5, 7, or 8, all other values are
  735.           invalid.
  736.  
  737.           Parity Setting may have the following values, all other values
  738.           are invalid:
  739.                0 - No parity bit.
  740.                1 - Odd parity.
  741.                2 - Even parity.
  742.                3 - Mark parity (1).
  743.                4 - Space parity (0).
  744.  
  745.  
  746.           Stop Bit Setting may have the following values, all other values
  747.           are invalid:
  748.                0 - 1 stop bit.
  749.                1 - 1.5 stop bit (valid with 5 data bit characters).
  750.                2 - 2 stop bits.
  751.  
  752.  
  753.      Data Packet - None
  754.  
  755.  
  756.  
  757.  
  758.                                                                          13
  759.  
  760.  
  761.                            43h - Extended Set Bit Rate
  762.  
  763.      Parameter Packet
  764.  
  765.           ┌──────────────────────────────────────┐
  766.           │         Item                Type     │
  767.           ├───────────────────────────┬──────────┤
  768.           │ Bit/Baud Rate             │ DWORD    │
  769.           ├───────────────────────────┼──────────┤
  770.           │ Fraction                  │ BYTE     │
  771.           └───────────────────────────┴──────────┘
  772.  
  773.  
  774.           "Bit Rate" is the desired bit/baud rate.  The maximum bit rate
  775.           supported by SIO is determined by the installed hardware. The
  776.           IOCtl function "63h - Query Extended Bit Rate" can be used to
  777.           determine the maximum bit rate allowed for the associated
  778.           hardware.
  779.  
  780.           SIO does not attempt to validate a given bit rate.  This means
  781.           that the hardware may not be able to generate the given bit rate. 
  782.           For example, if a computer has a standard communications card
  783.           installed and if a bit rate of 65500 is specified, the nearest
  784.           bit rate that can be generated will be set, 57600 in this case.
  785.  
  786.           "Fraction" is used to set the fractional part of the bit rate
  787.           when a high degree of accuracy is needed.  As of this writing,
  788.           SIO does not support a "Fraction" other than zero.
  789.  
  790.           Some commonly used bit rates that can be set with this function
  791.           are:
  792.  
  793.           110       3600      115200
  794.           150       4800      230400
  795.           300       7200      460800
  796.           600       9600      921600
  797.           1200      19200
  798.           1800      28800
  799.           2000      38400
  800.           2400      57600
  801.  
  802.      Data Packet - None
  803.  
  804.  
  805.  
  806.  
  807.      14
  808.  
  809.  
  810.                           44h - Transmit Byte Immediate
  811.  
  812.      Parameter Packet
  813.  
  814.           ┌──────────────────────────────────────┐
  815.           │         Item                Type     │
  816.           ├───────────────────────────┬──────────┤
  817.           │ Character to Transmit     │ BYTE     │
  818.           └───────────────────────────┴──────────┘
  819.  
  820.           "Character to Transmit" will be the next character loaded into
  821.           the UART for transmission.  If a previous transmit immediate byte
  822.           is still pending, it is lost.  This function does not wait for
  823.           the character to transmit before returning.
  824.  
  825.           This function may be used by an application program as one of a
  826.           set of functions to implement its own Xon/Xoff type handshaking.
  827.  
  828.      Data Packet - None
  829.  
  830.  
  831.                                45h - Set Break Off
  832.  
  833.      Parameter Packet - None
  834.  
  835.           Look!! No Parameter Packet!
  836.  
  837.      Data Packet
  838.  
  839.           ┌──────────────────────────────────────┐
  840.           │         Item                Type     │
  841.           ├───────────────────────────┬──────────┤
  842.           │ SIO Error Word            │ WORD     │
  843.           └───────────────────────────┴──────────┘
  844.  
  845.           See function 6Dh "Query SIO Error" for a description of the SIO
  846.           Error Word.  This function does not reset any bits in the SIO
  847.           Error Word.
  848.  
  849.  
  850.  
  851.  
  852.                                                                          15
  853.  
  854.  
  855.                          46h - Set Modem Control Signals
  856.  
  857.      Parameter Packet
  858.  
  859.           ┌──────────────────────────────────────┐
  860.           │         Item                Type     │
  861.           ├───────────────────────────┬──────────┤
  862.           │ DTR and RTS on mask       │ BYTE     │
  863.           ├───────────────────────────┼──────────┤
  864.           │ DTR and RTS off mask      │ BYTE     │
  865.           └───────────────────────────┴──────────┘
  866.  
  867.           Attempted changes in the the setting of signals that are used as
  868.           flow control signals are ignored.  The current DCB determines if
  869.           either or both RTS and DTR are used as a flow control signal.
  870.  
  871.           The setting of bit 0 affects DTR and the setting of bit 1 affects
  872.           RTS.  Ones in the "on mask" specifies which of the two signals
  873.           are to be turned on, and zeros in the "off mask" specify which of
  874.           the two signals are to be turned off.
  875.  
  876.           Some examples are:
  877.                On Mask        Off Mask
  878.                01h            0FFh      Turn DTR on
  879.                00h            0FEh      Turn DTR off
  880.                02h            0FFh      Turn RTS on
  881.                00h            0FDh      Turn RTS off
  882.                03h            0FFh      Turn RTS and DTR on
  883.                00h            0FCh      Turn RTS and DTR off
  884.  
  885.           If both on and off are specified for the setting of a signal, the
  886.           result is undefined.
  887.  
  888.      Data Packet
  889.  
  890.           ┌──────────────────────────────────────┐
  891.           │         Item                Type     │
  892.           ├───────────────────────────┬──────────┤
  893.           │ SIO Error Word            │ WORD     │
  894.           └───────────────────────────┴──────────┘
  895.  
  896.           See function 6Dh "Query SIO Error" for a description of the SIO
  897.           Error Word.  This function does not reset any bits in the SIO
  898.           Error Word.
  899.  
  900.  
  901.  
  902.  
  903.      16
  904.  
  905.  
  906.                                47h - Hold Transmit
  907.  
  908.      Parameter Packet - None
  909.  
  910.      Data Packet - None
  911.  
  912.           This function will disable the transmitter.  The transmitter will
  913.           not be enabled again unless IOCtl function 48h is issued.  If the
  914.           transmitter is already disabled, this call has no effect.
  915.  
  916.           This function can be used as part of a set that allows an
  917.           application to implement its own Xon/Xoff type handshaking.
  918.  
  919.           Note that this is different from how COM.SYS implements this
  920.           function.  COM.SYS will re-enable the transmitter if an Xon is
  921.           received while SIO will not.
  922.  
  923.  
  924.                               48h - Start Transmit
  925.  
  926.      Parameter Packet - None
  927.  
  928.      Data Packet - None
  929.  
  930.           This function will enable the transmitter, usually following an
  931.           IOCtl function 47h.  If the transmitter is already enabled, this
  932.           call has no effect.
  933.  
  934.           This function can be used as part of a set that allows an
  935.           application to implement its own Xon/Xoff type handshaking.
  936.  
  937.  
  938.  
  939.  
  940.                                                                          17
  941.  
  942.  
  943.                                4Bh - Set Break on
  944.  
  945.      Parameter Packet - None
  946.  
  947.           Look!! No Parameter Packet!
  948.  
  949.      Data Packet
  950.  
  951.           ┌──────────────────────────────────────┐
  952.           │         Item                Type     │
  953.           ├───────────────────────────┬──────────┤
  954.           │ SIO Error Word            │ WORD     │
  955.           └───────────────────────────┴──────────┘
  956.  
  957.           See function 6Dh "Query SIO Error" for a description of the SIO
  958.           Error Word.  This function does not reset any bits in the SIO
  959.           Error Word.
  960.  
  961.  
  962.                      53h - Write Device Control Block (DCB) 
  963.  
  964.      This is where the action is!  See also function 73h (Read DCB).
  965.  
  966.      Parameter Packet
  967.  
  968.           ┌──────────────────────────────────────┐
  969.           │         Item                Type     │
  970.           ├───────────────────────────┬──────────┤
  971.           │ Write Timeout             │ WORD     │
  972.           ├───────────────────────────┼──────────┤
  973.           │ Read Timeout              │ WORD     │
  974.           ├───────────────────────────┼──────────┤
  975.           │ Flags1                    │ BYTE     │
  976.           ├───────────────────────────┼──────────┤
  977.           │ Flags2                    │ BYTE     │
  978.           ├───────────────────────────┼──────────┤
  979.           │ Flags3                    │ BYTE     │
  980.           ├───────────────────────────┼──────────┤
  981.           │ Error Replacement Byte    │ BYTE     │
  982.           ├───────────────────────────┼──────────┤
  983.           │ Break Replacement Byte    │ BYTE     │
  984.           ├───────────────────────────┼──────────┤
  985.           │ Xon Character             │ BYTE     │
  986.           ├───────────────────────────┼──────────┤
  987.           │ Xoff Character            │ BYTE     │
  988.           └───────────────────────────┴──────────┘
  989.  
  990.  
  991.           "Write Timeout"  The write timeout is given in hundredths of a
  992.           second, relative to zero.  That is, 0 specifies 0.01 seconds and
  993.           1 specifies 0.02 seconds.
  994.  
  995.           "Read Timeout" The read timeout is given in hundredths of a
  996.           second, relative to zero.  That is, 0 specifies 0.01 seconds and
  997.  
  998.  
  999.  
  1000.  
  1001.      18
  1002.  
  1003.           1 specifies 0.02 seconds.
  1004.  
  1005.           "Flags1" is a bit flag.  The bits in the flag specify the
  1006.           following:
  1007.  
  1008.           Bits 1 and 0        DTR Control Mode.
  1009.                     00 - Disable changing DTR during Open and Close.
  1010.                     01 - Enable Changing DTR during Open and Close.
  1011.                     10 - DTR used for input handshaking (not supported by
  1012.                          SIO).
  1013.                     11 - Invalid
  1014.  
  1015.           Bit 2,    Must be zero
  1016.           Bit 3,    Off to ignore CTS.  Forced on if RTS is handshake.
  1017.           Bit 4,    DSR is handshake.  Not supported by SIO.
  1018.           Bit 5,    DCD required to transmit.  Not supported by SIO.
  1019.           Bit 6,    DSR required to receive.
  1020.           Bit 7,    Must be zero.
  1021.  
  1022.      ─────────────────────────────────────
  1023.  
  1024.           "Flags2" is a bit flag.  The bits in the flag specify the
  1025.           following:
  1026.  
  1027.           Bit 0,    SIO is to honor Xon/XOff received from remote.
  1028.           Bit 1,    SIO may send Xon/Xoff to the remote.
  1029.           Bit 2,    Enable error replacement character.  Not supported by
  1030.                     SIO.
  1031.  
  1032.           Bit 3,    Enable null stripping.  Not supported by SIO.
  1033.           Bit 4,    Enable break replacement character.  Not supported by
  1034.                     SIO.
  1035.  
  1036.           Bit 5,    Enable Full duplex.  Half duplex is not supported by
  1037.                     SIO.
  1038.  
  1039.           Bits 7 and 6        RTS Control Mode
  1040.                     00 - Disable changing RTS during Open and Close.
  1041.                     01 - Enable Changing RTS during Open and Close.
  1042.                     10 - RTS used for input handshaking.
  1043.                     11 - Toggle on transmit (half duplex).  Not supported
  1044.                          by SIO.
  1045.  
  1046.  
  1047.  
  1048.  
  1049.                                                                          19
  1050.  
  1051.           "Flags3" is a bit flag.  The bits in the flag specify the
  1052.           following:
  1053.  
  1054.           Bit 0,    Enable infinite write timeout processing.  When set, a
  1055.                     write timeout will not occur.
  1056.  
  1057.           Bits 2 and 1        Read timeout processing
  1058.                     00 - Invalid.
  1059.                     01 - Normal read time out.
  1060.                     10 - Wait for something.  Reads will return before a
  1061.                          timeout occurs if something received.
  1062.                     11 - No Wait.  Reads will return immediately with any
  1063.                          available data.
  1064.  
  1065.           Bits 4 and 3        FIFO Control
  1066.                     00 - No change in FIFO state.
  1067.                     01 - Disable FIFO buffers.
  1068.                     10 - Enable FIFO buffers.
  1069.                     11 - Dynamic enabling and disabling of FIFOS.
  1070.  
  1071.                **Note, SIO forces bits 4 and 3 to "10".
  1072.  
  1073.           Bits 6 and 5        Set receive trigger level
  1074.                     00 - 1 character.
  1075.                     01 - 4 characters.
  1076.                     10 - 8 characters.
  1077.                     11 - 14 characters.
  1078.  
  1079.                **Note, SIO forces bits 6 and 5 to "10".
  1080.  
  1081.           Bit 7               Transmit load count
  1082.                     0 -  Load 1 character.
  1083.                     1 -  Load 16 characters.
  1084.  
  1085.                **Note, SIO forces bit 7 to "1".
  1086.  
  1087.           "Error Replacement Byte" Not supported by SIO.
  1088.  
  1089.           "Break Replacement Byte" Not supported by SIO
  1090.  
  1091.           "Xon Character" Any value, default is 11h.
  1092.  
  1093.           "Xoff Character" Any value, default is 13h.
  1094.  
  1095.      Data Packet - None
  1096.  
  1097.  
  1098.  
  1099.  
  1100.      20
  1101.  
  1102.  
  1103.                       54h - Write Extended Mode Parameters
  1104.  
  1105.      Parameter Packet
  1106.  
  1107.           ┌──────────────────────────────────────┐
  1108.           │         Item                Type     │
  1109.           ├───────────────────────────┬──────────┤
  1110.           │ Enhanced Flags1           │ BYTE     │
  1111.           ├───────────────────────────┼──────────┤
  1112.           │ Reserved                  │ DWORD    │
  1113.           └───────────────────────────┴──────────┘
  1114.  
  1115.           This function is not supported (ignored) by SIO.  However the
  1116.           bits are defined here for completeness.
  1117.  
  1118.           Enhanced Flags1
  1119.           Bit 0 -   Enhanced mode hardware available (Query only 74h).
  1120.           Bit 1 -   Enable enhanced mode.
  1121.           Bits 3 and 2        DMA Receive Operation
  1122.                00 - Disable DMA receive capability.
  1123.                01 - Enable DMA receive capability.
  1124.                10 - Dedicate a DMA channel to receive.
  1125.                11 - Reserved.
  1126.  
  1127.           Bits 5 and 4        DMA Transmit Operation
  1128.                00 - Disable DMA transmit capability.
  1129.                01 - Enable DMA transmit capability
  1130.                10 - Dedicate a DMA channel to transmit.
  1131.                11 - Reserved.
  1132.  
  1133.           Bit 6 -   Receive in DMA mode (Query only, 74h).
  1134.           Bit 7 -   Transmit in DMA mode (Query only, 74h).
  1135.  
  1136.      Data Packet - None.
  1137.  
  1138.  
  1139.  
  1140.  
  1141.                                                                          21
  1142.  
  1143.  
  1144.                           61h - Query Current Bit Rate
  1145.  
  1146.      Parameter Packet - None.
  1147.  
  1148.      Data Packet
  1149.  
  1150.           ┌──────────────────────────────────────┐
  1151.           │         Item                Type     │
  1152.           ├───────────────────────────┬──────────┤
  1153.           │ Bit/Baud Rate             │ WORD     │
  1154.           └───────────────────────────┴──────────┘
  1155.  
  1156.           See function 41h for more information.
  1157.  
  1158.  
  1159.                         62h - Query Line Characteristics
  1160.  
  1161.      Parameter Packet - None.
  1162.  
  1163.  
  1164.      Data Packet
  1165.  
  1166.  
  1167.           ┌──────────────────────────────────────┐
  1168.           │         Item                Type     │
  1169.           ├───────────────────────────┬──────────┤
  1170.           │ Data Bits Per Character   │ BYTE     │
  1171.           ├───────────────────────────┼──────────┤
  1172.           │ Parity Setting            │ BYTE     │
  1173.           ├───────────────────────────┼──────────┤
  1174.           │ Stop Bit Setting          │ BYTE     │
  1175.           ├───────────────────────────┼──────────┤
  1176.           │ Transmitting Break        │ BYTE     │
  1177.           └───────────────────────────┴──────────┘
  1178.  
  1179.           See function 42h for a definition of Data, Parity and Stop Bits.
  1180.  
  1181.           "Transmitting Break" is set to 1 if a break is being transmitted. 
  1182.           Otherwise, it is set to zero.
  1183.  
  1184.  
  1185.  
  1186.  
  1187.      22
  1188.  
  1189.  
  1190.                           63h - Query Extended Bit Rate
  1191.  
  1192.      Parameter Packet - None
  1193.  
  1194.  
  1195.      Data Packet
  1196.  
  1197.           ┌──────────────────────────────────────┐
  1198.           │         Item                Type     │
  1199.           ├───────────────────────────┬──────────┤
  1200.           │ Current Bit/Baud Rate     │ DWORD    │
  1201.           ├───────────────────────────┼──────────┤
  1202.           │ Fraction of Current       │ BYTE     │
  1203.           ├───────────────────────────┼──────────┤
  1204.           │ Minimum Bit/Baud Rate     │ DWORD    │
  1205.           ├───────────────────────────┼──────────┤
  1206.           │ Fraction of Minimum       │ BYTE     │
  1207.           ├───────────────────────────┼──────────┤
  1208.           │ Maximum Bit/Baud Rate     │ DWORD    │
  1209.           ├───────────────────────────┼──────────┤
  1210.           │ Fraction of Maximum       │ BYTE     │
  1211.           └───────────────────────────┴──────────┘
  1212.  
  1213.           "Current Bit/Baud Rate" is a 32 bit integer defining the current
  1214.           bit rate.
  1215.  
  1216.           "Fraction of Current" is always 0 when returned by SIO.
  1217.  
  1218.           "Minimum Bit/Baud Rate" is the minimum value that can be passed
  1219.           to SIO as a bit/baud rate.
  1220.  
  1221.           "Fraction of Minimum" is always 0 when returned by SIO. 
  1222.  
  1223.           "Maximum Bit/Baud Rate" is the maximum value that can be passed
  1224.           to SIO as a bit/baud rate.
  1225.  
  1226.           "Fraction of Maximum" is always 0 when returned by SIO.
  1227.  
  1228.  
  1229.  
  1230.  
  1231.                                                                          23
  1232.  
  1233.  
  1234.                              64h - Query SIO Status
  1235.  
  1236.      Parameter Packet - None
  1237.  
  1238.      Data Packet
  1239.  
  1240.           ┌──────────────────────────────────────┐
  1241.           │         Item                Type     │
  1242.           ├───────────────────────────┬──────────┤
  1243.           │ SIO Status Byte           │ BYTE     │
  1244.           └───────────────────────────┴──────────┘
  1245.  
  1246.           "SIO Status Byte" is a bit flag.  The bits have the following
  1247.           meanings:
  1248.  
  1249.           Bit 0 -   Set if SIO is waiting for CTS before transmitting.
  1250.           Bit 1 -   Set if SIO is waiting for DSR before transmitting.
  1251.           Bit 2 -   Set if SIO is waiting for DCD before transmitting.
  1252.           Bit 3 -   Set if SIO is waiting because Xoff received or
  1253.                     transmitter is disabled (see function 47h).
  1254.  
  1255.           Bit 4 -   Reserved, not used by SIO.
  1256.           Bit 5 -   Set if SIO is waiting because break is being sent.
  1257.           Bit 6 -   Set if a transmit immediate is pending.
  1258.           Bit 7 -   Reserved, not used by SIO.
  1259.  
  1260.  
  1261.  
  1262.  
  1263.      24
  1264.  
  1265.  
  1266.                         65h - Query Transmit Data Status
  1267.  
  1268.      Parameter Packet - None.
  1269.  
  1270.      Data Packet
  1271.  
  1272.           ┌──────────────────────────────────────┐
  1273.           │         Item                Type     │
  1274.           ├───────────────────────────┬──────────┤
  1275.           │ Transmit Status           │ BYTE     │
  1276.           └───────────────────────────┴──────────┘
  1277.  
  1278.           "SIO Status Byte" is a bit flag.  The bits have the following
  1279.           meanings:
  1280.  
  1281.           Bit 0 -   Set if write in progress or pending.
  1282.           Bit 1 -   Set if any data is in the transmit buffer.
  1283.           Bit 2 -   Set if UART is currently transmitting.
  1284.           Bit 3 -   Set if a transmit immediate is pending.
  1285.           Bit 4 -   Set if an Xon needs to be sent.
  1286.           Bit 5 -   Set if an Xoff needs to be sent.
  1287.           Bit 6 -   Reserved
  1288.           Bit 7 -   Reserved
  1289.  
  1290.  
  1291.  
  1292.  
  1293.                                                                          25
  1294.  
  1295.  
  1296.                 66h - Query Current Modem Output Control Signals
  1297.  
  1298.  
  1299.      Parameter Packet - None.
  1300.  
  1301.      Data Packet
  1302.  
  1303.           ┌──────────────────────────────────────┐
  1304.           │         Item                Type     │
  1305.           ├───────────────────────────┬──────────┤
  1306.           │ Modem Output Signals      │ BYTE     │
  1307.           └───────────────────────────┴──────────┘
  1308.  
  1309.           "Modem Output Signals" is a bit flag.  The bits have the
  1310.           following meanings:
  1311.  
  1312.           Bit 0 -   Set if DTR is currently on.
  1313.           Bit 1 -   Set if RTS is currently on.
  1314.           Bits 2-7  Reserved, set to zero by SIO.
  1315.  
  1316.  
  1317.                      67h - Query Current Modem Input Signals
  1318.  
  1319.      Parameter Packet - None.
  1320.  
  1321.      Data Packet
  1322.  
  1323.           ┌──────────────────────────────────────┐
  1324.           │         Item                Type     │
  1325.           ├───────────────────────────┬──────────┤
  1326.           │ Modem Input Signals       │ BYTE     │
  1327.           └───────────────────────────┴──────────┘
  1328.  
  1329.           "Modem Output Signals" is a bit flag.  The bits have the
  1330.           following meanings:
  1331.  
  1332.           Bits 0-3  Reserved, set to zero by SIO.
  1333.           Bit 4 -   Clear To Send (CTS) is active.
  1334.           Bit 5 -   Data Set Ready (DSR) is active.
  1335.           Bit 6 -   Ring Indicator (RI), trailing edge detected.
  1336.           Bit 7 -   Data Carrier Detect (DCD) is active.
  1337.  
  1338.  
  1339.  
  1340.  
  1341.      26
  1342.  
  1343.  
  1344.                68h - Query Number of Characters in Receive Buffer
  1345.  
  1346.      Parameter Packet - None.
  1347.  
  1348.      Data Packet
  1349.  
  1350.           ┌──────────────────────────────────────┐
  1351.           │         Item                Type     │
  1352.           ├───────────────────────────┬──────────┤
  1353.           │ Number of Bytes Buffered  │ WORD     │
  1354.           ├───────────────────────────┼──────────┤
  1355.           │ Byte Size of the Buffer   │ WORD     │
  1356.           └───────────────────────────┴──────────┘
  1357.  
  1358.           Self explaining.
  1359.  
  1360.  
  1361.                69h - Query Number of Characters in Transmit Buffer
  1362.  
  1363.      Parameter Packet - None.
  1364.  
  1365.      Data Packet
  1366.  
  1367.           ┌──────────────────────────────────────┐
  1368.           │         Item                Type     │
  1369.           ├───────────────────────────┬──────────┤
  1370.           │ Number of Bytes Buffered  │ WORD     │
  1371.           ├───────────────────────────┼──────────┤
  1372.           │ Byte Size of the Buffer   │ WORD     │
  1373.           └───────────────────────────┴──────────┘
  1374.  
  1375.           Self explaining.
  1376.  
  1377.  
  1378.  
  1379.  
  1380.                                                                          27
  1381.  
  1382.  
  1383.                               6Dh - Query SIO Error
  1384.  
  1385.  
  1386.      Parameter Packet - None.
  1387.  
  1388.      Data Packet
  1389.  
  1390.           ┌──────────────────────────────────────┐
  1391.           │         Item                Type     │
  1392.           ├───────────────────────────┬──────────┤
  1393.           │ SIO Error Word            │ WORD     │
  1394.           └───────────────────────────┴──────────┘
  1395.  
  1396.           "SIO Error Word" is a bit flag.  The bits have the following
  1397.           meaning:
  1398.  
  1399.           Bit 0 -   Set if a buffer overrun has occurred.
  1400.           Bit 1 -   Set if an overrun occurred at the UART.
  1401.           Bit 2 -   Set if the UART detected a parity error.
  1402.           Bit 3 -   Set if the UART detected a framing error.
  1403.           Bits 4-15 Reserved, set to zero by SIO.
  1404.  
  1405.           All bits of the SIO Error Word are reset prior to returning to
  1406.           the caller.
  1407.  
  1408.  
  1409.  
  1410.  
  1411.      28
  1412.  
  1413.  
  1414.                         72h - Query SIO Event Information
  1415.  
  1416.      Parameter Packet - None.
  1417.  
  1418.      Data Packet
  1419.  
  1420.           ┌──────────────────────────────────────┐
  1421.           │         Item                Type     │
  1422.           ├───────────────────────────┬──────────┤
  1423.           │ SIO Event Word            │ WORD     │
  1424.           └───────────────────────────┴──────────┘
  1425.  
  1426.           "SIO Event Word" is a bit flag.  The bits have the following
  1427.           meaning:
  1428.  
  1429.           Bit 0 -   Set when a receive character is transferred from the
  1430.                     UART to the receive buffer.
  1431.           Bit 1 -   Set when a receive (Read) timeout occurs.
  1432.           Bit 2 -   Set if the transmit buffer is empty.
  1433.           Bit 3 -   Set if Clear To Send (CTS) has changed state.
  1434.           Bit 4 -   Set if Data Set Ready (DSR) has changed state.
  1435.           Bit 5 -   Set if Data Carrier Detect (DCD) has changed state.
  1436.           Bit 6 -   Set if a break has been detected.
  1437.           Bit 7 -   Set if a framing, parity, or overrun error has
  1438.                     occurred.
  1439.           Bit 8 -   Set if trailing edge of Ring Indicator (RI) has
  1440.                     occurred.
  1441.           Bits 9-15 Reserved, set to zero by SIO.
  1442.  
  1443.           All bits are reset prior to returning to the caller.
  1444.  
  1445.  
  1446.  
  1447.  
  1448.                                                                          29
  1449.  
  1450.  
  1451.                       73h - Read Device Control Block (DCB)
  1452.  
  1453.      Parameter Packet - None.
  1454.  
  1455.  
  1456.      Data Packet
  1457.  
  1458.           ┌──────────────────────────────────────┐
  1459.           │         Item                Type     │
  1460.           ├───────────────────────────┬──────────┤
  1461.           │ Write Timeout             │ WORD     │
  1462.           ├───────────────────────────┼──────────┤
  1463.           │ Read Timeout              │ WORD     │
  1464.           ├───────────────────────────┼──────────┤
  1465.           │ Flags1                    │ BYTE     │
  1466.           ├───────────────────────────┼──────────┤
  1467.           │ Flags2                    │ BYTE     │
  1468.           ├───────────────────────────┼──────────┤
  1469.           │ Flags3                    │ BYTE     │
  1470.           ├───────────────────────────┼──────────┤
  1471.           │ Error Replacement Byte    │ BYTE     │
  1472.           ├───────────────────────────┼──────────┤
  1473.           │ Break Replacement Byte    │ BYTE     │
  1474.           ├───────────────────────────┼──────────┤
  1475.           │ Xon Character             │ BYTE     │
  1476.           ├───────────────────────────┼──────────┤
  1477.           │ Xoff Character            │ BYTE     │
  1478.           └───────────────────────────┴──────────┘
  1479.  
  1480.           See function 53h for a description of the parameters.
  1481.  
  1482.  
  1483.                        74h - Read Enhanced Mode Parameters
  1484.  
  1485.      Parameter Packet - None.
  1486.  
  1487.      Data Packet
  1488.  
  1489.           ┌──────────────────────────────────────┐
  1490.           │         Item                Type     │
  1491.           ├───────────────────────────┬──────────┤
  1492.           │ Enhanced Flags1           │ BYTE     │
  1493.           ├───────────────────────────┼──────────┤
  1494.           │ Reserved                  │ DWORD    │
  1495.           └───────────────────────────┴──────────┘
  1496.  
  1497.           See function 54h for a description of the Flags1 Byte.
  1498.  
  1499.  
  1500.  
  1501.  
  1502.      30
  1503.  
  1504.                     Differences between SIO/VSIO and COM/VCOM
  1505.      What follows is some of the differences between SIO/VSIO and COM/VCOM
  1506.      that are known to the author.
  1507.  
  1508.      1 -  COM.SYS will automatically seek out and support four comm
  1509.           ports, COM1 through COM4.  SIO.SYS will automatically seek
  1510.           out and support only COM1 and COM2.  If SIO.SYS is to
  1511.           support more than two comm ports, they must be defined in
  1512.           the command line that loads SIO.SYS.  For example,
  1513.           DEVICE=SIO.SYS (COM3) (COM4) will cause SIO.SYS to support
  1514.           four comm ports.
  1515.  
  1516.      2 -  In the absence of overrides in the command line, COM.SYS
  1517.           will seek out four comm ports in the sequence of I/O ports
  1518.           3F8h, 2F8h, 3E8h and 2E8h.  The first port found in this
  1519.           sequence is given the logical name COM1, the second is COM2
  1520.           etc.  This means that the comm port at 2F8h could become
  1521.           COM1.  In the opinion of the author, this confuses some
  1522.           users to frustration.
  1523.  
  1524.           With no command line overrides, SIO.SYS uses a fixed I/O
  1525.           port concept.  That is, COM1 is always at I/O port 3F8h,
  1526.           COM2 is always at 2F8h, etc.  Another way of looking at this
  1527.           is;  if no comm port exists at port 3F8h, then you do not
  1528.           have a COM1.  SIO.SYS will not move another (found) comm
  1529.           port into the logical COM1 slot.
  1530.  
  1531.      3 -  VSIO opens a comm port for a DOS session with sharing allowed. 
  1532.           VCOM uses an "exclusive use" open for DOS sessions.
  1533.  
  1534.      4 -  SIO.SYS will accept any number from 50 up as a valid baud rate. 
  1535.           For example, if an application program attempts to set a baud
  1536.           rate of 9990 bps, COM.SYS will reject it and SIO.SYS will accept
  1537.           it.
  1538.  
  1539.      5 -  SIO/VSIO execute faster than COM/VCOM.  This means that some
  1540.           applications, that are timing dependent, may not work under
  1541.           SIO/VSIO that do work under COM/VCOM.
  1542.  
  1543.      6 -  SIO/VSIO provides more reliable active flow control for DOS
  1544.           sessions.  For example, if RTS/CTS handshaking is in use, VSIO
  1545.           virtualizes the RTS settings by the DOS program while SIO
  1546.           completely controls the real RTS signal.  COM/VCOM simply passes
  1547.           the RTS signal directly to the hardware.
  1548.  
  1549.      7 -  COM.SYS will block an application until a write completes.  SIO
  1550.           will return to the application program immediately if all of the
  1551.           write data will fit into SIO's internal buffers.
  1552.  
  1553.  
  1554.  
  1555.  
  1556.                                                                          31
  1557.  
  1558.                   Appendix A, Hardware Port and IRQ Assignments
  1559.  
  1560.      I have obtained the following information from various sources. 
  1561.      Accuracy is not guaranteed.  In fact, nothing in this document is
  1562.      guaranteed.
  1563.  
  1564.      Addresses and IRQs for COM1 and COM2
  1565.  
  1566.           COM1 uses 03F8h and IRQ4
  1567.           COM2 uses 02F8h and IRQ3
  1568.  
  1569.      Defacto standard for COM3 and COM4 for PC, XT and AT
  1570.  
  1571.           COM3 uses 03E8h and IRQ4
  1572.           COM4 uses 02E8h and IRQ3
  1573.  
  1574.      Addresses and IRQ for COM3 through COM8 on the PS/2
  1575.  
  1576.           COM3 uses 3220h and IRQ3
  1577.           COM4 uses 3228h and IRQ3
  1578.           COM5 uses 4220h and IRQ3
  1579.           COM6 uses 4228h and IRQ3
  1580.           COM7 uses 5220h and IRQ3
  1581.           COM8 uses 5228h and IRQ3
  1582.  
  1583.      All PCs (known to the author) prior to the PS/2 and EISA only use 10
  1584.      bits to address hardware I/0 ports.  Systems prior to the PS/2 and
  1585.      EISA can not address the standard PS/2 addresses for COM3 through
  1586.      COM8.  If an AT or below attempts to address COM3 through COM8 using
  1587.      the PS/2 addresses, only the low 10 bits of the address are used. 
  1588.      That is, the high 6 bits of the address will be ignored by the
  1589.      hardware.  This means that any reference to COM3 through COM8 will
  1590.      actually address ports 220h through 22Fh on older PCs.
  1591.  
  1592.      One should avoid expansion boards that use ports 220h through 22Fh
  1593.      unless the expansion board is a serial I/O board. 
  1594.  
  1595.      SIO will (attempt to) determine the hardware architecture (ISA/EISA
  1596.      and PS/2) that it is being executed on and use the appropriate
  1597.      hardware port addresses for COM1 thru COM4 as defaults.
  1598.  
  1599.  
  1600.  
  1601.  
  1602.      32
  1603.  
  1604.                               Appendix B, SIO Chips
  1605.  
  1606.  
  1607.      The following is a collection of comments developed from hearsay,
  1608.      random documents, experience, and technical specifications. So, take
  1609.      it with a grain of salt.  Order information from the various
  1610.      manufactures if you want accurate information.
  1611.  
  1612.      Very good reference books are available from National Semiconductor
  1613.      Corporation.  They cover most of the SIO devices (also called UARTs)
  1614.      that you will find in many PCs and clones.  I am not sure that books
  1615.      can be ordered directly from National Semiconductor. They may require
  1616.      that you get it from a distributor.  In any case, the address on the
  1617.      back of the one manual is:
  1618.  
  1619.           National Semiconductor Corporation
  1620.           2900 Semiconductor Drive
  1621.           P.O. Box 58090
  1622.           Santa Clara, CA 95052-8090
  1623.  
  1624.           Tel:(408)721-5000
  1625.           TWX:(910)339-9240
  1626.  
  1627.      8250
  1628.  
  1629.      As best I known, the 8250 was the first SIO chip (integrated circuit)
  1630.      that was used by the IBM PC and many clones.  In my opinion, it was a
  1631.      poor choice on the part of IBM.  I feel many superior devices, at
  1632.      comparable prices, were readily available.  At that time, I feel the
  1633.      8251A or the 8530 would have been better choices.  But, they used the
  1634.      8250 and therefore we must use it.
  1635.  
  1636.      From a hardware standpoint the 8250 is a relatively slow device.  It
  1637.      is advisable that programmers not perform successive inputs or outputs
  1638.      to this device.  It seems that software programs can load the various
  1639.      registers of the 8250 faster than it can process the information.  The
  1640.      8250 had a total of 7 registers.  The specifications state that 56kb
  1641.      is the maximum baud rate.
  1642.  
  1643.      8250A
  1644.  
  1645.      I believe the 8250A is the 8250 with some bug fixes.  I have no idea
  1646.      what the bugs may have been.  A quick glance at the specifications
  1647.      shows the speed of the 8250 and 8250A to be much the same.  The 8250A
  1648.      added an 8th register.  This additional register enables software to
  1649.      detect if an 8250 is installed.  The specifications state that 56kb is
  1650.      the maximum baud rate.
  1651.  
  1652.  
  1653.  
  1654.  
  1655.                                                                          33
  1656.  
  1657.      16450
  1658.  
  1659.      The 16450 seems to be a speeded up version of the 8250A.  There is no
  1660.      direct way (that I know of) for software to detect the difference
  1661.      between an 8250A and a 16450.  I believe the 16450 was developed to
  1662.      eliminate the need for software to insert delays between successive
  1663.      accesses to the device.  The specifications indicate the 16450 is a
  1664.      much faster device than its predecessors.  The additional speed is
  1665.      only the speed at which the processor can access the device.  The
  1666.      maximum baud rate for the 16450 is still stated at 56kb.  However, I
  1667.      have been told by some people that they have run the 16450
  1668.      successfully at much higher speeds. I do not believe there was ever a
  1669.      16450A.
  1670.  
  1671.      16C451
  1672.  
  1673.      The 16C451 is a CMOS version of the 16450.  CMOS is a term for the
  1674.      material and manufacturing process used to make the part.  CMOS
  1675.      typically uses less power than other technologies.  If you are not
  1676.      designing hardware, you should view the 16C451 as a 16450.
  1677.  
  1678.      16550 (Non A)
  1679.  
  1680.      It is hard to find a 16550 (Non A).  I was told by National
  1681.      Semiconductor that they did everything they could to get all 16550s
  1682.      back.  SIO will detect a 16550 and tell you if you have one.  I am
  1683.      told that the 16550 was installed in early PS/2 systems.
  1684.  
  1685.      The 16550 was the first shot at a FIFOed version of the 8250 family
  1686.      from National semiconductor.  However, I was told by National
  1687.      Semiconductor that the FIFOs of the 16550 are not reliable and they
  1688.      should not be enabled.  SIO will treat a 16550 like a 16450.  In this
  1689.      mode, they are reliable.  National Semiconductor would not provide me
  1690.      with a specification for the 16550.  However, I suspect its maximum
  1691.      baud rate is the same as the 16550A which is 256kb.
  1692.  
  1693.      16550A, 16550AF and 16550AFN
  1694.  
  1695.      In the manuals that I have, National Semiconductor does not explain
  1696.      the differences between the 16550A and the 16550AF.  I suspect the AF
  1697.      part may have a few bug fixes.  I believe the N in AFN describes
  1698.      packaging, ceramic versus plastic, DIP versus surface mount etc.
  1699.  
  1700.      In the opinion of the author, there is no substitute for the 16550A
  1701.      (and its successors) in the 8250 type series.  The 16550A is
  1702.      compatible with most software written for the entire family of 8250
  1703.      type devices.  Programs that are 16550A aware can provide much
  1704.      improved performance over previous devices.
  1705.  
  1706.  
  1707.      The maximum baud rate for the 16550A is specified at 256kb.  However,
  1708.      due to the hardware design of the PC et al, 115kb is the maximum baud
  1709.      rate that can be programmed by software.
  1710.  
  1711.      The 16550A can be plugged into the same socket that contains an 8250,
  1712.  
  1713.  
  1714.  
  1715.  
  1716.      34
  1717.  
  1718.      8250A or 16450.  If your SIO expansion board has the SIO chips in
  1719.      sockets, you can upgrade to the 16550A by simply removing the old
  1720.      chips and replacing them with 16550As.
  1721.  
  1722.      The key to the performance increase of the 16550A is its FIFOs.  It
  1723.      has 16 byte FIFOs for both transmit and receive data.
  1724.  
  1725.      16550s Made by Western Digital
  1726.  
  1727.      I have been told, but I have not verified for myself, that 16550s made
  1728.      by Western Digital have a problem with their FIFOs when working at
  1729.      2400 baud or below.
  1730.  
  1731.      16C551
  1732.  
  1733.      The 16C551 is a CMOS version of the 16550AF.  See the above
  1734.      description of the 16C451 for a discussion of CMOS.  Do not feel you
  1735.      need to upgrade from a 16550A or AF to a 16C551.  There is no gain
  1736.      from an existing users point of view.
  1737.  
  1738.      16C552
  1739.  
  1740.      The 16C552 is two 16C551s on a single chip.
  1741.  
  1742.      16C554
  1743.  
  1744.      The 16C554 is four 16C551s on a single chip.
  1745.  
  1746.      82510
  1747.  
  1748.      I believe Intel is the only company that manufactures the 82510.  The
  1749.      82510 is feature rich with several modes of operation.  Its default
  1750.      mode is to operate as a 16450.  The 82510 has a 4 byte FIFO for both
  1751.      transmit and receive data.  A 4 byte FIFO is sufficient to provide
  1752.      significant performance over a basic 16450.
  1753.  
  1754.      The 82510 is small in size.  Therefore, it is found in many lap tops.
  1755.  
  1756.      The 82510 is somewhat of a sleeper.  I believe it would be much more
  1757.      widely used if Intel had promoted it more.  However, given a choice
  1758.      between the 82510 and the 16550A, I would select the 16550A.
  1759.  
  1760.  
  1761.  
  1762.  
  1763.                                                                          35
  1764.  
  1765.  
  1766.      16650
  1767.  
  1768.      The 16650 by Startech seems a good logical step in the evolution of
  1769.      the 8250 type UARTs.  One of the many flavors of the 16650 is a
  1770.      package that is pin compatible with the 40 pin (DIP) 16550s.  This
  1771.      means that the 16650 can be placed into the same socket as any 16550,
  1772.      8250, etc.
  1773.  
  1774.      The 16650 has enhanced the FIFOs to 32 bytes, added on chip flow
  1775.      control ability, and increases the maximum bit rate to 460800.  The on
  1776.      chip flow control is a really nice feature.  On chip flow control
  1777.      practically eliminates the possibility of missed receive characters. 
  1778.      On chip flow control also means that some devices that require
  1779.      immediate attention when it sends Xoff, like the Seiko Label Printer,
  1780.      will work much better in environments like OS/2 and Windows.
  1781.  
  1782.      The 32 byte FIFOs of the 16650 is an improvement over the 16550, but
  1783.      is still a disappointment.  I feel that 1k, or larger, FIFOs would
  1784.      have been a much better choice.  When I quizzed Startech about this,
  1785.      they replied that the 32 byte FIFOs were chosen to keep the cost down. 
  1786.      They added that if the 16650 is successful, they plan a 16750 with
  1787.      larger FIFOs.
  1788.  
  1789.      The 16650 powers up in a 16550 compatible mode, meaning most software
  1790.      written for the 16550 should work.  I have discovered a serious
  1791.      incompatibility in the current (Oct 1994) versions of the 16650.  All
  1792.      previous UARTS in the 8250 family will issue only a single transmit
  1793.      interrupt if no additional data is sent to the UART.  The 16650 on the
  1794.      other hand, will issue continuous transmit interrupts making it
  1795.      necessary to mask the transmit interrupt.  I quizzed Startech about
  1796.      this and was told that a new revision of the chip would be available
  1797.      within a few months that would correct this incompatibility.
  1798.  
  1799.      16750 from Texas Instruments
  1800.  
  1801.      The 16750 from TI is an improvement over the 16550, but the omission
  1802.      of software flow control (Xon/Xoff) makes it inferior to the 16650, in
  1803.      the opinion of the author.  The 16750 has a 64 byte fifo and hardware
  1804.      flow control.  It is a good choice for a uart.
  1805.  
  1806.  
  1807.  
  1808.  
  1809.      36
  1810.  
  1811.  
  1812.      ComBic
  1813.  
  1814.      The ComBic is a very impressive UART used on the Hayes ESP card and
  1815.      some others.  The ComBic is basically a 16550 UART with on chip flow
  1816.      control and 1k FIFOs and a maximum bit rate of 921600.   Like the
  1817.      16650, on chip flow control practically eliminates the possibility of
  1818.      missed receive characters.  On chip flow control also means that some
  1819.      devices that require immediate attention when it sends Xoff, like the
  1820.      Seiko Label Printer, will work much better in environments like OS/2
  1821.      and Windows.
  1822.  
  1823.      The ComBic has two modes of operation, compatibility mode and enhanced
  1824.      mode.  In compatibility mode, the UART acts as a 16550.  However, when
  1825.      in compatibility mode, the 1k FIFOs and on chip flow control can still
  1826.      be used.  In enhanced mode, software gains the ability to look into
  1827.      the FIFOs and determine the exact number of bytes loaded.  This
  1828.      feature enables software the use block input and output to the ComBic
  1829.      which greatly reduces processor overhead.
  1830.  
  1831.  
  1832.  
  1833.  
  1834.                                                                          37
  1835.  
  1836.  
  1837.                      Appendix C, Multi-Port Serial I/0 Cards
  1838.  
  1839.      I have received many requests for information about multi-port serial
  1840.      I/O card.  I will describe the boards that I know about (or have heard
  1841.      about) here.  I will add to the list as I receive precise information
  1842.      from manufactures, users, or I develop it myself.
  1843.  
  1844.      Hayes ESP
  1845.  
  1846.      The original ESP (ESP V1) is not supported.  The SIO command line must
  1847.      contain the ESP's enhanced I/O port address.  For bit rates exceeding
  1848.      180000bps the IRQ MUST be specified for the master port. For lower
  1849.      data rates NONE may be specified for the IRQ.  SIO does not search for
  1850.      the ESP ports as the Hayes drivers do under DOS/Windows.  This
  1851.      searching can (will) break things under OS/2.  The SIO command line
  1852.      for an ESP at I/O port 180h using IRQ14 would be as follows:
  1853.  
  1854.      DEVICE=path\SIO.SYS (COM1,180,IRQ14) (COM2,188,NONE)
  1855.  
  1856.      If you would like the above reflected to DOS sessions as a standard
  1857.      COM1 and COM2, then use the following command line:
  1858.  
  1859.      DEVICE=path\SIO.SYS (COM1,180:3F8,IRQ14:IRQ4) (COM2,188:2F8,NONE:IRQ3)
  1860.  
  1861.      Note that the numbers after the colons ":" are the address and IRQ of
  1862.      where the port appears to DOS software running under OS/2.  
  1863.      Any IRQ specified for an ESP slave port is ignored.  For those that
  1864.      like to have a clean looking CONFIG.SYS, SIO will accept NONE as the
  1865.      IRQ specification of an ESP slave port.
  1866.  
  1867.      If you wish to use the ESP in Compatibility Mode, simply specify the
  1868.      base port address that the ESP's compatibility mode is configured for
  1869.      (ie 3F8 when configured for COM1).
  1870.  
  1871.      Telcor Tport
  1872.  
  1873.      The Telcor Tport is supported in both burst mode and 16450 emulation
  1874.      mode.  When in burst mode, the Tport's 16k FIFOs are enabled. 
  1875.      Additionally in burst mode, no IRQ is used by the Tport.  In burst
  1876.      mode, any IRQ specified for the Tport is ignored.  For those that like
  1877.      to have a clean looking CONFIG.SYS, SIO will accept NONE as the IRQ
  1878.      specification of a Tport.  An example command line defining a Tport
  1879.      card to be used in burst mode; and that is configured for COM1
  1880.      follows:
  1881.  
  1882.      DEVICE=path\SIO.SYS (COM1,Tport@3F8,NONE:IRQ4)
  1883.  
  1884.      The Tport's 16450 Emulation mode simply uses a normal SIO command
  1885.      line. eg:
  1886.  
  1887.      DEVICE=path\SIO.SYS (COM1,3F8,IRQ4:IRQ4)
  1888.  
  1889.      In both examples the "IRQ4" following the colon above, means that the
  1890.      virtual IRQs are to be sent to a VDM on IRQ4.
  1891.  
  1892.  
  1893.  
  1894.  
  1895.      38
  1896.  
  1897.      STB 4COM  (ISA bus)
  1898.  
  1899.      I am very impressed with the STB 4COM card, they have almost got it. 
  1900.      Yes, it's the same company that makes the VGA cards.  The 4COM card
  1901.      uses a 16554 which is the equivalent of four 16550A.  Comm ports can
  1902.      use IRQs 2/9, 3, 4, 5, 10, 11, 12, and 15.  Any or all ports can share
  1903.      IRQs, and they have done this right.  I tested SIO with all four ports
  1904.      of the 4COM on IRQ12 and they worked correctly.  The user can select
  1905.      any of the following I/O port address for a comm port: 3F8, 2F8, 3E8,
  1906.      2E8, 1A8, 1E8, 1F8, 2A8.
  1907.  
  1908.      The 4COM card is priced at $110 and I ordered mine from Prerapture
  1909.      Solutions which can be reached by telephone at 1-919-286-1502 for
  1910.      information and foreign callers.  In the US orders can be placed by
  1911.      calling 1-800-735-5266.  Their mailing address is:
  1912.           Prerapture Solutions
  1913.           1806 Albany St.
  1914.           Durham NC 27705-3135
  1915.  
  1916.      Gtek BBS550 (ISA bus)
  1917.  
  1918.      The Gtek BBS550 is a communications card with the equivalent of 8
  1919.      16550s (in reality two 16554s) UARTS.  Where were these cards 5 years
  1920.      ago!  Like the STB 4COM, I am very impressed with the BBS550.  It has
  1921.      a wide range of selectable I/O port address, some in the 16 bit range
  1922.      (above 3FFh) which can be very useful.  I tested the board with all 8
  1923.      ports installed using IRQ3 (although I never had more than 3 ports
  1924.      active at the same time).  The board performed well using shared IRQs.
  1925.  
  1926.      The BBS550 has 8 RJ-45 connectors (10 pin), 6 of which comes directly
  1927.      off the back of the card.  The other two RJ-45 connectors are internal
  1928.      and special cables with grommets are supplier for these 2 ports.  The
  1929.      cables supplied with the BBS550 expands the RJ-45 out to standard DB-
  1930.      25 connectors.
  1931.  
  1932.      Gtek is located in St. Louis Mississippi.  Their phone number is 800-
  1933.      282-4835 or 601-467-8048.
  1934.  
  1935.  
  1936.  
  1937.  
  1938.                                                                          39
  1939.  
  1940.      Neotech Quad Serial (MCA bus)
  1941.  
  1942.      Well, I just got my first PS/2 system (for testing of SIO) and I am
  1943.      using the NeoTech Quad Serial card in that system.  What can I say, it
  1944.      works beautifully and interrupt sharing has never been a problem on
  1945.      MCA systems.  This card (as shipped) came with four individual 16450
  1946.      chips installed, but they were in sockets so I installed 16550 UARTS
  1947.      before I installed the card.  The card has one large connector on the
  1948.      back of the card and the supplied cable expands that to 4 standard DB-
  1949.      25 connectors.  Those of you needing a 4 port card for an MCA system
  1950.      contact:
  1951.  
  1952.           Neotech Inc
  1953.           30295 Solon Industrial Pkwy.
  1954.           Solon, Ohio 44139
  1955.  
  1956.           Voice     (216) 248-4114
  1957.           FAX       (216) 248-5701
  1958.  
  1959.  
  1960.  
  1961.  
  1962.      40
  1963.  
  1964.                         Appendix D, Advanced SIO Options
  1965.  
  1966.  
  1967.      The following is provided for the experienced user.  Inexperienced
  1968.      users get themselves into a lot of trouble when trying to use these
  1969.      options and they cause an inordinate number of support problems.
  1970.      Therefore, the following are unsupported options.  If you use them,
  1971.      you must work out the problems yourself or ask a friend how they got
  1972.      it working.
  1973.  
  1974.      Protection
  1975.  
  1976.      Placing a dash "-" or a plus "+" in the fourth parameter position, eg
  1977.      (COM1,3F8,IRQ4,-),  causes SIO not to provide any protection for that
  1978.      port.  The OS may still protect the port somewhat.  When the dash
  1979.      parameter is used the port is wide open (like DOS) for any process to
  1980.      access it.  If the plus is used, then DOS/Windows sessions are
  1981.      inhibited from turning DTR off.
  1982.  
  1983.      Locked Baud Rate
  1984.  
  1985.      Placing a colon and a baud rate following the communications port, eg
  1986.      (COM1:38400,3F8,IRQ4), causes the port to be locked at that baud rate. 
  1987.      No program, OS2 or DOS, is allowed to change the baud rate.
  1988.  
  1989.      IRQ Reflection to DOS Process
  1990.  
  1991.      Normally the IRQ that is reflected to a DOS process is the same as the
  1992.      actual hardware IRQ.  Placing a colon and an additional IRQ following
  1993.      the normal IRQ, eg (COM1,3F8,IRQ12:IRQ4), causes SIO/VSIO to reflect
  1994.      the IRQ to a DOS process on IRQ4 (in this example) even though the
  1995.      real hardware IRQ is IRQ12.  If one wishes SIO to automatically locate
  1996.      the hardware IRQ, then the following construct can be used:
  1997.      (COM1,3F8,:IRQ4).  Notice that the hardware IRQ is simply NOT
  1998.      specified.
  1999.  
  2000.      I/O Port Mapping to DOS Process
  2001.  
  2002.      Some DOS programs, such as CompuServe's CIM, insist that COM1 be at
  2003.      I/O port 03F8, COM2 at 02F8, etc.  On OS/2 systems, comm ports can
  2004.      have any I/O port address as specified by a command line.  If COM1 is
  2005.      not at I/O port 03F8 for some DOS programs, then COM1 can not be used
  2006.      by the DOS program.  The SIO command line allows the I/O ports to be
  2007.      mapped to a different address for DOS sessions, eg
  2008.      (COM1,FF80:03F8,IRQ12:IRQ4).  In this example, the real COM1 is at
  2009.      FF80 on IRQ12, but is reflected to DOS processes on I/O ports 03F8 at
  2010.      IRQ4.  It is NOT necessary to map both the I/O port address and the
  2011.      IRQ.  When the I/O port is mapped to a DOS session, the UART will
  2012.      appear at BOTH I/O port addresses (FF80 and 03F8 in the given
  2013.      example).
  2014.  
  2015.  
  2016.  
  2017.  
  2018.                                                                          41
  2019.  
  2020.                                       Index
  2021.  
  2022.      16450 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  2023.      16550 (Non A) . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  2024.      16550A  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  2025.      16550AF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  2026.      16550AFN  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  2027.      16550s Made by Western Digital  . . . . . . . . . . . . . . . . . . 34
  2028.      16650 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
  2029.      16750 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
  2030.      16C451  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
  2031.      16C551  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
  2032.      16C552  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
  2033.      16C554  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
  2034.      8250  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
  2035.      8250A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
  2036.      82510 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
  2037.      Additional Open . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2038.      Addresses and IRQ for COM3 through COM8 on the PS/2 . . . . . . . . 31
  2039.      Addresses and IRQs for COM1 and COM2  . . . . . . . . . . . . . . . 31
  2040.      Appendix A, Hardware Notes  . . . . . . . . . . . . . . . . . . . . 31
  2041.      Appendix B, SIO Chips . . . . . . . . . . . . . . . . . . . . . . . 32
  2042.      Appendix C, Multi-Port Serial I/0 Cards . . . . . . . . . . . . . . 37
  2043.      Appendix D, Advanced SIO Options  . . . . . . . . . . . . . . . . . 40
  2044.      BBS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2045.      Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2046.      ComBic  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
  2047.      CompuServe  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2048.      DCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6-8
  2049.      Defacto standard for COM3 and COM4  . . . . . . . . . . . . . . . . 31
  2050.      Development and Debugging Tools . . . . . . . . . . . . . . . . . .  4
  2051.      Device Control Block  . . . . . . . . . . . . . . . . . . . . . . .  8
  2052.      Differences between SIO/VSIO and COM/VCOM . . . . . . . . . . . . . 30
  2053.      Distribution  . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2054.      Driver Initialization . . . . . . . . . . . . . . . . . . . . . . .  6
  2055.      DTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2056.      DTR Control Mode  . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2057.      Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2058.      ESP in Compatibility Mode . . . . . . . . . . . . . . . . . . . . . 37
  2059.      Extended Set Bit Rate . . . . . . . . . . . . . . . . . . . . . . . 13
  2060.      FAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2061.      FIFO  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33, 34
  2062.      File System Requests  . . . . . . . . . . . . . . . . . . . . . . .  6
  2063.      First Level Open  . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2064.      Gtek BBS550 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
  2065.      Hold Transmit . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2066.      I/O Port Mapping to DOS Process . . . . . . . . . . . . . . . . . . 40
  2067.      Initial Open  . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2068.      Input Flush . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2069.      Input Status  . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  2070.      Intermediate Close  . . . . . . . . . . . . . . . . . . . . . . . .  8
  2071.      IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2072.      IRQ Reflection to DOS Process . . . . . . . . . . . . . . . . . . . 40
  2073.      Last Close  . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2074.      Locked Baud Rate  . . . . . . . . . . . . . . . . . . . . . . . . . 40
  2075.  
  2076.  
  2077.  
  2078.  
  2079.      42
  2080.  
  2081.      National Semiconductor Corporation  . . . . . . . . . . . . . . . . 32
  2082.      Neotech Quad Serial . . . . . . . . . . . . . . . . . . . . . . . . 38
  2083.      Open  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2084.      Ordering  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2085.      OS2BVEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2086.      Output Flush  . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2087.      Output Status . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2088.      PCMCIA  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
  2089.      PMLM.EXE  . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  4
  2090.      Protection  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
  2091.      Query Current Bit Rate  . . . . . . . . . . . . . . . . . . . . . . 21
  2092.      Query Current Modem Input Signals . . . . . . . . . . . . . . . . . 25
  2093.      Query Current Modem Output Control Signals  . . . . . . . . . . . . 25
  2094.      Query Extended Bit Rate . . . . . . . . . . . . . . . . . . . . 13, 22
  2095.      Query Line Characteristics  . . . . . . . . . . . . . . . . . . . . 21
  2096.      Query Number of Characters in Receive Buffer  . . . . . . . . . . . 26
  2097.      Query Number of Characters in Transmit Buffer . . . . . . . . . . . 26
  2098.      Query SIO Error . . . . . . . . . . . . . . . . . . . . . . . . . . 27
  2099.      Query SIO Event Information . . . . . . . . . . . . . . . . . . . . 28
  2100.      Query SIO Status  . . . . . . . . . . . . . . . . . . . . . . . . . 23
  2101.      Query Transmit Data Status  . . . . . . . . . . . . . . . . . . . . 24
  2102.      Read  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  2103.      Read Device Control Block (DCB) . . . . . . . . . . . . . . . . . . 29
  2104.      Read Enhanced Mode Parameters . . . . . . . . . . . . . . . . . . . 29
  2105.      RTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2106.      RTS Control Mode  . . . . . . . . . . . . . . . . . . . . . . . . .  8
  2107.      Set Bit Rate  . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  2108.      Set Break Off . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
  2109.      Set Break on  . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
  2110.      Set Line Characteristics  . . . . . . . . . . . . . . . . . . . . . 12
  2111.      Set Modem Control Signals . . . . . . . . . . . . . . . . . . . . . 15
  2112.      SIO Chips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
  2113.      SIO's Utility (SU.EXE)  . . . . . . . . . . . . . . . . . . . . . .  5
  2114.      Start Transmit  . . . . . . . . . . . . . . . . . . . . . . . . . . 16
  2115.      STB 4COM  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
  2116.      Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  2117.      Telcor Tport  . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
  2118.      Transmit Byte Immediate . . . . . . . . . . . . . . . . . . . . . . 14
  2119.      UART  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
  2120.      Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  3
  2121.      VIEWPMLM.EXE  . . . . . . . . . . . . . . . . . . . . . . . . . . .  5
  2122.      WHAT IS SIO . . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
  2123.      Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  2124.      Write Device Control Block (DCB)  . . . . . . . . . . . . . . . . . 17
  2125.      Write Extended Mode Parameters  . . . . . . . . . . . . . . . . . . 20
  2126.