home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1067 / README < prev    next >
Encoding:
Text File  |  1990-12-28  |  22.4 KB  |  544 lines

  1. README file for the FAS Final Async Solution driver
  2. ---------------------------------------------------
  3.  
  4. What is this package:
  5.  
  6.      This is an alternate async driver for 386 based unix systems that
  7.      adds several features that are not supported by vendors drivers.
  8.  
  9.         1.  It supports the NS16550 UART chips in full FIFO mode.
  10.         2.  It supports modem sharing for input and output.
  11.             Microport almost supported this feature but none
  12.             of the other vendors did.
  13.         3.  It supports hardware flow control.
  14.  
  15.  
  16.      This driver should work with most of the UNIX SYS V/386 3.X ports
  17.      currently available. You can have both this and the original
  18.      vendor driver in the same kernel. Each driver controls its own
  19.      separate set of serial ports. The only restriction here is that
  20.      any int vector must not be used by more than one of the drivers.
  21.      The kernel config program will complain otherwise.
  22.  
  23.      Note: This driver supports neither VP/ix nor DosMerge virtual
  24.            serial devices. If you need COM ports for your DOS programs
  25.            you have to connect the needed devices to ports that are
  26.            controlled by the original vendor async driver. You won't
  27.            have the special features of the FAS driver on these ports,
  28.            though. If you don't need to access serial ports from DOS
  29.            the vendor driver can be removed from the kernel.
  30.  
  31. ------------------------------------------------------------------------
  32.      
  33. A little about what it does:
  34.  
  35.      This driver supports shared line usage by having two logical
  36.      devices sharing one physical line.  To those familiar with
  37.      Microport this is very similar.  For the other readers a
  38.      brief description follows.  For each line there are two
  39.      names.  For example for the first line the names are ttyF00
  40.      (minor device 0) and ttyFM00 (minor device 192).  The ttyF00
  41.      is used for cu, kermit, and other programs that want to dial
  42.      out.  It ignores the modem signals and just goes to it.  The
  43.      ttyFM00 line is strictly for getty.  When getty calls open on
  44.      ttyFM00 the driver hangs the open until the modem asserts the
  45.      carrier detect signal and then lets the open complete.  If cu
  46.      opens ttyF00 while getty is waiting for the open to complete
  47.      the device is given to cu and the getty open must wait for cu
  48.      to finish and then will again wait for the carrier.  If cu
  49.      tries to open the ttyF00 line while getty has ttyFM00 open cu
  50.      will get an error.  If getty tries to open ttyFM00 while cu has
  51.      ttyF00 open the getty open will just hang and wait for cu to
  52.      close the line and then wait for the carrier.  To put it simply
  53.      you should put up a getty on ttyFM00 with a -t 60 and use ttyF00
  54.      for cu and uucico.
  55.  
  56.      The modem devices ttyFMxx is the minor device of ttyFxx plus
  57.      192.  There are several other possible minor devices for
  58.      each port.  See the description in `fas.c'.
  59.  
  60. ------------------------------------------------------------------------
  61.  
  62. A little about what it supports:
  63.  
  64.      The driver supports and has been tested on many async cards
  65.      and mux boards.  It supports most combinations of shared
  66.      interrupts.  The current driver supports NS16450, NS16550 and
  67.      um82450.  It is also reported to work on the 8250B.  I
  68.      suspect that it will not work on some of the earlier 8250 and
  69.      8250A parts, due to various bugs and speed problems in these
  70.      early parts.  Since these parts have no place in an 386 or other
  71.      high performance systems I did nothing to try to support them.
  72.      
  73.      Take a look at the various samples of space-xxxx for details
  74.      of how to set up for various devices.
  75.  
  76.  
  77.      A WORD ABOUT CHARACTER LOSSES
  78.      -----------------------------
  79.  
  80.      If you experienced character losses with your vendor async
  81.      driver at high baud rates you shouldn't blame the vendor for
  82.      that. The real reason for this problem lies in the ancient port
  83.      devices used in most 386 systems: The 8250 and the NS16450.
  84.  
  85.      They have only one receiver character buffer. This implies that
  86.      the operating system must read a character from this buffer before
  87.      the next one arrives from the port's shift register. For the old
  88.      IBM PC with DOS this was sufficient. But for UNIX and with baud
  89.      rates up to 38400 this is simply a joke.
  90.  
  91.      UNIX is not a real-time operating system. That means that it's
  92.      kernel isn't optimized for fast interrupt responses. With the
  93.      proper hardware this is no problem. But because the vendors have
  94.      to adapt UNIX to the standard hardware found in 386 systems they
  95.      also have to cope with the NS16450 ports which are in there simply
  96.      to be compatible with IBM PCs, XTs and ATs.
  97.  
  98.      It is impossible to make it work at high baud rates without a
  99.      major redesign of the AT&T supplied UNIX kernel. But then it
  100.      wouldn't be UNIX SYSV any more.
  101.  
  102.      Luckily, there is a pin-to-pin replacement available from
  103.      National Semiconductors: The NS16550A.
  104.  
  105.      This device has separate 16 character FIFOs for the receiver and
  106.      the transmitter. With these FIFOs the interrupt latency of the
  107.      kernel can be quiet high without losing any characters.
  108.      Additionally, because with most interrupts many characters are
  109.      processed at once the system is loaded much less.
  110.  
  111.      As you see, the necessary hardware is available. Therefor, if you
  112.      have to blame the UNIX vendor then blame him for not telling you
  113.      that you should buy some NS16550A and/or for not supplying you
  114.      with a serial driver that supports these port devices.
  115.  
  116.      But as you have the FAS driver now and if you use the NS16550A
  117.      devices you shouldn't have this kind of trouble any more. This is
  118.      the philosophy behind the driver's name `Final Async Solution'.
  119.  
  120.      Enjoy!
  121.  
  122. ------------------------------------------------------------------------
  123.  
  124. Whats in this package:
  125.  
  126.      README         This file.
  127.  
  128.      INSTALLATION   A description about how to install the driver
  129.                     on your system.
  130.  
  131.      PATCHLEVEL     Just a reference file for future updates.
  132.                     
  133.      fas.h          The header file for the driver.
  134.  
  135.      fas.c          The driver itself.
  136.  
  137.      space-xxxxx    These are samples of what `space.c' must look
  138.                     like.  You can either copy one of these to
  139.                     `space.c' or use it as a template to create your
  140.                     own `space.c'.
  141.  
  142.           space-c1-2     For com1 and com2.
  143.  
  144.           space-c1-3     For com1, com2 and com3.
  145.  
  146.           space-mux4     For the MU-440 four line mux board.
  147.  
  148.      config-xxxxx   This is for uPort SYS V/386 only.
  149.                     Kernel configuaration file.  You should pick the one
  150.                     that matches your configuration and copy it to `config'.
  151.  
  152.           config-c1-2    For com1 and com2.
  153.  
  154.           config-c1-3    For com1, com2 and com3.
  155.  
  156.           config-mux4    For the MU-440 four line mux board.
  157.  
  158.      s_fas-xxxxx    This is for ISC 386/ix only.
  159.                     Kernel configuration file.  You should pick the one
  160.                     that matches your configuration and copy it to `s_fas'.
  161.  
  162.           s_fas-c1-2     For com1 and com2.
  163.  
  164.           s_fas-c1-3     For com1, com2 and com3.
  165.  
  166.           s_fas-mux4     For the MU-440 four line mux board.
  167.  
  168.      n_fas-xxxxx    This is for ISC 386/ix only.
  169.                     Tty device nodes file.  You should pick the one
  170.                     that matches your configuration and copy it to `n_fas'.
  171.  
  172.           n_fas-c1-2     For com1 and com2.
  173.  
  174.           n_fas-c1-3     For com1, com2 and com3.
  175.  
  176.           n_fas-mux4     For the MU-440 four line mux board.
  177.  
  178.      i_fas-xxxxx    This is for ISC 386/ix only.
  179.                     Inittab getty lines file.  You should pick the one
  180.                     that matches your configuration and copy it to `i_fas'.
  181.  
  182.           i_fas-c1-2     For com1 and com2.
  183.  
  184.           i_fas-c1-3     For com1, com2 and com3.
  185.  
  186.           i_fas-mux4     For the MU-440 four line mux board.
  187.  
  188.      makefile.uPort A makefile for uPort SYS V/386 systems. This is generic
  189.                     and should work for all configurations of lines
  190.                     and interrupts.
  191.  
  192.      makefile.ISC   A makefile for ISC 386/ix systems.  This is generic
  193.                     and should work for all configurations of lines
  194.                     and interrupts.
  195.  
  196. ------------------------------------------------------------------------
  197.  
  198. What you will need to use this package:
  199.  
  200.      You will need a one of the above mentioned systems with the
  201.      link kit and the software development package.
  202.  
  203. ------------------------------------------------------------------------
  204.  
  205.  
  206. Release History:
  207.  
  208.      release 1.1a Sat Nov 11, 1989
  209.  
  210.      This is an unofficial release as I'm not the original author
  211.      of this async driver.
  212.  
  213.      Uwe Doering        gemini@geminix.mbx.sub.org
  214.      Billstedter Pfad 17 B
  215.      1000 Berlin 20
  216.      West Germany
  217.  
  218.      New Features:
  219.  
  220.           Added a third minor tty device number for every physical
  221.           port. See description preceding the asyopen function in
  222.           asy.c. Changed the behavior of ttyxx, too.
  223.  
  224.           Added output hardware handshake support for DSR. Now you
  225.           can do handshake with CTS, DSR or both. Input hardware
  226.           handshake is on if you use at least one of the output
  227.           handshake signals.
  228.  
  229.           More flexible support of additional interrupt registers
  230.           on mux boards. This is fully configurable now.
  231.  
  232.           Added support for the CREAD flag. If not set, receiver
  233.           interrupts are still serviced, but the received characters
  234.           are simply thrown away. This is not as elegant as disabeling
  235.           the interrupts themselves, but with the already existing
  236.           driver it was the easiest way, and the most new-bugs-preventing,
  237.           too.
  238.  
  239.           Added a lot of comments to the source so that the curious
  240.           user can understand why and how things are done.
  241.  
  242.  
  243.      Bug Fixes:
  244.  
  245.           The hang-up-on-last-close flag (HUPCL) was ignored. DTR
  246.           was asserted regardless of this flag.
  247.  
  248.           Made the detection of CTS and DCD more bullet-proof.
  249.           Especially because between a close and the next open of
  250.           a line, where interrupts are ignored, the software copys of
  251.           CTS and DCD must be set up propperly in the asyopen function
  252.           or the tty line would be blocked under certain circum-
  253.           stances. For similar reasons, there is also a setup in the
  254.           asyparam function.
  255.  
  256.           Rewrote the input character processing function to work
  257.           according to the TERMIO(7) man page.
  258.  
  259.           Changed the behavior of BREAK generation to let the
  260.           transmitter drain before TX is set to low.
  261.  
  262.           Changed line hangup procedure so that the closing
  263.           process returns immediately and doesn't sleep during
  264.           the hangup delay/time. Instead, if an other process tries
  265.           to open the line while hangup is still in progress, this
  266.           process will sleep until hangup is competed.
  267.  
  268.           With DOS Merge, on MicroPort V/386 3.0e the linker was
  269.           missing the function `init8250'. Reengineered this from
  270.           a disassembler listing of MicroPort's original driver and
  271.           modified it to work with the NS16550 16-bit FIFO. This
  272.           funktion was added simply to be able to link the kernel.
  273.           DOS Merge's virtual COM ports are still unusable with this
  274.           release, though. To include this function, add a `-DMERGE'
  275.           to the CFLAGS line in your makefile.
  276.  
  277.           Made a lot of other corrections and enhancements in both
  278.           speed and functionallity. As a result of all my effords
  279.           I think this driver is slightly faster, more versatile
  280.           and much more stable than the original release.
  281.  
  282.      ------------------------------------------------------------
  283.           
  284.      release 1.1b Sat Nov 25, 1989
  285.  
  286.      New Features:
  287.  
  288.           Changed the minor device number scheme again.
  289.           There are now two main groups: The unblocked open
  290.           and the blocked open. Every group has four sub-modes
  291.           and an additional hardware handshake flag. All this
  292.           is coded in the higher four bits of the minor device
  293.           number. Because of this, the maximum of 32 ports was
  294.           reduced to 16 ports so that the port number fits into
  295.           the remaining lower four bits of the minor device number.
  296.           32 dumb ports in a single machine would have been overkill
  297.           anyway. For more details refer to the comment above the
  298.           `asyopen' function in the file `asy.c'.
  299.  
  300.      ------------------------------------------------------------
  301.           
  302.      release 2.00 Mon Nov 27, 1989
  303.  
  304.      As this release differs so much from the original version I got,
  305.      I now declare this as independant from the original author
  306.      Jim Murray. This allows me to introduce new release levels
  307.      without wondering whether they will collide with Jim's releases.
  308.      Of course many credits to Jim for writing this software in the
  309.      first place. Without his driver as a base I never would have
  310.      been able to do such kernel driver development.
  311.  
  312.      Bug Fixes:
  313.  
  314.           If there were glitches on the hardware handshake lines
  315.           and the DCD line a getty on this port would sometimes
  316.           hang and become an immortal process. I think this was
  317.           because the output buffer wasn't flushed properly
  318.           on carrier loss. I hope I fixed this now. We'll see.
  319.  
  320.      ------------------------------------------------------------
  321.           
  322.      release 2.01 Tue Nov 28, 1989
  323.  
  324.      Did some cleanup in the source code.
  325.  
  326.      I splitted the driver into two parts: The driver itself and
  327.      the file `space.c'.
  328.      `space.c' contains all data structures necessary to configure
  329.      the driver and is compiled at kernel link time. Therefore if you
  330.      change your serial card configuration you simply change `space.c'
  331.      directly in the link kit directory and relink the kernel. No
  332.      driver recompilation or installation is necessary for this.
  333.      But note that whenever you use `make install' your setup in
  334.      the link kit directory is overwritten by the original `space.c'
  335.      file. Therefore you should copy your new `space.c' back to
  336.      the source directory when you are finished with the configuration.
  337.  
  338.      Renamed the package to `FAS Final Async Solution'. The following
  339.      files have been renamed:
  340.           asy.c          -> fas.c
  341.           asy.h          -> fas.h
  342.           asy_conf-xxxxx -> space-xxxxx
  343.  
  344.      ISC 386/ix is supported now. There are separate makefiles
  345.      for uPort and ISC to cope with the differences in link kit
  346.      installation.
  347.  
  348.      Bug Fixes:
  349.  
  350.           `getty' still hung sometimes on a line with hardware
  351.           handshake. Tried to fix it this time.
  352.  
  353.      ------------------------------------------------------------
  354.           
  355.      release 2.02 Thu Nov 30, 1989
  356.  
  357.      Abandoned the distinction between space-xxxxx files with
  358.      and without hardware flow control because this is selected
  359.      by the minor device number now.
  360.  
  361.      Bug Fixes:
  362.  
  363.           Set the high and low water marks for hardware input flow
  364.           control to higher values than software flow control. This
  365.           gives precedence to software flow control if both methods
  366.           are used. These marks are self-adjusting and don't need to
  367.           be changed if some flavor of UNIX has a different buffer
  368.           size than the standard 256 characters. Before this change
  369.           concurrent use of both flow controls could cause trouble
  370.           with some high-speed modems. This is fixed now.
  371.  
  372.           A flush read or write buffer request now also clears the
  373.           receiver or transmitter FIFO, respectively. An ioctl
  374.           call with a TCSETA* command clears the FIFOs, too.
  375.  
  376.      ------------------------------------------------------------
  377.           
  378.      release 2.03 Fri Dec 01, 1989
  379.  
  380.      Wrote an installation guide. The driver should be quite
  381.      easy to install now.
  382.  
  383.      Added tty node configuration files for ISC.
  384.  
  385.      Hardware input flow control is bound now to the level of the
  386.      receiver ring buffer instead of the UNIX input buffer. This
  387.      has the advantage that buffer size and trigger levels are
  388.      defined in the driver and therefore can be varied as needed.
  389.  
  390.      New Features:
  391.  
  392.           Added a boot time status message that shows the init
  393.           state of each port. This tells you immediately what
  394.           ports are found and initted by the driver. Useful to
  395.           determine hardware configuration problems. Refer to
  396.           file fas.c (function `asyinit') for a description.
  397.           Thanks to Kritt Gierlewsen for this proposal.
  398.  
  399.      ------------------------------------------------------------
  400.           
  401.      release 2.04 Thu Dec 07, 1989
  402.  
  403.      Did some cleanup in the source.
  404.  
  405.      Removed the FIFO clear from the ioctl function. We don't want
  406.      to do things there that aren't in the book.
  407.  
  408.      An ioctl call that switches off the CLOCAL flag will create
  409.      a SIGHUP signal if the carrier is actually missing at this
  410.      time.
  411.  
  412.      Every device is tested now quite thoroughly during initialization.
  413.      If the test fails the corresponding device keeps unconfigured.
  414.  
  415.      ------------------------------------------------------------
  416.           
  417.      release 2.05 Sat Jan 13, 1990
  418.  
  419.      This is the first public release of the FAS driver.
  420.  
  421.      Special thanks to the sysops of my test sites, Axel Fischer and
  422.      Kritt Gierlewsen.
  423.  
  424.      FAS is now an independant driver with its own driver name (`fas'),
  425.      major device number, link kit directory and other things necessary
  426.      for a driver. The original asy driver may or may not be linked
  427.      with the kernel. You only need it if you want to access some
  428.      serial devices via the virtual COM ports of the DOS emulator
  429.      (DosMerge or VP/ix) because the FAS driver doesn't have this
  430.      (really vendor dependant) feature.
  431.  
  432.      The default prefix for tty device node names is `ttyF' now.
  433.      This prevents mix-ups with the device names of the original
  434.      asy driver.
  435.  
  436.      Dropped the SYSV/AT support. I couldn't test the driver
  437.      for several release generations on uPort SYSV/AT, and because
  438.      there are not very much systems left with that flavor of UNIX
  439.      it doesn't make sense to try to maintain compatibility with it.
  440.      If someone really wants to use this driver on a 286 he has
  441.      to port it himself.
  442.  
  443.      Improved the transmitter FIFO fill procedure. Now it will try
  444.      harder to fill the FIFO as much as possible to cut down on
  445.      transmitter interrupts.
  446.  
  447.      Software input flow control (XON/XOFF) is controlled by the driver now.
  448.      It is bound to the level of the receiver ring buffer (as is hardware
  449.      flow control). As usual, it can be switched on and off by the
  450.      IXOFF flag in the termio structure.
  451.  
  452.      Changed and speeded up the ring buffer -> unix buffer processing.
  453.  
  454.      For ISC, the getty lines for the inittab file are installed
  455.      by the makefile now.
  456.  
  457.      The conditional compilation of the function `init8250' (for
  458.      DosMerge) is now controlled by a define in `fas.h'. The compiler
  459.      switch `-DMERGE' is not used any more.
  460.  
  461.      Improved the documentation.
  462.  
  463.      The signals used for modem control and hardware flow control are
  464.      fully configurable in the space.c file now. Look at fas.h for
  465.      possible macros and combinations.
  466.  
  467.      There are some new modes for hardware flow control, for instance
  468.      HO_CTS_ON_DSR. This means that CTS is only looked at if DSR is on.
  469.      If DSR is off output is possible regardless of CTS. The underlying
  470.      assumption here is that we can expect proper handshake handling
  471.      only from devices that are in the ready state (indicated by DSR).
  472.      As a spin-off the problem with the hanging getty on lines with
  473.      turned-off terminals (mentioned in earlier releases) should be
  474.      gone if you use this new mode.
  475.  
  476.      If the XCLUDE-Flag is availabe (SYSV 3.2 because of Xenix
  477.      compatibility) exclusive open of a device is possible.
  478.  
  479.      The default size of the input ring buffer is now 5000 bytes.
  480.      This makes streaming input more likely even on loaded systems.
  481.  
  482.      Bug Fixes:
  483.  
  484.           The task state busy flag wasn't reset in some rare cases.
  485.           This could cause processes to become immortal while waiting
  486.           for the busy flag.
  487.  
  488.           Under some special conditions an ioctl call with a TCSETA?
  489.           command could corrupt the last character in the transmitter
  490.           shift register. This is fixed now.
  491.  
  492.           More fixing of the busy flag handling was necessary.
  493.           Co-ordinating several delayed tasks controlling this flag
  494.           is kind of tricky.
  495.  
  496.           After a TCSETA* ioctl command we disable the transmitter
  497.           for 2 sec (measured from the last transmitted character)
  498.           if the character format and/or speed has changed. This
  499.           gives the receiving side some time to do the same changes.
  500.           This is kind of experimental. There may be applications that
  501.           suffer from this delay. You may change the #define ADAPT_TIME
  502.           in fas.h to a smaller value.
  503.  
  504.      ------------------------------------------------------------
  505.           
  506.      release 2.06 Fri Mar 16, 1990
  507.  
  508.      This should have been patch #3 for release 2.05, but there are
  509.      so many changes now that I decided to make it a new release.
  510.      Therefor some of the changes are described in the 2.05 release
  511.      notes above but were never released to the public.
  512.  
  513.      New Features:
  514.  
  515.           There is a transmitter ring buffer now to make the output
  516.           less system load dependent. This really speeds things up
  517.           because the transmitter FIFO gets filled with more characters
  518.           at once. The buffer size depends on the actual baud rate to
  519.           prevent long output buffer drains at low speeds.
  520.  
  521.           There are also bigger input buffers to make FAS more competitive
  522.           against "intelligent" cards.
  523.  
  524.           Lots of speed improvements and many small changes.
  525.  
  526.      Bug Fixes:
  527.  
  528.           Fixed input/output buffer flush on carrier loss while close
  529.           is waiting for the output to drain.
  530.  
  531. ---------------------------------------------------------------------
  532.  
  533. Originally written by
  534. Jim Murray              encore!cloud9!jjmhome!jjm
  535. 2 Mohawk Circle         harvard!m2c!jjmhome!jjm
  536. Westboro Mass 01581     jjm%jjmhome@m2c.m2c.org
  537. USA                     voice (508) 366-2813
  538.  
  539. Current author:
  540. Uwe Doering        gemini@geminix.mbx.sub.org
  541. Billstedter Pfad 17 B
  542. 1000 Berlin 20
  543. West Germany
  544.