home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 13 / CDA13.ISO / DOC / HOWTO / OTHER_FO / SGML / SERIAL_H.GZ / Serial-HOWTO.sgml
Encoding:
SGML Document  |  1996-02-11  |  61.2 KB  |  1,615 lines

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