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

  1. README file for the FAS Final Async Solution driver
  2. ---------------------------------------------------
  3.  
  4. What is this package:
  5.  
  6.      This is an async driver for 386 based unix systems that adds
  7.      several features that are not supported by vendors drivers.
  8.      It supports
  9.  
  10.         1.  the NS16550A and i82510 UART chips in full FIFO mode.
  11.         2.  modem sharing for input and output.
  12.         3.  shared interrupts.
  13.         4.  hardware flow control.
  14.         5.  VP/ix, the ISC DOS emulator.
  15.  
  16.  
  17.      FAS was successfully tested under the following operating systems:
  18.  
  19.      Microport UNIX SYSV 3.0
  20.      ISC 386/ix 2.0.2 & 2.2
  21.      ESIX Rev. C & D
  22.      SCO UNIX 386
  23.      SCO XENIX 386 2.3.2
  24.  
  25.      This driver should work with most of the UNIX SYS V/386 3.X ports
  26.      currently available. You can have both this and the original
  27.      vendor driver in the same kernel (if you really like to, but I
  28.      wouldn't know why). Each driver controls its own separate set of
  29.      serial ports. The only restriction here is that any int vector must
  30.      not be used by more than one of the drivers. The kernel config
  31.      program will complain otherwise.
  32.  
  33. ------------------------------------------------------------------------
  34.      
  35. How it works:
  36.  
  37.      DIALIN/DIALOUT ON THE SAME PORT
  38.      -------------------------------
  39.  
  40.      This driver supports shared line usage by having two logical
  41.      devices sharing one physical line. Each logical device has its
  42.      own name. For example for the first line the names are ttyF00
  43.      (minor device 0) and ttyFM00 (minor device 192). The ttyF00
  44.      is used for cu, kermit, and other programs that want to dial
  45.      out. It ignores the modem signals and just goes to it. The
  46.      ttyFM00 line is strictly for getty. When getty calls open on
  47.      ttyFM00 the driver hangs the open until the modem asserts the
  48.      carrier detect signal and then lets the open complete. If cu
  49.      opens ttyF00 while getty is waiting for the open to complete
  50.      the device is given to cu and the getty open must wait for cu
  51.      to finish and then will again wait for the carrier. If cu
  52.      tries to open the ttyF00 line while getty has ttyFM00 open cu
  53.      will get an error. If getty tries to open ttyFM00 while cu has
  54.      ttyF00 open the getty open will just hang and wait for cu to
  55.      close the line and then wait for the carrier. To put it simply
  56.      you should put up a getty on ttyFM00 with a -t 60 and use ttyF00
  57.      for cu and uucico.
  58.  
  59.      In the example above ttyF00 had a minor device number of 0 and
  60.      ttyFM00 one of 192. But there are several other possible minor
  61.      device numbers for each port.
  62.  
  63.      The higher bits of the minor device number control the operating
  64.      mode of the device. The port can't be opened by two or more
  65.      different minor devices at the same time.
  66.  
  67.      - Minor devices that *don't* block on open if no carrier is present:
  68.  
  69.         Bitmap:   0 m m h x x x x
  70.  
  71.            `m m' are the mode bits as follows:
  72.  
  73.             0 0   The carrier signal is totally ignored. With carrier high->low
  74.                   *no* SIGHUP signal is generated.
  75.             0 1   After an initial open, the carrier signal is ignored.
  76.                   Although, carrier high->low generates a SIGHUP signal. From
  77.                   thereon the device is carrier controlled until the last
  78.                   process has closed the device. An ioctl call with a TCSETA*
  79.                   command resets the device to ignore carrier again until the
  80.                   next carrier high->low.
  81.             1 0   The device is carrier controlled. Additionally, if on open
  82.                   the carrier signal is low, a SIGHUP signal is sent
  83.                   immediately.
  84.             1 1   The device behaves the same as with mode `0 1'. Additionally,
  85.                   if on open the carrier signal is low, a SIGHUP signal is sent
  86.                   immediately.
  87.  
  88.      - Minor devices that *do* block on open if no carrier is present:
  89.  
  90.         Bitmap:   1 m m h x x x x
  91.  
  92.            `m m' are the mode bits as follows:
  93.  
  94.             0 0   The device is carrier controlled.
  95.             0 1   The device is carrier controlled. An unblock signal wakes
  96.                   up the waiting open and I/O is possible regardless of
  97.                   carrier until a carrier high->low. Thereafter the device
  98.                   is again fully carrier controlled.
  99.             1 0   Same as mode `0 0', but a parallel non-blocking open
  100.                   is possible while waiting for carrier.
  101.             1 1   Same as mode `0 1', but a parallel non-blocking open
  102.                   is possible while waiting for carrier.
  103.  
  104.      - Description of the remaining bits of the bitmap:
  105.  
  106.            `h'    If set to `1', the device has hardware handshake. Refer
  107.                   to the `space.c' file to determine which port signals
  108.                   are actually used for that purpose. If set to `0'
  109.                   hardware handshake is depending on the termio(7) CTSFLOW
  110.                   and RTSFLOW flags (if they are available).
  111.            `x x x x'
  112.                   This is the physical port number. This driver supports
  113.                   up to 16 ports. If you need more, you should use an
  114.                   intelligent serial card because more than 16 devices
  115.                   will eat up to much CPU time with this dumb-port approach.
  116.  
  117.      - Note: If a device is carrier controlled, this implies the generation
  118.              of a SIGHUP signal with every carrier high->low. This is of
  119.              course only true if the CLOCAL flag is *not* set.
  120.  
  121.              On my own system I prefer a minor device number of `0011xxxx'
  122.              (48 + device #) for the non-blocking tty node and `1101xxxx'
  123.              (208 + device #) for the blocking tty node. This gives me
  124.              the SIGHUP signal on carrier loss and hardware flow control
  125.              with both logical devices. Dialout while a dialin open
  126.              is waiting for the carrier is also possible with this setup.
  127.  
  128.  
  129.      WHICH SERIAL CARDS ARE SUPPORTED ?
  130.      ----------------------------------
  131.  
  132.      The driver supports and has been tested on many async cards
  133.      and mux boards. It supports most combinations of shared
  134.      interrupts. The current driver supports NS16450, NS16550A,
  135.      um82450 and i82510. 8250 chips are not supported due to various
  136.      bugs and speed problems in these parts. They have no place in any
  137.      386 or other high performance system. Replace them with one of the
  138.      supported chips. They are pin-to-pin compatible.
  139.      
  140.      Take a look at the various samples of space-xxxx for details
  141.      of how to set up for various devices.
  142.  
  143.      At boot time you will see a status message on the screen with
  144.      symbols that show the init state of each port. The symbols
  145.      are as follows:
  146.  
  147.         -     not defined in the fas_port array
  148.         ?     can't initialize port
  149.         1-6   error during test phase indicated by number
  150.         *     port is initialized
  151.         f     port is initialized and has FIFOs (i82510)
  152.         F     port is initialized and has FIFOs (NS16550)
  153.  
  154.      This is convenient to check whether you have entered the proper port
  155.      base addresses in `space.c'.
  156.  
  157.  
  158.      WHICH CARD WILL SUPPORT SHARED INTERRUPTS ?
  159.      -------------------------------------------
  160.  
  161.      Many multi-port cards have jumpers or dip switches that let you
  162.      assign more than one port to the same interrupt (IRQ) line. This alone
  163.      is _no_ guaranty that they really support shared interrupts! These
  164.      cards may be designed for the DOS world where you may want two or more
  165.      serial ports but don't need to run them concurrently, that is, no more
  166.      than one of those ports assigned to the same IRQ line is allowed to be
  167.      in use at a time. For DOS this is sufficient as DOS is no multitasking
  168.      operating system. For UNIX this won't work because in the worst case
  169.      all serial ports may be in use at the same time.
  170.  
  171.      The basic problem is that the PC (and AT) I/O bus can't handle shared
  172.      interrupts itself. This is due to a brain-dead hardware design. Therefor
  173.      there must be some special logic on the serial card to provide shared
  174.      interrupts. And those cards are quite rare (and usually more expensive).
  175.  
  176.      Therefor, you have the choice to give every port on the card its own
  177.      IRQ line or to buy a multi-port card that really has shared interrupts.
  178.      But in the latter case you better ask your vendor twice to make shure
  179.      that it has this functionality because from the card's manuals it often
  180.      isn't obvious which type of card it is. One well-known shared interrupts
  181.      card is the AST 4-port card. There are many compatible clones available
  182.      that are usually much cheaper than the original. You can even buy
  183.      AST compatible 8-port cards where two AST 4-port blocks are on the
  184.      same board.
  185.  
  186.  
  187.      A WORD ABOUT CHARACTER LOSSES
  188.      -----------------------------
  189.  
  190.      If you've experienced character losses with your vendor async
  191.      driver at high baud rates you shouldn't blame the vendor for
  192.      that. The real reason for this problem lies in the ancient port
  193.      devices used in most 386 systems: The 8250 (not supported by
  194.      FAS) and the NS16450.
  195.  
  196.      They have only one receiver character buffer. This implies that
  197.      the operating system must read a character from this buffer before
  198.      the next one arrives from the port's shift register. For the old
  199.      IBM PC with DOS this was sufficient. But for UNIX and with baud
  200.      rates up to 38400 this is simply a joke.
  201.  
  202.      UNIX is not a real-time operating system. That means that it's
  203.      kernel isn't optimized for fast interrupt responses. With the
  204.      proper hardware this is no problem. But because the vendors have
  205.      to adapt UNIX to the standard hardware found in 386 systems they
  206.      also have to cope with the NS16450 ports which are in there simply
  207.      to be compatible with IBM PCs, XTs and ATs.
  208.  
  209.      It is impossible to make it work at high baud rates without a
  210.      major redesign of the AT&T supplied UNIX kernel. But then it
  211.      wouldn't be UNIX SYSV any more.
  212.  
  213.      Luckily, there is a pin-to-pin replacement available from
  214.      National Semiconductors: The NS16550A.
  215.  
  216.      This device has separate 16 character FIFOs for the receiver and
  217.      the transmitter. With these FIFOs the interrupt latency of the
  218.      kernel can be quiet high without losing any characters.
  219.      Additionally, because with most interrupts many characters are
  220.      processed at once the system is loaded much less.
  221.  
  222.      As you see, the necessary hardware is available. Therefor, if you
  223.      have to blame the UNIX vendor then blame him for not telling you
  224.      that you should buy some NS16550A and/or for not supplying you
  225.      with a serial driver that supports these port devices.
  226.  
  227.      But as you have the FAS driver now and if you use the NS16550A
  228.      devices you shouldn't have this kind of trouble any more. This is
  229.      the philosophy behind the driver's name `Final Async Solution'.
  230.  
  231.      Enjoy!
  232.  
  233.      PS: If for some reason you can't get the NS16550A chips you
  234.          could use the i82510 chips from Intel. Although they are
  235.          much less efficient they are still better than the NS16450.
  236.  
  237.  
  238.      HARDWARE FLOW CONTROL
  239.      ---------------------
  240.  
  241.      FAS will support hardware flow control, also known as RTS/CTS
  242.      full duplex flow control, by default. This is a method to control
  243.      character flow in both input and output directions. You can
  244.      enable hardware flow control via the minor device number of the
  245.      port or with the termio(7) RTSFLOW/CTSFLOW flags (if your UNIX has
  246.      them). The RS232C RTS line controls the input direction and the
  247.      CTS line is responsible for the output direction.
  248.  
  249.      As long as the FAS input buffer hasn't reached a certain
  250.      threshold the RTS line is set high to signal the connected
  251.      device that it may send characters. If the input buffer level
  252.      rises beyond this threshold RTS will go low and the device
  253.      is supposed to stop sending characters. As soon as there is
  254.      sufficient space in the input buffer RTS will go high again
  255.      and the character flow may continue.
  256.  
  257.      The CTS line works the other way round. If the connected device
  258.      sets CTS to high the FAS character output is enabled. If CTS is
  259.      low, the output is stopped. There is a special feature for the
  260.      CTS part of the handshake. CTS is only looked at if the DSR
  261.      line is high. If DSR is low or not connected hardware output
  262.      handshake is disabled, that is, FAS sends characters
  263.      regardless of the state of CTS.
  264.  
  265.      This has two advantages. At first, if you switch off a serial
  266.      device connected to an FAS port with hardware flow control
  267.      CTS will go low and therefor the output gets blocked. If at this
  268.      time there are still characters in the output buffer the
  269.      last process closing this port can't terminate until the
  270.      buffer has drained. You can't even kill the process in this
  271.      state. It will become one of those infamous immortal processes.
  272.      But as DSR will also go low if you switch off the device
  273.      this blocking of the output will be prevented. In short:
  274.      Hardware output handshake is only used if the connected
  275.      device sets DSR high, that is, the device is switched on
  276.      and is ready. So make sure that you keep this in mind when
  277.      you make serial cables and when you configure your serial
  278.      devices. DSR must be on if you want CTS handshake.
  279.  
  280.      The other advantage of this CTS/DSR mechanismn is that you
  281.      can still connect dumb serial devices to an FAS hardware
  282.      handshake port using a minimal 3-wire cable. As an unconnected
  283.      DSR line is automatically low hardware output handshake is
  284.      disabled, which is just what you wanted in this case.
  285.  
  286.  
  287.      VP/ix SUPPORT
  288.      -------------
  289.  
  290.      FAS allows DOS programs running under VP/ix to access serial
  291.      ports. You simply need to modify your personal VP/ix configuration
  292.      file (`vpix.cnf') to tell the DOS emulator which FAS devices to
  293.      use for COM1 (or COM1MOUSE) and COM2. Note that VP/ix opens
  294.      these devices at startup time, so you better make sure that
  295.      the desired devices aren't used by other processes when you
  296.      start VP/ix as VP/ix wants to use them exclusively.
  297.  
  298.      There are some special features with the handling of the RTS and
  299.      DTR lines you should know about. If your DOS program asserts
  300.      the DTR line this will actually cause action on the modem
  301.      enable line you configured in `space.c'. Likewise, RTS asserts
  302.      the input hardware handshake line configured in `space.c'.
  303.  
  304.      If the used FAS device has hardware handshake enabled, asserting
  305.      RTS from DOS actually stops the character flow from FAS to VP/ix.
  306.      This prevents input buffers of interrupt driven DOS programs
  307.      from overflowing. FAS, on the other hand, uses its hardware
  308.      handshake to prevent an overflow of its own input buffer. Therefor
  309.      you can use DOS telecommunication programs even at high baud rates
  310.      without losing characters, provided your DOS programs are
  311.      configured to use RTS/CTS flow control.
  312.  
  313.      All this virtual handling has the advantage that the DOS program
  314.      doesn't need to know certain details about your actual port setup.
  315.      Reading the modem status register, on the other hand, doesn't cause
  316.      any translation of the register value.
  317.  
  318.      To enable VP/ix support, you have to uncomment the `HAVE_VPIX'
  319.      define in `fas.h'.
  320.  
  321. ------------------------------------------------------------------------
  322.  
  323. What's in this package:
  324.  
  325.      README         This file.
  326.  
  327.      INSTALLATION   A description about how to install the driver
  328.                     on your system.
  329.  
  330.      PATCHLEVEL     Just a reference file for future updates.
  331.  
  332.      RELEASENOTES   Notes about the present FAS releases.
  333.                     
  334.      fas.h          The header file for the driver.
  335.  
  336.      fas.c          The driver itself.
  337.  
  338.      space-xxxxx    These are samples of what `space.c' must look
  339.                     like.  You can either copy one of these to
  340.                     `space.c' or use it as a template to create your
  341.                     own `space.c'.
  342.  
  343.           space-c1-2     For com1 and com2.
  344.  
  345.           space-c1-3     For com1, com2 and com3.
  346.  
  347.           space-ast4     For the AST 4-port card.
  348.  
  349.      config-xxxxx   This is for uPort SYS V/386 only.
  350.                     Kernel configuaration file.  You should pick the one
  351.                     that matches your configuration and copy it to `config'.
  352.  
  353.           config-c1-2    For com1 and com2.
  354.  
  355.           config-c1-3    For com1, com2 and com3.
  356.  
  357.           config-ast4    For the AST 4-port card.
  358.  
  359.      s_fas-xxxxx    This is for ISC 386/ix, ESIX and SCO UNIX 386.
  360.                     Kernel configuration file.  You should pick the one
  361.                     that matches your configuration and copy it to `s_fas'.
  362.  
  363.           s_fas-c1-2     For com1 and com2.
  364.  
  365.           s_fas-c1-3     For com1, com2 and com3.
  366.  
  367.           s_fas-ast4     For the AST 4-port card.
  368.  
  369.      n_fas-xxxxx    This is for ISC 386/ix, ESIX and SCO UNIX 386.
  370.                     Tty device nodes file.  You should pick the one
  371.                     that matches your configuration and copy it to `n_fas'.
  372.  
  373.           n_fas-c1-2     For com1 and com2.
  374.  
  375.           n_fas-c1-3     For com1, com2 and com3.
  376.  
  377.           n_fas-ast4     For the AST 4-port card.
  378.  
  379.      i_fas-xxxxx    This is for ISC 386/ix, ESIX and SCO UNIX 386.
  380.                     Inittab getty lines file.  You should pick the one
  381.                     that matches your configuration and copy it to `i_fas'.
  382.  
  383.           i_fas-c1-2     For com1 and com2.
  384.  
  385.           i_fas-c1-3     For com1, com2 and com3.
  386.  
  387.           i_fas-ast4     For the AST 4-port card.
  388.  
  389.      makefile.uPort A makefile for uPort SYS V/386 systems. This is generic
  390.                     and should work for all configurations of lines
  391.                     and interrupts.
  392.  
  393.      makefile.ISC   A makefile for ISC 386/ix systems.  This is generic
  394.                     and should work for all configurations of lines
  395.                     and interrupts.
  396.  
  397.      makefile.ESIX  A makefile for ESIX systems.  This is generic
  398.                     and should work for all configurations of lines
  399.                     and interrupts.
  400.  
  401.      makefile.SCO   A makefile for SCO UNIX 386 systems.  This is generic
  402.                     and should work for all configurations of lines
  403.                     and interrupts.
  404.  
  405.      makefile.XENIX A makefile for SCO Xenix 386 systems.  This is generic
  406.                     and should work for all configurations of lines
  407.                     and interrupts.
  408.  
  409. ------------------------------------------------------------------------
  410.  
  411. What you will need to use this package:
  412.  
  413.      You will need one of the above mentioned UNIX systems with the
  414.      kernel link kit and the software development package.
  415.  
  416. ------------------------------------------------------------------------
  417.  
  418. Originally written by
  419. Jim Murray              encore!cloud9!jjmhome!jjm
  420. 2 Mohawk Circle         harvard!m2c!jjmhome!jjm
  421. Westboro Mass 01581     jjm%jjmhome@m2c.m2c.org
  422. USA                     voice (508) 366-2813
  423.  
  424. Current author:
  425. Uwe Doering             Domain   : gemini@geminix.in-berlin.de
  426. Billstedter Pfad 17 b   Bangpath : ...!unido!fub!tmpmbx!geminix!gemini
  427. 1000 Berlin 20
  428. Germany
  429.