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