home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / docs / serial-h < prev    next >
Encoding:
Text File  |  1996-07-11  |  58.4 KB  |  1,366 lines

  1.   The Linux Serial HOWTO
  2.   by Greg Hankins, greg.hankins@cc.gatech.edu
  3.   v1.8.1, 9 October 1995
  4.  
  5.   This document describes how to set up serial communications devices
  6.   on a Linux box.
  7.  
  8.   1.  Introduction
  9.  
  10.   This is the Linux Serial HOWTO.  All about how to set up modems and
  11.   terminals under Linux, some serial tips, and troubleshooting.
  12.  
  13.   1.1.  Copyright
  14.  
  15.   The Linux Serial HOWTO is copyright (C) 1993 - 1995 by Greg Hankins.
  16.   Linux HOWTO documents may be reproduced and distributed in whole or in
  17.   part, in any medium physical or electronic, as long as this copyright
  18.   notice is retained on all copies. Commercial redistribution is allowed
  19.   and encouraged; however, the author would like to be notified of any
  20.   such distributions.
  21.  
  22.   All translations, derivative works, or aggregate works incorporating
  23.   any Linux HOWTO documents must be covered under this copyright notice.
  24.   That is, you may not produce a derivative work from a HOWTO and impose
  25.   additional restrictions on its distribution. Exceptions to these rules
  26.   may be granted under certain conditions; please contact the Linux
  27.   HOWTO coordinator at the address given below.
  28.  
  29.   In short, we wish to promote dissemination of this information through
  30.   as many channels as possible. However, we do wish to retain copyright
  31.   on the HOWTO documents, and would like to be notified of any plans to
  32.   redistribute the HOWTOs.
  33.  
  34.   If you have questions, please contact Greg Hankins, the Linux HOWTO
  35.   coordinator, at +1 404 853 9989.
  36.  
  37.   1.2.  Other sources of information
  38.  
  39.   ╖  man pages for: agetty(8), getty(1m), gettydefs(5), init(1),
  40.      login(1), mgetty(8), setserial(8)
  41.  
  42.   ╖  Your modem manual
  43.  
  44.   ╖  UUCP HOWTO: for information on setting up UUCP
  45.  
  46.   ╖  Printing HOWTO: for setting up a serial printer
  47.  
  48.   ╖  NET-2 HOWTO: all about networking, including SLIP, CSLIP, PLIP and
  49.      PPP
  50.  
  51.   ╖  BUPS HOWTO: setting up UPS boxen connected to your serial port
  52.  
  53.   ╖  Term HOWTO: everything you wanted to know about the term program
  54.  
  55.   ╖  USENET newsgroups:
  56.  
  57.   comp.os.linux.advocacy            Benefits of Linux compared to other operating systems.
  58.   comp.os.linux.announce            Announcements important to the Linux community.
  59.   comp.os.linux.answers             FAQs, How-To's, READMEs, etc. about Linux.
  60.   comp.os.linux.development.apps    Writing Linux applications, porting to Linux.
  61.   comp.os.linux.development.system  Linux kernels, device drivers, modules.
  62.   comp.os.linux.hardware            Hardware compatibility with the Linux operating system.
  63.   comp.os.linux.misc                Linux-specific topics not covered by other groups.
  64.   comp.os.linux.networking          Networking and communications under Linux.
  65.   comp.os.linux.setup               Linux installation and system administration.
  66.   comp.os.linux.x                   Linux X Window System servers, clients, libs and fonts.
  67.  
  68.   ╖  the Linux serial mailing list.  To join, send email to
  69.      majordomo@vger.rutgers.edu, with
  70.      ``subscribe linux-serial'' in the message body.  If you send
  71.      ``help'' in the message body, you get a help message.
  72.  
  73.   1.3.  New versions of this document
  74.  
  75.   New versions of the Serial-HOWTO will be placed on
  76.   sunsite.unc.edu <ftp://sunsite.unc.edu:/pub/Linux/docs/HOWTO/Serial-
  77.   HOWTO> and mirror sites.  There are other formats, such as a
  78.   PostScript and dvi version in the other-formats directory.  The Serial
  79.   HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Serial-HOWTO.html> is also
  80.   available for WWW clients such as mosaic.  It will also be posted
  81.   regularly to comp.os.linux.answers.
  82.  
  83.   1.4.  Feedback
  84.  
  85.   Please send me any questions, comments, suggestions, or additional
  86.   material.  I'm always eager to hear about what you think about the
  87.   HOWTO.  I'm also always on the lookout for improvements!  Tell me
  88.   exactly what you don't understand, or what could be clearer.  You can
  89.   reach me at greg.hankins@cc.gatech.edu via email.  I can also be
  90.   reached at:
  91.  
  92.   Greg Hankins
  93.   College of Computing
  94.   801 Atlantic Drive
  95.   Atlanta, GA 30332-0280
  96.  
  97.   via snail mail, and at my home page
  98.   <http://www.cc.gatech.edu/staff/h/Greg.Hankins/> via the WWW.
  99.  
  100.   Please include the version number of the Serial HOWTO when writing,
  101.   this is version 1.8.1.
  102.  
  103.   1.5.  Disclaimer
  104.  
  105.   Your mileage may vary.  The answers given may not work for all systems
  106.   and all setup combinations.
  107.  
  108.   2.  Supported serial hardware
  109.  
  110.   Linux is known to work with the following serial hardware.
  111.  
  112.   ╖  standard PC serial boards (COM1 - COM4), to which external serial
  113.      devices (modems, serial mice, etc...) can be connected
  114.  
  115.   ╖  standard PC internal modems (COM1 - COM4)
  116.  
  117.   ╖  Quickpath Systems Port-Folio 550e (allows IRQs of 3, 4, 5, 9, 10,
  118.      11, 12, and 15)
  119.  
  120.   2.1.  Multiport serial boards (with 16450/16550A UARTs)
  121.  
  122.   ╖  AST FourPort and clones (4 port)
  123.  
  124.   ╖  Accent Async-4 (4 port)
  125.  
  126.   ╖  Arnet Multiport-8 (8 port)
  127.  
  128.   ╖  Bell Technologies HUB6 (6 port)
  129.  
  130.   ╖  Boca BB-1004 (4 port), BB-1008 (8 port), BB-2016 (16 port)
  131.  
  132.   ╖  Boca IOAT66 (6 port)
  133.  
  134.   ╖  Boca 2by4 (4S/2P)
  135.  
  136.   ╖  Computone ValuePort V4-ISA (AST FourPort compatible)
  137.  
  138.   ╖  PC-COMM (4 port)
  139.  
  140.   ╖  STB-4COM (4 port)
  141.  
  142.   ╖  Twincom ACI/550
  143.  
  144.   ╖  Usenet Serial Board II (4 port)
  145.  
  146.   In general, Linux will support any serial board which uses a 8250,
  147.   16450, 16550, 16550A (or compatible) UART, or an internal modem which
  148.   emulates one of the above UARTs.
  149.  
  150.   Special note on the BB-1004 and BB-1008, they do not support DCD and
  151.   RI lines, and thus are not usable for dialin modems.  They will work
  152.   fine for all other purposes.
  153.  
  154.   2.2.  Intelligent multiport serial boards
  155.  
  156.   ╖  Comtrol RocketPort (36Mhz ASIC - 4, 8, 16 or 32 port) (contact
  157.      info@comtrol.com or Comtrol's Home Page <http://www.comtrol.com>.
  158.      Driver location: tsx-11.mit.edu/pub/linux/packages/comtrol)
  159.  
  160.   ╖  Computone IntelliPort II (16Mhz 80186 - 4, 8, or 16 port) Computone
  161.      IntelliPort II EXpandable (20Mhz 80186 - modular 16 - 64 port)
  162.      (pre-ALPHA driver, contact Michael H. Warfield,
  163.      mhw@wittsend.atl.ga.us)
  164.  
  165.   ╖  Cyclades Cyclom 8Y (8 port), and 16Y (16 port) (Cirrus Logic
  166.      CD-1400 RISC UARTs) (contact cyclades@netcom.com)
  167.  
  168.   ╖  DigiBoard PC/Xe (12.5MHz 80186 processor - 2, 4, 8, or 16 port),
  169.      and PC/Xi (12.5MHz 80186 processor - 8, or 16 port) (contact Troy
  170.      De Jongh, troyd@digibd.com.  Driver location:
  171.      ftp.digibd.com:/digiline/drivers/linux)
  172.  
  173.   ╖  Digiboard COM/Xi (10MHz 80188 processor - 4 or 8 port)
  174.      (pre-ALPHA driver contact Simon Park, si@wimpol.demon.co.uk)
  175.  
  176.   ╖  Hayes ESP8 (8 port)
  177.      (pre-ALPHA driver, contact Dennis Boylan, dennis@lan.com)
  178.  
  179.   ╖  Omega COMM-8 (8 port)
  180.      (contact Vance Petree, vpetree@infi.net)
  181.  
  182.   ╖  Specialix SIO - (modular, 4 - 32 port)
  183.      (ALPHA driver, contact Simon Allen, simonallen@cix.compulink.co.uk)
  184.  
  185.   ╖  Stallion EasyIO-4 (4 port), EasyIO-8 (8 port), and Stallion
  186.      EasyConnection (modular, 8 - 32 port) (Cirrus Logic CD-1400 RISC
  187.      UARTs), Stallion (8MHz 80186 processor - 8 or 16 port), Brumby (10
  188.      MHz 80186 processor - 4, 8 or 16 port), ONboard (16MHz 80186
  189.      processor - 4, 8, 12, 16 or 32 port), EasyConnection 8/64 (25MHz
  190.      80186 processor - modular, 8 - 64 port) (contact Greg Ungerer,
  191.      gerg@stallion.oz.au or Stallion's Home Page
  192.      <http://www.stallion.com>.  Driver Location:
  193.      ftp.stallion.com:/drivers/ata5/Linux)
  194.  
  195.   Drivers for the Cyclades, DigiBoard, and Specialix boards can be
  196.   found on sunsite.unc.edu:/pub/Linux/kernel/patches/serial and mirror
  197.   sites.
  198.  
  199.   3.  What are the names of the serial ports?
  200.  
  201.   There are the 4 serial devices corresponding to COM1 - COM4:
  202.  
  203.        /dev/cua0, /dev/ttyS0 (COM1) address 0x3f8 IRQ 4
  204.        /dev/cua1, /dev/ttyS1 (COM2) address 0x2f8 IRQ 3
  205.        /dev/cua2, /dev/ttyS2 (COM3) address 0x3e8 IRQ 4
  206.        /dev/cua3, /dev/ttyS3 (COM4) address 0x2e8 IRQ 3
  207.  
  208.   The /dev/ttySN devices are for incoming connections and /dev/cuaN
  209.   devices for outgoing connections.  N is the serial port number.  In
  210.   this document, I refer to COM1 as ttyS0, COM2 as ttyS1, COM3 as ttyS2,
  211.   and COM4 as ttyS3.  If I am referring to a specific device in /dev, I
  212.   will always prepend /dev to avoid confusing you.
  213.  
  214.   On some installations, two extra devices will be created, /dev/modem
  215.   for your modem and /dev/mouse for your mouse.  Both of these are
  216.   symbolic links to the appropriate /dev/cuaN device which you specified
  217.   during the installation (unless you have a bus mouse, then /dev/mouse
  218.   will point to the bus mouse device).
  219.  
  220.   There has been some discussion on the merits of /dev/mouse and
  221.   /dev/modem.  I strongly discourage the use of these links.  In
  222.   particular, if you are planning on using your modem for dialin you
  223.   will run into problems because the lock files will not work correctly
  224.   if you use /dev/modem. Use them if you like, but be sure they point to
  225.   the right device.
  226.  
  227.   3.1.  Major and minor device numbers of serial devices in /dev
  228.  
  229.        /dev/ttyS0 major 4, minor 64    /dev/cua0 major 5, minor 64
  230.        /dev/ttyS1 major 4, minor 65    /dev/cua1 major 5, minor 65
  231.        /dev/ttyS2 major 4, minor 66    /dev/cua2 major 5, minor 66
  232.        /dev/ttyS3 major 4, minor 67    /dev/cua3 major 5, minor 67
  233.  
  234.   Note that all distributions should come with these devices already
  235.   made correctly.
  236.  
  237.   3.1.1.  Creating devices in /dev
  238.  
  239.   If you don't have a device, you will have to create it with the mknod
  240.   command.
  241.  
  242.   Example, suppose you needed to create devices for ttyS0:
  243.  
  244.        linux# mknod -m 666 /dev/cua0 c 5 64
  245.        linux# mknod -m 666 /dev/ttyS0 c 4 64
  246.  
  247.   You can also get the MAKEDEV script, available on the usual FTP sites.
  248.   This simplifies the making of devices.  For example, if you needed to
  249.   make the devices for ttyS0 you would type:
  250.  
  251.        linux# cd /dev
  252.        linux# MAKEDEV ttyS0
  253.  
  254.   This handles the devices creation for the incoming and outgoing
  255.   devices.
  256.  
  257.   3.1.2.  Notes for multiport boards
  258.  
  259.   The devices your multiport board uses depends on what kind of board
  260.   you have.  These are listed in detail in the rc.serial which comes
  261.   with the setserial program.  You will probably need to create these
  262.   devices.  Either use the mknod command, or get the MAKEDEV script.
  263.   Devices for multiport boards are made by adding ``64 + the port
  264.   number''.  So, if you wanted to create devices for ttyS17, you would
  265.   type:
  266.  
  267.        linux# mknod -m 666 /dev/cua17 c 5 81
  268.        linux# mknod -m 666 /dev/ttyS17 c 4 81
  269.  
  270.   Note that ``64 + 17 = 81''.  Using the MAKEDEV script, you would type:
  271.  
  272.        linux# cd /dev
  273.        linux# MAKEDEV ttyS17
  274.  
  275.   4.  What is getty?
  276.  
  277.   getty is a program that handles the login process when you log onto a
  278.   Unix box.  There are 3 versions that are commonly used with Linux:
  279.   agetty, getty_ps and mgetty.
  280.  
  281.   4.1.  About getty_ps
  282.  
  283.   This version of getty was written by Paul Sutcliffe Jr.,
  284.   paul@devon.lns.pa.us.  Kris Gleason, gleasokr@boulder.colorado.edu
  285.   currently maintains it.  2.0.7e is the latest version, and supersedes
  286.   any older versions.  Most distributions come with the getty_ps package
  287.   installed as /sbin/getty.
  288.  
  289.   The getty_ps package contains two getties.  getty is used for console,
  290.   and terminal devices - and uugetty which is used for modems.  I use
  291.   this version of getty, so I will focus on the getty_ps package in this
  292.   HOWTO.
  293.  
  294.   4.2.  About mgetty
  295.  
  296.   mgetty is a version of getty written by Gert Doering
  297.   gert@greenie.muc.de.  In addition to allowing logins, mgetty also
  298.   provides class 2 FAX support through sendfax, which accompanies
  299.   mgetty.  mgetty+sendfax 0.22 is the latest version of this package.
  300.   The mgetty documentation is quite good, and does not need
  301.   supplementing.  Please refer to it for installation instructions.
  302.  
  303.   4.3.  About agetty
  304.  
  305.   agetty is the third variation of getty.  It was original written by
  306.   W.Z. Venema, wietse@wzv.win.tue.nl.  It's a simple implementation of
  307.   getty.
  308.  
  309.   5.  What is setserial?
  310.  
  311.   setserial is a program which allows you to look at and change various
  312.   attributes of a serial device, including its port address, its
  313.   interrupt, and other serial port options.  It was initially written
  314.   Rick Sladkey, and was heavily modified by Ted T'so tytso@mit.edu, who
  315.   also maintains it.  The newest version is 2.10, and can be found on
  316.   the Linux FTP sites.  You can find out what version you have by
  317.   running setserial with no arguments.
  318.  
  319.   When your Linux system boots, only ttyS{0-3} are configured, using the
  320.   default IRQs of 4 and 3.  So, if you have any other serial ports
  321.   provided by other boards or if ttyS{0-3} have a non-standard IRQ, you
  322.   must use this program in order to configure those serial ports.  For
  323.   the full listing of options, consult the man page.
  324.  
  325.   6.  How do I dial out with my modem?
  326.  
  327.   6.1.  Hardware requirements
  328.  
  329.   First, make sure you have the right cable.  Your modem requires a
  330.   straight through cable, with no pins crossed.  Any computer store
  331.   should have these.  Make sure you get the correct gender.  If you are
  332.   using the DB25 serial port, it will always be the male DB25.  Do not
  333.   confuse it with the parallel port, which is the female DB25.  Hook up
  334.   your modem to one of your serial ports.  Consult your modem manual on
  335.   how to do this if you need help.
  336.  
  337.   6.1.1.  Notes on internal modems
  338.  
  339.   For an internal modem, you will not need a cable.  An internal modem
  340.   does not need a serial port, it has one built in.  All you need to do
  341.   is configure it to use an interrupt that is not being used, and
  342.   configure the port I/O address.  Consult your modem manual if you get
  343.   stuck.  Also, see section ``Can I use more than   2 serial devices?''
  344.   if you need help on choosing interrupts or addresses.
  345.  
  346.   Due to a bit of stupidity on IBM's part, you may encounter problems if
  347.   you want your internal modem to be on ttyS3.  If Linux does not detect
  348.   your internal modem on ttyS3, you can use setserial and the modem will
  349.   work fine.  Internal modems on ttyS{0-2} should not have any problems
  350.   being detected.
  351.  
  352.   6.2.  Talking to your modem
  353.  
  354.   Use kermit or some other simple comm program to test the setup, before
  355.   you go jumping into complex comm programs.  (For legal reasons, kermit
  356.   is not distributed with commercial distributions.  You can find the
  357.   latest version of kermit on sunsite.unc.edu:/pub/Linux/apps/comm and
  358.   mirror sites.)  For example, say your modem was on ttyS3, and it could
  359.   handle 38400 bps.  You would do the following:
  360.  
  361.        linux# kermit
  362.        C-Kermit 5A(188), 23 Nov 92, POSIX
  363.        Type ? or HELP for help
  364.        C-Kermit>set line /dev/cua3
  365.        C-Kermit>set speed 38400
  366.        /dev/cua3, 38400 bps
  367.        C-Kermit>c
  368.        Connecting to /dev/cua3, speed 38400.
  369.        The escape character is Ctrl-\ (ASCII 28, FS)
  370.        Type the escape character followed by C to get back,
  371.        or followed by ? to see other options.
  372.        AT
  373.        OK
  374.        <ctrl>-\-C
  375.        (Back at linux)
  376.        C-Kermit>quit
  377.        linux#
  378.  
  379.   If your modem responds to AT commands, you can assume your modem is
  380.   working correctly on the Linux side.  Try calling another modem.  If
  381.   you don't like kermit, try one of the more advanced comm programs.
  382.   Check out section ``Communications programs'' about comm programs if
  383.   you need some pointers.
  384.  
  385.   When you dial out with your modem, set the speed to the highest bps
  386.   rate that your modem supports.  Since there is no speed named 57600 or
  387.   115200 bps, you must use the setserial program to set your serial port
  388.   to a higher speed.  See section ``How do I set up my serial ports for
  389.   higher speeds?'' for how to do this.  Then, set the speed to 38400 bps
  390.   in your comm program.
  391.  
  392.   6.3.  Dial out modem configuration
  393.  
  394.   For dial out use only, you can configure your modem however you want.
  395.   If you intend to use your modem for dialin, you must configure your
  396.   modem at the same speed that you intend to run getty at.  So, if you
  397.   want to run getty at 38400 bps, set your speed to 38400 bps when you
  398.   configure your modem.  This is done to prevent speed mismatches
  399.   between your computer and modem.
  400.  
  401.   I like to see result codes, so I set Q0 - result codes are reported.
  402.   To set this on my modem, I would have to precede the register name
  403.   with an AT command.  Using kermit or some comm program, connect to
  404.   your modem and type the following: ATQ0.  If your modem says OK back
  405.   to you, then the register is set.  Do this for each register you want
  406.   to set.
  407.  
  408.   I also like to see what I'm typing, so I set E1 - command echo on.  If
  409.   your modem has data compression capabilities, you probably want to
  410.   enable them.  Consult your modem manual for more help, and a full
  411.   listing of options.  If your modem supports a stored profile, be sure
  412.   to write the configuration to the modem (often done with AT&W, but
  413.   varies between modem manufacturers) if not you will have to set the
  414.   registers every time you turn on, or reset your modem.
  415.  
  416.   6.4.  Hardware flow control
  417.  
  418.   If your modem supports hardware flow control (RTS/CTS), I highly
  419.   recommend you use it.  This is particularly important for modems that
  420.   support data compression.  First, you have to enable RTS/CTS flow
  421.   control on the serial port itself.  This is best done on startup, like
  422.   in /etc/rc.d/rc.local or /etc/rc.d/rc.serial.  Make sure that these
  423.   files are being run from the main rc.M file!  You need to do the
  424.   following for each serial port you want to enable hardware flow
  425.   control on:
  426.  
  427.        stty crtscts < /dev/cuaN
  428.  
  429.   You must also enable RTS/CTS flow control on your modem.  Consult your
  430.   modem manual on how to do this, as it varies between modem
  431.   manufacturers.  Be sure to save your modem configuration if your modem
  432.   supports stored profiles.
  433.  
  434.   7.  How do I dial in and out with my modem using getty_ps?
  435.  
  436.   Get your modem to dial out correctly.  If you haven't read section
  437.   ``How do I dial out with my modem'' go read it now!  It contains very
  438.   important setup information.
  439.  
  440.   7.1.  Dial in and out modem configuration
  441.  
  442.   For dialin and dialout use, you have to set up your modem a certain
  443.   way (again, using AT commands on your modem):
  444.  
  445.        E1       command echo ON
  446.        Q0       result codes are reported
  447.        V1       verbose ON
  448.        S0=0     never answer (uugetty handles this with the WAITFOR option)
  449.  
  450.   If you don't set these correctly, your INIT string in your config file
  451.   may fail, hosing the whole process.  But, more on config files
  452.   below...
  453.  
  454.        &C1     DCD is on after connect only
  455.        &S0     DSR is always on
  456.                DTR on/off resets modem (depends on manufacturer - RTFM)
  457.  
  458.   These affect what your modem does when calls start and end.
  459.  
  460.   If your modem does not support a stored profile, you can set these
  461.   through the INIT string in your config file.  See below.  Some modems
  462.   come with DIP switches that affect register settings.  Be sure these
  463.   are set correctly, too.
  464.  
  465.   I have started a collection of modem setups for different types of
  466.   modems.  So far, I only have a few of them, if you would like to send
  467.   me your working configuration, please do so!  If you would like me to
  468.   send you one of the configurations, just mail me and ask.  I'm not
  469.   listing them here due to space concerns.  I have setups for Supra,
  470.   Telebit T1600, USR Courier and Sportster, and Zoom 14.4/28.8 modems.
  471.  
  472.   7.2.  Installing getty_ps
  473.  
  474.   By default, getty_ps will be configured to be Linux FSSTND (FileSystem
  475.   STaNDard) compliant, which means that the binaries will be in /sbin,
  476.   and the config files will be named /etc/conf.{uu}getty.ttySN.  This is
  477.   not apparent from the documentation!  It will also expect lock files
  478.   to go in /var/lock.  Make sure you have the /var/lock directory.
  479.  
  480.   If you don't want FSSTND compliance, binaries will go in /etc, config
  481.   files will go in /etc/default/{uu}getty.ttySN, and lock file will go
  482.   in /usr/spool/uucp.  I recommend doing things this way if you are
  483.   using UUCP, because Taylor UUCP will have problems if you move the
  484.   lock files to where it isn't looking for them.
  485.   getty_ps also uses syslogd to log messages.  See the man pages for
  486.   syslogd(1) and syslog.conf(5) for setting up syslogd, if you don't
  487.   have it running already.  Messages are logged with priority LOG_AUTH,
  488.   errors use LOG_ERR, and debugging uses LOG_DEBUG.  If you don't want
  489.   to use syslogd you can edit tune.h in the getty_ps source files to use
  490.   a log file for messages instead, namely /var/adm/getty.log by default.
  491.  
  492.   When you have decided if you want FSSTND, and syslog, edit tune.h and
  493.   the Makefile in the getty_ps source directory to reflect you
  494.   decisions.  Now, install according to the instructions.
  495.  
  496.   From this point on, all references to getty will refer to getty_ps.
  497.   References to uugetty will refer to the uugetty that comes with the
  498.   getty_ps package.
  499.  
  500.   7.3.  Setting up uugetty
  501.  
  502.   For dialing into, and out from your modem, we want to use uugetty.
  503.   uugetty does important lock file checking.  Update /etc/gettydefs to
  504.   include entries for modems (note that the entries point to each other,
  505.   these are not for fixed speed):
  506.  
  507.        # Modem entries
  508.        38400# B38400 CS8 # B38400 SANE -ISTRIP HUPCL #@S @L @B login: #19200
  509.        19200# B19200 CS8 # B19200 SANE -ISTRIP HUPCL #@S @L @B login: #9600
  510.        9600# B9600 CS8 # B9600 SANE -ISTRIP HUPCL #@S @L @B login: #2400
  511.        2400# B2400 CS8 # B2400 SANE -ISTRIP HUPCL #@S @L @B login: #1200
  512.        1200# B1200 CS8 # B1200 SANE -ISTRIP HUPCL #@S @L @B login: #300
  513.        300# B300 CS8 # B300 SANE -ISTRIP HUPCL #@S @L @B login: #38400
  514.  
  515.   If you have a 9600 bps or faster modem, with data compression, you can
  516.   lock your serial port speed and let the modem handle the transitions
  517.   to other bps rates. Then, instead of the step down series of lines
  518.   listed above, /etc/gettydefs only needs to contain one line for the
  519.   modem:
  520.  
  521.        # 38400 fixed speed
  522.        F38400# B38400 CS8 # B38400 SANE -ISTRIP HUPCL #@S @L @B login: #F38400
  523.        # 19200 fixed speed
  524.        F19200# B19200 CS8 # B19200 SANE -ISTRIP HUPCL #@S @L @B login: #F19200
  525.        # 9600 fixed speed
  526.        F9600# B9600 CS8 # B9600 SANE -ISTRIP HUPCL #@S @L @B login: #F9600
  527.  
  528.   If you have your modem set up to do RTS/CTS hardware flow control, you
  529.   can add CRTSCTS to the entries:
  530.  
  531.   # 38400 fixed speed with hardware flow control
  532.   F38400# B38400 CS8 CRTSCTS # B38400 SANE -ISTRIP HUPCL CRTSCTS #@S @L @B login: #F38400
  533.   # 19200 fixed speed with hardware flow control
  534.   F19200# B19200 CS8 CRTSCTS # B19200 SANE -ISTRIP HUPCL CRTSCTS #@S @L @B login: #F19200
  535.   # 9600 fixed speed with hardware flow control
  536.   F9600# B9600 CS8 CRTSCTS # B9600 SANE -ISTRIP HUPCL CRTSCTS #@S @L @B login: #F9600
  537.  
  538.   If you want, you can make uugetty print interesting things in the
  539.   login banner.  In my examples, I have the system name, the serial
  540.   line, and the current bps rate.  You can add other things:
  541.  
  542.               @B    The current (evaluated at the time the @B is seen) bps rate.
  543.               @D    The current date, in MM/DD/YY.
  544.               @L    The serial line to which getty is attached.
  545.               @S    The system name.
  546.               @T    The current time, in HH:MM:SS (24-hour).
  547.               @U    The number of currently signed-on users.  This is  a
  548.                     count of the number of entries in the /etc/utmp file
  549.                     that have a non-null ut_name field.
  550.               @V    The value of VERSION, as given in the defaults file.
  551.               To display a single '@' character, use either '\@' or '@@'.
  552.  
  553.   Next, make sure that you have an outgoing and incoming device for the
  554.   serial port your modem is on.  If you have your modem on ttyS3 you
  555.   will need the /dev/cua3, and /dev/ttyS3 devices.  If you don't have
  556.   the correct devices, see section ``Creating devices in <tt>/dev</tt>''
  557.   on how to create devices, and create the devices.
  558.  
  559.   7.4.  Customizing uugetty
  560.  
  561.   There are lots of parameters you can tweak for each port you have.
  562.   These are implemented in separate config files for each port.  The
  563.   file /etc/conf.uugetty will be used by all instances of uugetty, and
  564.   /etc/conf.uugetty.ttySN will only be used by that one port.  Sample
  565.   default config files can be found with the getty_ps source files,
  566.   which come with most Linux distributions.  Due to space concerns, they
  567.   are not listed here.  Note that if you are using older versions of
  568.   getty (older than 2.0.7e), or aren't using FSSTND, then the default
  569.   file will be /etc/default/uugetty.ttySN.  My /etc/conf.uugetty.ttyS3
  570.   looks like this:
  571.  
  572.   # sample uugetty configuration file for a Hayes compatible modem to allow
  573.   # incoming modem connections
  574.   #
  575.   # alternate lock file to check... if this lock file exists, then uugetty is
  576.   # restarted so that the modem is re-initialized
  577.   ALTLOCK=cua3
  578.   ALTLINE=cua3
  579.   # line to initialize
  580.   INITLINE=cua3
  581.   # timeout to disconnect if idle...
  582.   TIMEOUT=60
  583.   # modem initialization string...
  584.   # format: <expect> <send> ... (chat sequence)
  585.   INIT="" AT\r OK\r\n
  586.   WAITFOR=RING
  587.   CONNECT="" ATA\r CONNECT\s\A
  588.   # this line sets the time to delay before sending the login banner
  589.   DELAY=1
  590.   #DEBUG=010
  591.  
  592.   Add the following line to your /etc/inittab, so that uugetty is run on
  593.   your serial port (substituting in the correct information for your
  594.   environment - port, speed, and default terminal type):
  595.  
  596.        S3:456:respawn:/sbin/uugetty ttyS3 F38400 vt100
  597.  
  598.   Restart init:
  599.  
  600.        linux# init q
  601.  
  602.   For the speed parameter in your inittab, you want to use the highest
  603.   bps rate that your modem supports.  Since there is no speed named
  604.   57600 or 115200, you must use the setserial program to set your serial
  605.   port to a higher speed.  See section ``How do I set up my serial ports
  606.   for higher speeds?'' for doing this.  Then, use 38400 bps in your
  607.   inittab.
  608.  
  609.   Now Linux will be watching your serial port for connections.  Dial in
  610.   from another site and login to you Linux system.  Rejoice.
  611.  
  612.   uugetty has a lot more options, see the man page for getty(1m) for a
  613.   full description.  Among other things there is a scheduling feature,
  614.   and a ringback feature.  RTFM :-).
  615.  
  616.   7.5.  US Robotics Notes
  617.  
  618.   To get my USR Courier modem to reset correctly when DTR drops, I had
  619.   to set &D2 and S13=1.
  620.  
  621.   7.6.  Supra Notes
  622.  
  623.   Supra modems treat DCD differently than other modems.  If you are
  624.   using a Supra, you must set &C0 and not &C1.  You must also set &D2 to
  625.   handle DTR correctly.
  626.  
  627.   8.  How do I set up a terminal connected to my PC?
  628.  
  629.   8.1.  Hardware requirements
  630.  
  631.   Make sure you have the right kind of cable.  A null modem cable bought
  632.   at a computer store will do it.  But it must be a null modem cable!
  633.   Make sure you are using your serial port, the male DB25 or the DB9,
  634.   and not your parallel port.
  635.  
  636.   For a DB25 connector, you need a minimum of:
  637.  
  638.           TxD   Transmit Data         2 - 3       RxD   Receive Data
  639.           RxD   Receive Data          3 - 2       TxD   Transmit Data
  640.           SG    Signal Ground         7 - 7       SG    Signal Ground
  641.  
  642.   If you want to have hardware handshaking signals, you must have a full
  643.   null modem cable:
  644.  
  645.           TxD   Transmit Data         2 - 3       RxD   Receive Data
  646.           RxD   Receive Data          3 - 2       TxD   Transmit Data
  647.           RTS   Request To Send       4 - 5       CTS   Clear To Send
  648.           CTS   Clear To Send         5 - 4       RTS   Request To Send
  649.           DSR   Data Set Ready        6 - 20      DTR   Data Terminal Ready
  650.           SG    Signal Ground         7 - 7       SG    Signal Ground
  651.           DCD   Carrier Detect        8 - 20      DTR   Data Terminal Ready
  652.           DTR   Data Terminal Ready  20 - 6       DSR   Data Set Ready
  653.           DTR   Data Terminal Ready  20 - 8       DCD   Carrier Detect
  654.  
  655.   If you have a DB9 connector on your serial port, try the following:
  656.  
  657.                                     DB9   DB25
  658.           RxD   Receive Data          2 - 2       TxD   Transmit Data
  659.           TxD   Transmit Data         3 - 3       RxD   Receive Data
  660.           SG    Signal Ground         5 - 7       SG    Signal Ground
  661.  
  662.   Alternatively, a full DB9-DB25 null modem cable:
  663.  
  664.                                     DB9   DB25
  665.           DCD   Carrier Detect        1 - 20      DTR   Data Terminal Ready
  666.           RxD   Receive Data          2 - 2       TxD   Transmit Data
  667.           TxD   Transmit Data         3 - 3       RxD   Receive Data
  668.           DTR   Data Terminal Ready   4 - 6       DSR   Data Set Ready
  669.           DTR   Data Terminal Ready   4 - 8       DCD   Carrier Detect
  670.           SG    Signal Ground         5 - 7       SG    Signal Ground
  671.           DSR   Data Set Ready        6 - 20      DTR   Data Terminal Ready
  672.           RTS   Request To Send       7 - 5       CTS   Clear To Send
  673.           CTS   Clear To Send         8 - 4       RTS   Request To Send
  674.           (RI Ring Indicator          9 not needed)
  675.  
  676.   If you are not using a full null modem cable, you might have to do the
  677.   following trick: on your computer side of the connector, connect RTS
  678.   and CTS together, and also connect DSR, DCD and DTR together.  This
  679.   way, when the computer wants a certain handshaking signal, it will get
  680.   it (from itself).
  681.  
  682.   Now that you have the right kind of cable, connect your terminal to
  683.   your computer.  If you can, tell you terminal to ignore modem control
  684.   signals.  Try using 9600 bps, 8 data bits, 1 stop bit, no parity bits
  685.   for the terminal's setup.
  686.  
  687.   8.2.  Setting up getty
  688.  
  689.   Install getty_ps as described in section 7.2.  Add an entry for getty
  690.   to use for your terminal in /etc/gettydefs:
  691.  
  692.        # 38400 bps Dumb Terminal entry
  693.        DT38400# B38400 CS8 CLOCAL # B38400 SANE -ISTRIP CLOCAL #@S @L login: #DT38400
  694.        # 19200 bps Dumb Terminal entry
  695.        DT19200# B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S @L login: #DT19200
  696.        # 9600 bps Dumb Terminal entry
  697.        DT9600# B9600 CS8 CLOCAL # B9600 SANE -ISTRIP CLOCAL #@S @L login: #DT9600
  698.  
  699.   If you want, you can make getty print interesting things in the login
  700.   banner.  In my examples, I have the system name and the serial line
  701.   printed.  You can add other things:
  702.  
  703.        @B    The current (evaluated at the time the @B is seen) bps rate.
  704.        @D    The current date, in MM/DD/YY.
  705.        @L    The serial line to which getty is attached.
  706.        @S    The system name.
  707.        @T    The current time, in HH:MM:SS (24-hour).
  708.        @U    The number of currently signed-on users.  This is  a
  709.              count of the number of entries in the /etc/utmp file
  710.              that have a non-null ut_name field.
  711.        @V    The value of VERSION, as given in the defaults file.
  712.        To display a single '@' character, use either '\@' or '@@'.
  713.  
  714.   Edit your /etc/inittab file to run getty on the serial port
  715.   (substituting in the correct information for your environment - port,
  716.   speed, and default terminal type):
  717.  
  718.        S1:456:respawn:/sbin/getty ttyS1 DT9600 vt100
  719.  
  720.   Restart init:
  721.  
  722.   linux# init q
  723.  
  724.   At this point, you should see a login prompt on your terminal.  You
  725.   may have to hit return to get the terminal's attention.  Rejoice.
  726.  
  727.   8.3.  Notes on setting up a PC as a terminal
  728.  
  729.   Many people set up other PCs as terminals connected to Linux boxen.
  730.   For example, old 8088 or 286 PCs are perfect for this purpose.  All
  731.   you need is a DOS boot disk containing a version of DOS suitable for
  732.   your terminal-PC, and a communications program for your terminal-PC to
  733.   run.  kermit works very well for this purpose.  You can find
  734.   precompiled versions of kermit for nearly every OS in existence at
  735.   watsun.cc.columbia.edu:/pub/ftp/kermit.  Other popular DOS comm
  736.   programs such as telix and procomm will work equally well.  Be sure to
  737.   input correct serial port information into your terminal-PC's
  738.   communications setup.
  739.  
  740.   9.  Can I use more than 2 serial devices?
  741.  
  742.   You don't need to read this section, unless you want to use 3 or more
  743.   serial devices... (assuming you don't have a multiport board).
  744.  
  745.   Providing you have another spare serial port, yes, you can.
  746.  
  747.   The number of serial ports you can use is limited by the number of
  748.   interrupts (IRQ) and port I/O addresses we have to use.  This is not a
  749.   Linux limitation, but a limitation of the PC bus.  Each serial devices
  750.   must be assigned it's own interrupt and address.  A serial device can
  751.   be a serial port, an internal modem, or a multiport serial board.
  752.  
  753.   Multiport serial boards are specially designed to have multiple serial
  754.   ports that share the same IRQ for all serial ports on the board.
  755.   Linux gets data from them by using a different I/O address for each
  756.   port on the card.
  757.  
  758.   9.1.  Choosing serial device interrupts
  759.  
  760.   Your PC will normally come with ttyS0 and ttyS2 at IRQ 4, and ttyS1
  761.   and ttyS3 at IRQ 3.  To use more than 2 serial devices, you will have
  762.   to give up an interrupt to use.  A good choice is to reassign an
  763.   interrupt from your parallel port.  Your PC normally comes with IRQ 5
  764.   and IRQ 7 set up as interrupts for your parallel ports, but few people
  765.   use 2 parallel ports.  You can reassign one of the interrupts to a
  766.   serial device, and still happily use a parallel port.  You will need
  767.   the setserial program to do this.  In addition, you have to play with
  768.   the jumpers on your boards, check the docs for your board.  Set the
  769.   jumpers to the IRQ you want for each port.
  770.  
  771.   You will need to set things up so that there is one, and only one
  772.   interrupt for each serial device.  Here is how I set mine up in
  773.   /etc/rc.d/rc.local - you should do it upon startup somewhere:
  774.  
  775.                /etc/setserial /dev/cua0 irq 3          # my serial mouse
  776.                /etc/setserial /dev/cua1 irq 4          # my Wyse dumb terminal
  777.                /etc/setserial /dev/cua2 irq 5          # my Zoom modem
  778.                /etc/setserial /dev/cua3 irq 9          # my USR modem
  779.  
  780.   Standard IRQ assignments:
  781.  
  782.                      IRQ  0    Timer channel 0
  783.                      IRQ  1    Keyboard
  784.                      IRQ  2    Cascade for controller 2
  785.                      IRQ  3    Serial port 2
  786.                      IRQ  4    Serial port 1
  787.                      IRQ  5    Parallel port 2
  788.                      IRQ  6    Floppy diskette
  789.                      IRQ  7    Parallel port 1
  790.                      IRQ  8    Real-time clock
  791.                      IRQ  9    Redirected to IRQ2
  792.                      IRQ 10    not assigned
  793.                      IRQ 11    not assigned
  794.                      IRQ 12    not assigned
  795.                      IRQ 13    Math coprocessor
  796.                      IRQ 14    Hard disk controller
  797.                      IRQ 15    not assigned
  798.  
  799.   There is really no Right Thing to do when choosing interrupts.  Just
  800.   make sure it isn't being used by the motherboard, or your other cards.
  801.   2, 3, 4, 5, or 7  is a good choice.  ``not assigned'' means that
  802.   currently nothing standard uses these IRQs.  Also note that IRQ 2 is
  803.   the same as IRQ 9.  You can call it either 2 or 9, the serial driver
  804.   is very understanding.
  805.  
  806.   If you have a serial card with a 16-bit bus connector, you can also
  807.   use IRQ 10, 11, 12 or 15.
  808.  
  809.   Just make sure you don't use IRQ 0, 1, 6, 8, 13 or 14!  These are used
  810.   by your mother board.  You will make her very unhappy by taking her
  811.   IRQs.
  812.  
  813.   9.2.  Setting serial device addresses
  814.  
  815.   Next, you must set the port address.  Check the manual on your board
  816.   for the jumper settings.  Like interrupts, there can only be one
  817.   serial device at each address.  Your ports will usually come
  818.   configured as follows:
  819.  
  820.                ttyS0 address 0x3f8
  821.                ttyS1 address 0x2f8
  822.                ttyS2 address 0x3e8
  823.                ttyS3 address 0x2e8
  824.  
  825.   Choose which address you want each serial device to have and set the
  826.   jumpers accordingly.  I have my modem on ttyS3, my mouse on ttyS0, and
  827.   my terminal on ttyS2.
  828.  
  829.   When you reboot, Linux should see your serial ports at the address you
  830.   set them.  The IRQ Linux sees may not correspond to the IRQ you set
  831.   with the jumpers.  Don't worry about this.  Linux does not do any IRQ
  832.   detection when it boots, because IRQ detection is dicy and can be
  833.   fooled.  Use setserial to tell Linux what IRQ the port is using.
  834.  
  835.   10.  How do I set up my serial ports for higher        speeds?  What
  836.   speed should I use with my modem?
  837.  
  838.   This section should help you figure out what speed to use when using
  839.   your modem with a communications program, or with a getty program.
  840.  
  841.   ╖  If you have something slower than a 9600 bps (V.32) modem, set your
  842.      speed to the highest speed your modem supports.  For example 300,
  843.      1200, or 2400 bps.
  844.  
  845.   ╖  If you have a 9600 bps (V.32) modem, with V.42bis data compression.
  846.      use 38400 as your speed.  V.42bis compression has a theoretical
  847.      rate of 4:1, thus ``4 * 9600 = 38400''.
  848.  
  849.   ╖  If you have a 14400 bps (V.32bis) modem, with V.42bis data
  850.      compression, use setserial, with the spd_hi flag to configure your
  851.      serial port to use 57600 bps (4 * 14400 = 57600).
  852.  
  853.      Use the spd_vhi flag if you have a 28800 (V.FC or V.34) modem (4 *
  854.      28800 = 115200).
  855.  
  856.      Then, use 38400 as the speed in your comm program, or inittab.
  857.      This is now the high speed you have set.  There is no speed named
  858.      57600 or 115200 (although support was added in 1.1.65 and will be
  859.      used soon).  Make sure you have 16550A UARTs :-).
  860.  
  861.   Put your modifications into /etc/rc.d/rc.serial or /etc/rc.d/rc.local
  862.   so that they are done at startup.  In my /etc/rc.d/rc.local, I set
  863.   ttyS3 to 115200 bps by doing:
  864.  
  865.        /sbin/setserial /dev/cua3 spd_vhi
  866.  
  867.   11.  Communications programs and utilities
  868.  
  869.   Once you get everything working, you may want to check out these more
  870.   advanced programs, all are available on the usual FTP sites, if they
  871.   didn't come with your distribution.
  872.  
  873.   ╖  ecu - a communications program
  874.  
  875.   ╖  minicom - telix-like comm program
  876.  
  877.   ╖  procomm - procommish comm program with zmodem
  878.  
  879.   ╖  seyon - X based comm program
  880.  
  881.   ╖  xc - xcomm communications package
  882.  
  883.   These programs offer more features than just kermit alone, including
  884.   telephone directories, auto-dialing and so on.
  885.  
  886.   ╖  Another useful program is term.  term multiplexes many connections
  887.      over one serial line.  It is somewhat similar to SLIP, and offers
  888.      some SLIP functionality.  These include rlogin, telnet, ftp,
  889.      finger, rdate, xmosaic and tredir.  tredir is a special program
  890.      which lets you redirect remote TCP/IP ports to your local machine.
  891.      This allows for remote NNTP, and SMTP access.  The good thing about
  892.      term is that is runs entirely in user space, meaning it requires no
  893.      kernel support, or sysadmin support (like SLIP does).
  894.  
  895.   ╖  screen is another multi-session program.  This one behaves like the
  896.      virtual consoles.
  897.  
  898.   ╖  callback is a program that will have your modem call you back
  899.      immediately from where you just called.
  900.  
  901.   ╖  mgetty+fax handles FAX stuff, and provides an alternate getty
  902.  
  903.   ╖  ZyXEL is a control program for ZyXEL U-1496 modems.  It handles
  904.      dialin, dialout, dial back security, FAXing, and voice mailbox
  905.      functions.
  906.  
  907.   ╖  Other things can be found on
  908.      sunsite.unc.edu:/pub/Linux/system/Serial and
  909.      sunsite.unc.edu:/pub/Linux/apps/comm or one of the many mirrors.
  910.      These are the directories where all the serial type things are
  911.      kept.
  912.  
  913.   12.  Serial Tips
  914.  
  915.   Here are some serial tips you might find helpful...
  916.  
  917.   12.1.  kermit and zmodem
  918.  
  919.   To use zmodem with kermit, add the following to your .kermrc:
  920.  
  921.        define rz !rz < /dev/cua3 > /dev/cua3
  922.        define sz !sz \%0 > /dev/cua3 < /dev/cua3
  923.  
  924.   Be sure to put in the correct port your modem is on.  Then, to use it,
  925.   just type rz or sz <filename> at the kermit prompt.
  926.  
  927.   12.2.  Setting terminal types automagically
  928.  
  929.   To set your terminal type automagically when you log in, add the
  930.   terminal type to the entry in /etc/inittab.  If I have a vt100
  931.   terminal on ttyS1, I would add ``vt100'' to the getty command:
  932.  
  933.        S1:456:respawn:/sbin/getty ttyS1 DT9600 vt100
  934.  
  935.   You can also get tset from sunsite.unc.edu:/pub/Linux/system/Terminal-
  936.   management or a mirror site.  See the docs that come with tset to
  937.   learn how to use it.  tset can establish terminal characteristics when
  938.   you log in, and doesn't depend on any defaults.
  939.  
  940.   12.3.  Color ls on serial connections
  941.  
  942.   If ls is screwing up your terminal emulation with the color feature,
  943.   turn it off.  ls --color, and ls --colour all use the color feature.
  944.   Some installations have ls set to use color by default.  Check
  945.   /etc/profile and /etc/csh.cshrc for ls aliases.  You can also alias ls
  946.   to ls --no-color, if you don't want to change the system defaults.
  947.  
  948.   12.4.  Printing to a printer connected to a terminal
  949.  
  950.   There is a program called vtprint that will do this, written by
  951.   Garrett D'Amore garrett@sdsu.edu.
  952.   It is available from ftp.sdsu.edu:/pub/vtprint, and also from
  953.   http://www.sdsu.edu/~garrett/.  The following is from the README file
  954.   that comes with the program:
  955.  
  956.        vtprint is a program that allows users to print from a
  957.        remote UNIX host to a printer attached to their local termi¡
  958.        nal or emulator, which makes it great for printing files at
  959.        home, etc. (It only does text files, though.)
  960.  
  961.   12.5.  Can Linux configure the serial devices automagically?
  962.  
  963.   Yes.  To get Linux to detect and set up the serial devices
  964.   automatically on startup, add the line:
  965.  
  966.        /sbin/setserial /dev/cuaN auto_irq skip_test autoconfig
  967.  
  968.   to your /etc/rc.d/rc.local or /etc/rc.d/rc.serial file.  Do this for
  969.   every serial port you want to auto configure.  Be sure to give a
  970.   device name that really does exist on your machine.
  971.  
  972.   12.5.1.  Notes for multiport boards
  973.  
  974.   For board addresses, and IRQs, look at the rc.serial that comes with
  975.   the setserial program.  It has a lot of detail on multiport boards,
  976.   including I/O addresses and device names.
  977.  
  978.   13.  Linux FTP sites
  979.  
  980.        sunsite.unc.edu [152.2.22.81]:/pub/Linux        (NC, USA)
  981.        tsx-11.mit.edu [18.172.1.2]:/pub/linux          (MA, USA)
  982.        nic.funet.fi [128.214.6.100]:/pub/OS/Linux      (Finland, Europe)
  983.  
  984.   sunsite.unc.edu is the official Linux FTP site, and has many mirrors.
  985.   Please use a mirror site if at all possible to save sunsite some
  986.   traffic.
  987.  
  988.   sunsite mirrors (sunsite.unc.edu:/pub/Linux/MIRRORS):
  989.  
  990.   * CONTINENT
  991.   - COUNTRY
  992.      CITY...  FTP Site   Directory
  993.   ------------------------------------------------------------------------
  994.   * Africa
  995.   - None so far
  996.   * Asia
  997.   - Thailand
  998.      Bangkok...  ftp.nectec.or.th  /pub/mirrors/linux/
  999.   - Hong Kong
  1000.       ...  ftp.cs.cuhk.hk  /pub/Linux/
  1001.   - Republic of Singapore
  1002.      Singapore...  ftp.nus.sg  /pub/unix/Linux/
  1003.   - Japan
  1004.      Unknown...  ftp.spin.ad.jp  /pub/linux/sunsite.unc.edu/
  1005.   * Australia
  1006.      Adelaide...  smug.student.adelaide.edu.au  /pub/sunsite.linux/
  1007.      Brisbane...  ftp.dstc.edu.au  /pub/linux/
  1008.   * Europe
  1009.   - Austria
  1010.      Graz...  ftp.tu-graz.ac.at  /pub/Linux/
  1011.   - Czech Republic
  1012.      Brno...  ftp.fi.muni.cz  /pub/UNIX/linux/
  1013.      Prague...  pub.vse.cz  /pub/386-unix/linux/
  1014.   - France
  1015.      Angers...  ftp.univ-angers.fr  /pub/linux/
  1016.      Nancy...  ftp.loria.fr  /pub/linux/sunsite/
  1017.   - Germany (Deutschland)
  1018.      Aachen...  ftp.dfv.rwth-aachen.de  /pub/linux/sunsite/
  1019.      Dortmund...  ftp.germany.eu.net  /pub/os/Linux/Mirror.SunSITE/
  1020.      Dresden...  ftp.tu-dresden.de  /pub/Linux/sunsite/
  1021.      Erlangen...  ftp.uni-erlangen.de  /pub/Linux/MIRROR.sunsite/
  1022.      Mannheim...  ftp.ba-mannheim.de  /pub/linux/mirror.sunsite/
  1023.      Paderborn...  ftp.uni-paderborn.de  /pub/Mirrors/sunsite.unc.edu/
  1024.      Rostock...  ftp.uni-rostock.de  /Linux/sunsite/
  1025.      Stuttgart...  ftp.rus.uni-stuttgart.de  /pub/unix/systems/linux/MIRROR.sunsite/
  1026.      Tuebingen...  ftp.uni-tuebingen.de  /pub/linux/Mirror.sunsite/
  1027.      Ulm...  ftp.rz.uni-ulm.de  /pub/mirrors/linux/sunsite/
  1028.      Unknown...  ftp.gwdg.de  /pub/linux/mirrors/sunsite/
  1029.   - Hungary
  1030.      Budapest...  ftp.kfki.hu  /pub/linux/
  1031.   - Italy
  1032.      Pisa...  cnuce-arch.cnr.it  /pub/Linux/
  1033.   - Switzerland
  1034.      Zurich...  ftp.switch.ch  /mirror/linux/
  1035.   - Turkey (Turkiye)
  1036.      Ankara...  ftp.metu.edu.tr  /pub/linux/sunsite/
  1037.   - United Kingdom
  1038.      Coventry...  ftp.maths.warwick.ac.uk  /mirrors/linux/sunsite.unc-mirror/
  1039.      London...  src.doc.ic.ac.uk  /packages/linux/sunsite.unc-mirror/
  1040.      Mildenhall...  ftp.dungeon.com  /pub/linux/sunsite-mirror/
  1041.   * North America
  1042.   - United States
  1043.      Atlanta, GA...  ftp.cc.gatech.edu  /pub/linux/
  1044.      Chapel Hill, NC...  sunsite.unc.edu  /pub/Linux/
  1045.      Fayetteville, AR...  ftp.engr.uark.edu  /pub/linux/sunsite/
  1046.      Flagstaff, AZ...  ftp.infomagic.com  /pub/mirrors/linux/sunsite/
  1047.      Midwest...  ftp.wit.com  /systems/unix/linux/
  1048.      Mt. Pleasant, MI...  ftp.cps.cmich.edu  /pub/linux/sunsite/
  1049.      Rochester, NY...  ftp.rge.com  /pub/linux/sunsite/
  1050.      Salt Lake City, UT...  ftp.pht.com  /mirrors/linux/sunsite/
  1051.      Urbana, IL...  mrcnext.cso.uiuc.edu  /pub/linux/
  1052.      Unknown...  ftp.linux.org  /pub/mirrors/sunsite/
  1053.      Unknown...  ftp.orst.edu  /pub/mirrors/sunsite.unc.edu/linux/
  1054.      Unknown...  ftp.iquest.com  /pub/linux/sunsite/
  1055.      Unknown...  ftp.yggdrasil.com  mirrors/sunsite/
  1056.   * South America
  1057.   - Chile
  1058.     ftp.inf.utfsm.cl              /pub/Linux
  1059.   * Unknown
  1060.   - If you know where these sites are, please mail ewt@sunsite.unc.edu.
  1061.       ...  ftp.linux.org  /pub/mirrors/sunsite/
  1062.       ...  ftp.gwdg.de  /pub/linux/mirrors/sunsite/
  1063.       ...  ftp.orst.edu  /pub/mirrors/sunsite.unc.edu/linux/
  1064.       ...  ftp.iquest.com  /pub/linux/sunsite/
  1065.       ...  ftp.spin.ad.jp  /pub/linux/sunsite.unc.edu/
  1066.       ...  ftp.yggdrasil.com  mirrors/sunsite/
  1067.  
  1068.   These FTP sites support anonymous FTP, which means login as ftp, and
  1069.   password as your email address (ie logname@yourhost.yourdomain).
  1070.  
  1071.   14.  One step further...
  1072.  
  1073.   This section is not required reading, but may give you some further
  1074.   insight into Unix, and the world of telecommunications.
  1075.  
  1076.   14.1.  What are lock files?
  1077.  
  1078.   Lock file are simply a file saying that a particular device is in use.
  1079.   They are kept in /usr/spool/uucp, or /var/lock.  Linux lock files are
  1080.   named LCK..name, where name is either a device name, or a UUCP site
  1081.   name.  Certain processes create these locks so that they can have
  1082.   exclusive access to devices, for instance if you dial out on your
  1083.   modem, a lock will appear telling other processes that someone is
  1084.   using the modem already.  Locks mainly contain the PID of the process
  1085.   that has locked the device.  Most programs look at the lock, and try
  1086.   to determine if that lock is still valid by checking the process table
  1087.   for the process that has locked the device.  If the lock is found to
  1088.   be valid, the program (should) exit.  If not, some programs remove the
  1089.   stale lock, and use the device, creating their own lock in the
  1090.   process.  Other programs just exit and tell you that the device is in
  1091.   use.
  1092.  
  1093.   14.2.  ``baud'' vs. ``bps''
  1094.  
  1095.   ``baud'' and ``bps'' are perhaps one of the most misused terms in the
  1096.   computing/telecom field.  Many people use these terms interchangeably,
  1097.   when in fact they are not!
  1098.  
  1099.      baud
  1100.         The baud rate is a measure of how many times per second the
  1101.         signal sent by a modem (modulator-demodulator) changes.  For
  1102.         example, a baud rate of 1200 implies one signal change every 833
  1103.         microseconds.  Common baud rates are 50, 75, 110, 300, 600,
  1104.         1200, and 2400.  Most high speed modems run at 2400 baud.
  1105.         Because of the bandwidth limitations on voice-grade phone lines,
  1106.         baud rates greater than 2400 are harder to achieve, and only
  1107.         work under very pristine phone line quality.  ``baud'' is named
  1108.         after Emile Baudot, the inventor of the asynchronous telegraph
  1109.         printer.
  1110.  
  1111.      bps
  1112.         The bps rate is a measure of how many bits per second are
  1113.         transmitted.  Common bps rates are 50, 75, 110, 300, 1200, 2400,
  1114.         9600, ... 115200.  With modems using V.42bis compression (4:1
  1115.         compression), theoretical bps rates are possible up to 115200.
  1116.         This is what most people mean when they misuse the word
  1117.         ``baud''.
  1118.  
  1119.   So, if high speed modems are running at 2400 baud, how can they send
  1120.   14400 bps?  The modems achieve a bps > baud rate by encoding a number
  1121.   of bits per baud.  Thus, when 2 or more bits are encoded per baud, the
  1122.   bps rate exceeds the baud rate.  If your modem connects at 14400 bps,
  1123.   it's going to be sending 6 bits per baud.
  1124.  
  1125.   How did this confusion start?  Well, back when today's low speed
  1126.   modems were yesterday's high speed modems, the bps rate actually did
  1127.   equal the baud rate.  One bit would be encoded per baud.  People would
  1128.   use bps and baud interchangeably, because they were the same number.
  1129.   For example, a 300 bps modem also had a baud rate of 300.  This all
  1130.   changed when faster modems came around, and the bit rate exceeded the
  1131.   baud rate.
  1132.  
  1133.   14.3.  What are UARTs?  How do they affect performance?
  1134.  
  1135.   UARTs (Universal Asyncronous Receiver Transmitter) are chips on your
  1136.   PC serial card.  Their purpose is to convert data to bits, send the
  1137.   bits down the serial line, and then rebuild the data again on the
  1138.   other end.  UARTs deal with data in byte sized pieces, which is
  1139.   conveniently also the size of ASCII characters.
  1140.  
  1141.   Say you have a terminal hooked up to your PC.  When you type a
  1142.   character, the terminal gives that character to it's transmitter (also
  1143.   a UART of some sort).  The transmitter sends that byte out onto the
  1144.   serial line, one bit at a time, at a specific rate.  On the PC end,
  1145.   the receiving UART takes all the bits and rebuilds the byte and puts
  1146.   it in a buffer.
  1147.  
  1148.   There are two different types of UARTs.  You have probably heard of
  1149.   dumb UARTs - the 8250 and 16450, and FIFO UARTs - the 16550A.  To
  1150.   understand their differences, first let's examine what happens when a
  1151.   UART has sent or received a byte.
  1152.  
  1153.   The UART itself can't do anything with the data, it just sends and
  1154.   receives it.  The CPU gets an interrupt from the serial device every
  1155.   time a byte has been sent or received.  The CPU then moves the
  1156.   received byte out of the UART's buffer and into memory somewhere, or
  1157.   gives the UART another byte to send. The 8250 and 16450 UARTs only
  1158.   have a 1 byte buffer.  That means, that every time 1 byte is sent or
  1159.   received, the CPU is interrupted.  At low rates, this is OK.  But, at
  1160.   high transfer rates, the CPU gets so busy dealing with the UART, that
  1161.   is doesn't have time to tend to other tasks.  In some cases, the CPU
  1162.   does not get around to servicing the interrupt in time, and the byte
  1163.   is overwritten, because they are coming in so fast.
  1164.  
  1165.   That's where the 16550A UARTs are useful.  These chips come with 16
  1166.   byte FIFOs.  This means that it can receive or transmit up to 16 bytes
  1167.   before it has to interrupt the CPU.  Not only can it wait, but the CPU
  1168.   then can transfer all 16 bytes at a time.  Although the interrupt
  1169.   threshold is seldom set at 16, this is still a significant advantage
  1170.   over the other UARTs, which only have the 1 byte buffer.  The CPU
  1171.   receives less interrupts, and is free to do other things.  Data is not
  1172.   lost, and everyone is happy.  (There is also a 16550 UART, but it is
  1173.   treated as a 16450)
  1174.  
  1175.   In general, the 8250 and 16450 UARTs should be fine for speeds up to
  1176.   38400 bps.  At speeds greater than 38400 bps, you might start seeing
  1177.   data loss, and a reduction in interactive response time.  Other PC
  1178.   operating systems (definition used loosely here), like DOS aren't
  1179.   multitasking, so they might be able to cope better with 8250 or
  1180.   16450s.  That's why some people don't see data loss, until they switch
  1181.   to Linux.
  1182.  
  1183.   Non-UART, and intelligent multiport boards use DSP chips to do
  1184.   additional buffering and control, thus relieving the CPU even more.
  1185.   For example, the Cyclades Cyclom, and Stallion EasyIO boards use a
  1186.   Cirrus Logic CD-1400 RISC chip.
  1187.  
  1188.   Keep in mind that these dumb UART types are not bad, they just aren't
  1189.   good for high speeds.  You should have no problem connecting a
  1190.   terminal, or a mouse to these UARTs.  But, for a high speed modem, the
  1191.   16550A is definitely a must.
  1192.  
  1193.   You can buy serial cards with the 16550A UARTs for a little more
  1194.   money, just ask your dealer what type of UART is on the card.  Or if
  1195.   you want to upgrade your existing card, you can simply purchase 16550A
  1196.   chips and replace your existing 16450 UARTs.  They are pin-to-pin
  1197.   compatible.  Some cards come with socketed UARTs for this purpose, if
  1198.   not you can solder.  Note, that you'll probably save yourself a lot of
  1199.   trouble by just getting a new card, if you've got the money, they are
  1200.   under US$ 50.
  1201.  
  1202.   14.4.  /dev/ttySN devices?  What's the real difference between the
  1203.   /dev/cuaN and
  1204.  
  1205.   The only difference is the way that the devices are opened.  The
  1206.   dialin devices /dev/ttySN are opened in blocking mode, until CD is
  1207.   asserted (ie someone connects).  So, when someone wants to use a
  1208.   /dev/cuaN device, there is no conflict with a program watching the
  1209.   /dev/ttySN device.
  1210.  
  1211.   The distinction is made to allow dialin and dialout use of the same
  1212.   serial port.
  1213.  
  1214.   15.  Troubleshooting
  1215.  
  1216.   15.1.  I keep getting ``line NNN of inittab invalid''.
  1217.  
  1218.   Make sure you are using the correct syntax for your version of init.
  1219.   The different init's that are out there use different syntax in the
  1220.   /etc/inittab file.  Make sure you are using the correct syntax for
  1221.   your version of getty.
  1222.  
  1223.   15.2.  When I try to dial out, it says ``/dev/cuaN: Device or resource
  1224.   busy''.
  1225.  
  1226.   This problem can arise when DCD or DTR are not set correctly.  DCD
  1227.   should only be set when there is an actual connection (ie someone is
  1228.   dialed in), not when getty is watching the port.  Check to make sure
  1229.   that your modem is configured to only set DCD when there is a
  1230.   connection.  DTR should be set whenever something is using, or
  1231.   watching the line, like getty, kermit, or some other comm program.
  1232.  
  1233.   Another common cause of ``device busy'' errors, is that you set up
  1234.   your serial port with an interrupt already taken by something else.
  1235.   As each device initializes, it asks Linux for permission to use its
  1236.   hardware interrupt.  Linux keeps track of which interrupt is assigned
  1237.   to whom, and if your interrupt is already taken, your device won't be
  1238.   able to initialize properly.  The device really doesn't have much of
  1239.   any way to tell you that this happened, except that when you try to
  1240.   use it, it will return a ``device-busy'' error.  Check the interrupts
  1241.   on all of your cards (serial, ethernet, SCSI, etc.).  Look for IRQ
  1242.   conflicts.
  1243.  
  1244.   15.3.  I keep getting ``Id SN respawning too fast: disabled for 5 min¡
  1245.   utes''.
  1246.  
  1247.   Make sure your modem is configured correctly.  Look at registers E and
  1248.   Q.  This can occur when your modem is chatting with getty.
  1249.  
  1250.   Make sure you are calling getty correctly from your /etc/inittab.
  1251.   Using the wrong syntax or device names will cause serious problems.
  1252.  
  1253.   This can also happen when the uugetty initialization is failing.  Go
  1254.   to the ``getty or uugetty still doesn't work'' question.
  1255.  
  1256.   15.4.  Serial devices are slow or serial devices can only send in one
  1257.   direction.
  1258.  
  1259.   You probably have an IRQ conflict.  Make sure there are no IRQs being
  1260.   shared.  Check all your cards (serial, ethernet, SCSI, etc...).  Make
  1261.   sure the jumper settings, and the setserial parameters are correct for
  1262.   all your serial devices.
  1263.  
  1264.   15.5.  respawn.  My modem is hosed after someone hangs up, or uugetty
  1265.   doesn't
  1266.  
  1267.   This can happen when your modem doesn't reset when DTR is dropped.  I
  1268.   saw my RD and SD LEDs go nuts when this happened to me.  You need to
  1269.   have your modem reset.  Most Hayes compatible modems do this with &D3,
  1270.   but on my USR Courier, I had to set &D2 and S13=1.  Check your modem
  1271.   manual.
  1272.  
  1273.   15.6.  it just locks up.  I have my terminal connected to my PC, but
  1274.   after I type in a login name,
  1275.  
  1276.   You probably don't have CLOCAL in your /etc/gettydefs entry for the
  1277.   terminal, and you're probably not using a full null modem cable.  You
  1278.   need CLOCAL,  which tells Linux to ignore modem control signals.  Here
  1279.   is what it should look like:
  1280.  
  1281.        # 38400 bps Dumb Terminal entry
  1282.        DT38400# B38400 CS8 CLOCAL # B38400 SANE -ISTRIP CLOCAL #@S @L login: #DT38400
  1283.        # 19200 bps Dumb Terminal entry
  1284.        DT19200# B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S @L login: #DT19200
  1285.        # 9600 bps Dumb Terminal entry
  1286.        DT9600# B9600 CS8 CLOCAL # B9600 SANE -ISTRIP CLOCAL #@S @L login: #DT9600
  1287.  
  1288.   Next, kill the getty process so a new one will be spawned with the new
  1289.   entry.
  1290.  
  1291.   15.7.  At high speeds, my modem loses data.
  1292.  
  1293.   If you are trying to run your modem at > 19200 bps, and you don't have
  1294.   16550A UARTs, you should upgrade them.  See section ``What are
  1295.   UARTs?'' about UARTs.
  1296.  
  1297.   15.8.  them configured.  On startup, Linux doesn't report the serial
  1298.   devices the way I have
  1299.  
  1300.   This is true.  Linux does not do any IRQ detection on startup, it only
  1301.   does serial device detection.  Thus, disregard what it says about the
  1302.   IRQ, because it's just assuming the standard IRQs.  This is done,
  1303.   because IRQ detection is unreliable, and can be fooled.
  1304.  
  1305.   So, even though I have my ttyS2 set at IRQ 5, I still see
  1306.  
  1307.        Jan 23 22:25:28 misfits vmunix: tty02 at 0x03e8 (irq = 4) is a 16550A
  1308.  
  1309.   You have to use setserial to tell Linux the IRQ you are using.
  1310.  
  1311.   15.9.  rz and/or sz don't work when I call my Linux box on my modem.
  1312.  
  1313.   If Linux looks for /dev/modem when you try to transfer files, look at
  1314.   /etc/profile, and /etc/csh.cshrc.  There are a bunch of aliases
  1315.   defined there on some distributions, most notably Slackware.  These
  1316.   aliases mess up the zmodem programs.  Take them out, or correct them.
  1317.  
  1318.   15.10.  My screen is printing funny looking characters.
  1319.  
  1320.   This happens on virtual consoles when you send binary data to your
  1321.   screen, or sometimes on serial connections.  The way to fix this is to
  1322.   type echo ^v^[c.  For the control-character-impaired, thats echo
  1323.   <ctrl>v<esc>c.
  1324.  
  1325.   15.11.  getty or uugetty still doesn't work.
  1326.  
  1327.   There is a DEBUG option that comes with getty_ps.  Edit your config
  1328.   file /etc/conf.{uu}getty.ttySN and add DEBUG=NNN.  Where NNN is one of
  1329.   the following combination of numbers according to what you are trying
  1330.   to debug:
  1331.  
  1332.   D_OPT   001            option settings
  1333.   D_DEF   002            defaults file processing
  1334.   D_UTMP  004            utmp/wtmp processing
  1335.   D_INIT  010            line initialization (INIT)
  1336.   D_GTAB  020            gettytab file processing
  1337.   D_RUN   040            other runtime diagnostics
  1338.   D_RB    100            ringback debugging
  1339.   D_LOCK  200            uugetty lockfile processing
  1340.   D_SCH   400            schedule processing
  1341.   D_ALL   777            everything
  1342.  
  1343.   Setting DEBUG=010 is a good place to start.
  1344.  
  1345.   If you are running syslogd, debugging info will appear in your log
  1346.   files.  If you aren't running syslogd info will appear in
  1347.   /tmp/getty:ttySN for debugging getty and /tmp/uugetty:ttySN for
  1348.   uugetty, and in /var/adm/getty.log.  Look at the debugging info and
  1349.   see what is going on.  Most likely, you will need to tune some of the
  1350.   parameters in your config file, and reconfigure your modem.
  1351.  
  1352.   You could also try mgetty.  Some people have better luck with it.
  1353.  
  1354.   16.  Contributions
  1355.  
  1356.   There was no possible way to write this HOWTO alone.  Although a lot
  1357.   of the HOWTO is my writing, I have rewritten many contributions to
  1358.   maintain continuity in the writing style and flow.  Thanks to everyone
  1359.   who has contributed or commented, the list of people has gotten too
  1360.   long to list (somewhere over fifty).  Special thanks to Ted T'so for
  1361.   answering questions about the serial drivers, Kris Gleason who
  1362.   maintains getty_ps, and Gert Doering who maintains mgetty.
  1363.  
  1364.   END OF Serial-HOWTO
  1365.  
  1366.