diff --git a/LDP/howto/linuxdoc/Modem-HOWTO.sgml b/LDP/howto/linuxdoc/Modem-HOWTO.sgml index a6af1046..4fe9f953 100644 --- a/LDP/howto/linuxdoc/Modem-HOWTO.sgml +++ b/LDP/howto/linuxdoc/Modem-HOWTO.sgml @@ -1,17 +1,20 @@
Modem-HOWTO -David S.Lawyer +David S.Lawyer - v0.20, August 2001 + v0.21, August 2001 Help with selecting, connecting, configuring, trouble-shooting, and understanding modems for a PC. See Serial-HOWTO for multiport serial - boards. + boards. Introduction DSL, Cable, and ISDN Modems in other HOWTOs -

This HOWTO covers conventional analog modems for PCs on either -the ISA or PCI bus. For other types of modems: +

This HOWTO covers conventional analog modems for PCs on either +the ISA or PCI bus. There is no coverage of the USB bus but modems on +it should work about the same as described here. For other types of +modems see: DSL modems: see the mini-howto: ADSL @@ -76,8 +81,8 @@ the ISA or PCI bus. For other types of modems: url="http://www.cs.unm.edu/~vuksan/linux/Cable-Modem.html"> Cable-Modem-Providers-HOWTO ISDN Howto (not a LDP Howto) : drivers for ISDN -"Modems". Much related info on this is in German. For a tutorial on +url="http://sdb.suse.de/sdb/en/html/isdn.html">: drivers for ISDN +"Modems". Much related info on this is in German. For a tutorial on ISDN see See also

New versions of this Modem-HOWTO come out every month or two since @@ -165,22 +170,20 @@ modem situation is rapidly changing (and since I'm still learning). Your problem might be solved in the latest version. It will be available to browse and/or download at LDP mirror sites. For a list of such sites see: -If you only want to quickly compare the date of this the version v0.20, August 2001 +If you only want to quickly compare the date of this the version v0.21, August 2001 with the date of the latest version go to: New in Recent Versions

+v0.21 August 2001: clarity re autobauding, corrected linmodem + situation, more mention of USB, major revision of Configuring the + Serial Port now named: Locating ... v0.20 August 2001: fixed typo: done->down, more linmodems -v0.19 July 2001: Dialing Out while Waiting for a Call. Antique modems +v0.19 July 2001: Dialing Out while Waiting for a Call. Antique modems using "CONNECT" to set DTE speed. v0.18 June 2001 new section: modem doubling (bonding, teaming, - multilink) -v0.17 April 2001 isapnp to pnpdump (with "dumpregs" option) -v0.16 March 2001 New url for winmodem.html, more obsolete protocols -v0.15 March 2001 Revision of Dial-In section (incl. problems with -agetty, interoperability with MS, VNC), blacklist, AT-cmds on Internet, -broken links fixed + multilink) What is a Modem ?

A modem is a device that lets one send digital signals over an @@ -193,35 +196,33 @@ telephone line. Advanced modem users can set things up so that others may phone in to them and use their computer. This is called "dial-in". -There are three basic types of modems for a PC: external, internal, -and built-in. The external sets on your desk outside the PC while the -other two types are not visible since they're inside the PC. The -external modem plugs into a connector on the back of the PC known as a -"serial port". The internal modem is a card that is inserted inside -the computer. The built-in modem is part of the motherboard and is -thus built into the computer. It's is just like an internal modem -except it can't be removed or replaced. As of 2001, built-in modems -are primarily for laptops. What is said in this HOWTO regarding -internal modems will generally apply also to built-in modems. +There are four basic types of modems for a PC: external, USB, internal +and built-in. The external and USB set on your desk outside the PC +while the other two types are not visible since they're inside the PC. +The external modem plugs into a connector on the back of the PC known +as a "serial port". The USB modem plugs into the USB bus cable. The +internal modem is a card that is inserted inside the computer. The +built-in modem is part of the motherboard and is thus built into the +computer. It's is just like an internal modem except it can't be +removed or replaced. As of 2001, built-in modems are primarily for +laptops. What is said in this HOWTO regarding internal modems will +generally apply also to built-in modems. For a more detailed comparison see . When you get an internal (or built-in) modem, you -also get a dedicated serial port (which can only be used with the +vs. Internal">. When you get an internal, built-in, or USB modem, +you also get a dedicated serial port (which can only be used with the modem and not with anything else such as another modem or a printer). In Linux, the serial ports are named ttyS0, ttyS1, etc. (usually -corresponding respectively to COM1, COM2, etc. in Dos/Windows). - -The serial port is not to be confused with the "Universal Serial Bus" -(USB) which uses a special modular connector and may be used to -connect an external modem. See for more details on modems and serial ports. +corresponding respectively to COM1, COM2, etc. in Dos/Windows). See + for more details +on modems and serial ports. Modems usually include the ability to send Faxes (Fax Modems). See for a list of fax software. "Voice" modems can work like an automatic answering machine and handle voicemail. See . - Quick Install + Quick Install

With a straight-thru or modem cable, connect the modem to an unused serial port on the PC. Make sure you know the name of the @@ -236,7 +237,7 @@ under Linux since (as of 2001) many modems don't. See . If the modem is both PnP and directly supported by the serial driver (kernel 2.4 +) then there is no configuring for you to do since the -driver will configure it. +driver will configure it. To physically install a modem card, remove the cover of the PC by removing some screws (perhaps screw size 6-32 in the U.S.). Find a @@ -246,7 +247,7 @@ of the PC so that the telephone jacks on the card will be accessible from the rear of the PC. Then carefully align the card with the slot and push the card all the way down into the slot. Attach the card with a mounting screw (usually 3mm, .5mm pitch --don't use the wrong -size). +size). If you have a modem that is not a winmodem (see ) the serial driver may @@ -261,6 +262,7 @@ problem of setting an IRQ number and IO address. For PnP modems: If the BIOS has already set these in the physical device (which a PnP BIOS will do if it thinks you don't have a PnP OS) then you need to determine the IRQ and IO address and then tell this to "setserial". + In other cases you may have some choice of IRQs and IO addresses (including the case where you are able to change what the BIOS has set). See and PCI (and AMR) Modems: What IOs and IRQs have been set? -

For PCI, the BIOS almost always sets the IRQ and may set the IO -address as well. To see how it's set use "lspci -v" (best) or look in -/proc/bus/pci. The modem's serial port is called a "Communication -controller". If more than one IO address is shown, the first one is -more likely to be it. You can't change the IRQ (at least not with -"setpci") If you must, change the IO address with "setpci" by -changing the BASE_ADDRESS_0 or the like. The _0 (or _1) after -BASE_ADDRESS must be the correct register. Both PCI and ISA: Use setserial to tell the driver

You must find the file where "setserial" is run at boot-time and @@ -297,28 +290,28 @@ id="all_modems" name="All Modems"> for further instructions on quick installation. Use MS Windows to set the BIOS (A last resort method) -

If you are using the BIOS to configure you may use MS Windows9x to -"force" the BIOS to set a certain IRQ and/or IO. It can set them into -the PnP BIOS's flash memory where they will be used to configure for -Linux as well as Windows. See "Plug-and-Play-HOWTO and search for -"forced" (occurs in several places). For Windows3.x you can do the -same thing using the ICU under Windows 3.x. A few modems have a way -to disable PnP in the modem hardware using software (under Windows) -that came with the modem. +

If you are using the BIOS to configure you may attempt to use MS +Windows9x to "force" the BIOS to set a certain IRQ and/or IO. It can +set them into the PnP BIOS's flash memory where they will be used to +configure for Linux as well as Windows. See "Plug-and-Play-HOWTO and +search for "forced" (occurs in several places). For Windows3.x you +can do the same thing using the ICU under Windows 3.x. A few modems +have a way to disable PnP in the modem hardware using software (under +Windows) that came with the modem. - All Modems

Plug the modem into a telephone line. Then configure a + All Modems

Plug the modem into a telephone line. Then configure a communication program such as minicom or a ppp program (such as wvdial). Set the serial port speed to a baud rate a few times higher than the bit rate of your modem. See for more details on the "best" speeds to use. Tell it the full name of your serial port such as /dev/ttyS1. Set -hardware flow control (RTS/CTS). +hardware flow control (RTS/CTS). Minicom is the easiest to set up and to use to test your modem. But if you are lucky you may get ppp to work the first time and not need to bother with minicom. With minicom you may check to see if your -modem is there (and ready to dial). Once you've set up minicom, +modem is there (and ready to dial): Once you've set up minicom, type the command: AT, hit enter and you should see an "OK" response which comes direct from the modem. @@ -329,14 +322,16 @@ internal one is installed inside of your PC (you must remove screws, etc. to install it) and the external one just plugs into a serial port connector on a PC. Internal modems are less expensive, are less likely to to suffer data loss due to buffer overrun, usually use less -electricity, and use up no space on your desk. +electricity, and use up no space on your desk. External modems are usually easier to install and usually require less configuration. They have lights which may give you a clue as to what is happening and aid in troubleshooting. The fact that the serial port and modem can be physically separated also aids in troubleshooting. External modems are easy to move to another -computer. +computer. If you need to turn the power off to reset your modem (this +is seldom necessary) then with an external you don't have to power +down the entire PC. Unfortunately most external modems have no switch to turn off the power supply when not in use and thus are likely to consume a little @@ -344,9 +339,9 @@ electricity even when turned off (unless you unplug the power supply from the wall). Each watt they draw usually costs you over $1/yr. Another possible disadvantage of an external is that you will be forced to use an existing serial port which may not support a speed of -over 115,200 bps (although as of late 1998 and late 2000 most new -internal modems don't either --but some do). If a new internal modem -had say a 16650 UART it would put less load on the CPU. +over 115,200 bps (although as of late 2000 most new internal modems +don't either --but some do). For details Internal modems present a special problem for Linux, but will work just as well as external modems provided you avoid the ones that will @@ -363,7 +358,7 @@ While most new modems are plug-and-play you have various ways to deal with the PnP configuring: The serial driver does it all for you (more likely for a PCI modem) - Use the "isapnp" program + Use the "isapnp" program Let a PnP BIOS do the configuring The last 2 items of the above have shortcomings. Isapnp documentation @@ -374,30 +369,29 @@ you don't have a PnP operating system. But it may not do it correctly and you may need to find out what it's done see . -In the late 1990s many Linux users said that it's a lot simpler just -to get an external modem and plug it in. But if you get the right -internal modem it may be just as easy. +Many Linux users still say that it's a lot simpler just to get an +external modem and plug it in. But if you get the right internal +modem it may be just as easy. External Modems PnP External Modems

Many external modems are labeled "Plug and Play" (PnP) but they should all work fine as non-PnP modems. While the serial port itself may need to be configured (IRQ number and IO address) unless the -default configuration is OK an external modem uses no such IRQ/IO +default configuration is OK, an external modem uses no such IRQ/IO configuration. You just plug the modem into the serial port. -Since you usually plug the modem into a serial port (and connect it to -power). How can an external modem be called PnP since it can't be configured by PnP? Well, it has a special PnP identification built into it that can be read (thru the serial port) by a PnP operating system. Such an operating system would then know that you have a modem on a certain -port and would also know the id number. Then you might not need to -configure application programs by telling them what port the modem is -on (such as /dev/ttyS2 or COM3). But since you don't have such a PnP -operating system you may need to configure your application program -manually by giving it the /dev id (such as /dev/ttyS2). Some programs -can probe for a modem on various ports. +port and would also know the id number. If it's a software modem, it +could try to locate a driver for it. It could also tell application +programs what port your modem is on. (such as /dev/ttyS2 or COM3). +But since you don't have such a PnP operating system you may need to +configure your application program manually by giving it the /dev id +(such as /dev/ttyS2). Some programs can probe for a modem on various +ports. Cabling & Installation

Connecting an external modem is simple compared to connecting @@ -408,12 +402,12 @@ stores should have this. Make sure you get the correct gender and number of pins. Hook up your modem to one of your serial ports. If you are willing to accept the default IRQ and IO address of the port you connect it to, then you are ready to start your communication -program and configure the modem itself. +program and configure the modem itself. What the Lights (LED's) Mean (for some external modems)

- TM Test Modem + TM Test Modem AA Auto Answer (If on, your modem will answer an incoming call) RD Receive Data line = RxD SD Send Data line = TxD @@ -429,11 +423,13 @@ program and configure the modem itself. Internal Modems

An internal modem is installed in a PC by taking off the cover of the PC and inserting the modem card into a vacant slot on the -motherboard. There are modems for the ISA slots and others for the -PCI slots. Some new PC don't have any ISA slots. While external -modems plug into the serial port (via a short cable) the internal -modems have the serial port built into the modem. In other words, the -modem card is both a serial port and a modem. +motherboard. There are modems for PCI slots, other modems for the +older ISA slots, and ARM software "modems" for the new small AMR slot. +Some new PC don't have any ISA slots. Only some newer PCs will have +ARM slots. While external modems plug into the serial port (via a +short cable) the internal modems have the serial port built into the +modem. In other words, the modem card is both a serial port and a +modem. Setting the IO address and IRQ for a serial port was formerly done by jumpers on the card. These are little black rectangular "cubes" about @@ -442,17 +438,22 @@ modems (actually the serial port part of the modems) don't use jumpers for setting these but instead are configured by sending configuration commands to them over the bus inside the computer. Such configuration commands can be sent by a PnP BIOS, by the isapnp program (for the ISA -bus only), or by newer serial device drivers for certain modems. -Under Linux you may have a choice of how to configure the ones that -don't get io-irq configured by the serial driver. +bus only), by setpci (for the PCI bus), or by newer serial device +drivers for certain modems. Under Linux you may have a choice of how +to configure the ones that don't get io-irq configured by the serial +driver. - -ISA bus modems: Use "isapnp" which may be run automatically at - every boot-time + +ISA bus: Use "isapnp" which may be run automatically at + every boot-time Let a PnP BIOS do it, and then maybe tell setserial the IO and IRQ +PCI bus: Use lspci -vv to look at it and setpci to configure. +See for more details, +especially for the PCI bus. + Software-based Modems (winmodems, linmodems)

Finally in late 1999 two software-based modems appeared that could -work under Linux and were sometimes called "linmodems". Lucent -Technologies (LT) unofficially released a Linux binary-only code to -support most of its PCI modems. PC-TEL (includes "Zoltrix") -introduced a new software-based modem for Linux. There is a GPL'ed -driver for Intel's (Modem Silicon Operations) MD563x HaM chipset (nee -Ambient division of Cirrus Logic). Will other companies follow these -leads and thus create "linmodems"? Yes. As of mid-2001 there are -drivers for: Conexant HSF, Motorola SM56, ESS (ISA only), and IBM's -Mwave for Thinkpads 600+. +

In late 1999, two software-based modems appeared that could work +under Linux and were thus called "linmodems". Lucent Technologies +(LT) unofficially released a Linux binary-only code to support most of +its PCI modems. PC-TEL (includes "Zoltrix") introduced a new +software-based modem for Linux. After that interest in getting +winmodems to work under linux expanded. There is a GPL'ed driver for +Intel's (Modem Silicon Operations) MD563x HaM chipset (nee Ambient +division of Cirrus Logic). As of mid-2001 there are drivers for: +Conexant HSF, Motorola SM56, ESS (ISA only), and IBM's Mwave for +Thinkpads 600+. What percent of winmodems now (2001) work under Linux? Well, there's a lot of modem chips not supported: Lucent/Agere ARM (Scorpio), 3COM/US Robotics, Conexant HCF, some SmartLink (3 different chipsets), -Ambient HSP, and possibly others. But there may be some support for -these by the time you read this. So over half the chips seem to be -supported. But what percentages of such chips sold will work with -Linux? I'm guessing it's somewhat over 50%. Let me know if you find -an estimate. +Ambient HSP, and possibly others. But there might be support for some +of these by the time you read this. So it seems that over half the +chips are now supported (as of late 2001). For a list of modems which work/don't_work under Linux see . @@ -506,23 +507,19 @@ Be warned in advance that determining if your modem is a linmodem may or may not be easy. You may need to first find out what chipset you have and who makes it. Just knowing the brand and model number of your modem may not be sufficient. There are complex ways to find this -out using say "lspci" (more than once) and then looking up chip maker -using the long modem number. This requires checking a database or -searching the Internet. It's not always simple. It could happen that -you will put a fair amount of effort into this only to get the bad -news that your modem isn't supported. +out using say "lspci" (more than once) and then looking up the chip +maker using the long modem number. This requires checking a database +or searching the Internet. It's not always simple. It could happen +that you will put a fair amount of effort into this only to get the +bad news that your modem isn't supported. See Winmodem-HOWTO for more +details. -There is some effort underway at reverse-engineering with at least one -report of a winmodem that has been made to work under Linux (but not -yet with full functionality). So by the time you read this there may -be more linmodems. - -For details of how to get some winmodems to work under Linux see the -Linmodem-HOWTO (and/or Winmodems-and-Linux-HOWTO which is not as well -written). If code is made available to operate a "winmodem" under -Linux, then one may call it a "linmodem". Is it still a "winmodem"? -Well, it's still a software-based modem. The term "Winmodem" is also -a trademark for a certain model of "winmodem". +For details of how to get some software modems (winmodems) to work +under Linux see the Linmodem-HOWTO (and/or Winmodems-and-Linux-HOWTO +which is not as well written). If code is made available to operate a +"winmodem" under Linux, then one may call it a "linmodem". Is it +still a "winmodem"? Well, it's still a software-based modem. The +term "Winmodem" is also a trademark for a certain model of "winmodem". Software-based modem types

There are two basic types of software modems. In one type the @@ -531,7 +528,7 @@ only does the "control" operations (which is everything except processing the digital waveshapes --to be explained later). Since the hardware doesn't do the control it's called a "controllerless" modem. The first type is an all-software modem (sometimes just called a -software modem). +software modem). For both of these types there must be analog hardware in the modem to generate an electrical waveshape to send out the phone line. It's @@ -556,12 +553,13 @@ tasks could be ported to Linux and then there wouldn't be a major problem. Is this modem a software modem? -

How do you determine if an internal modem will work under Linux? +

How do you determine if an internal modem is a software modem? First see if the name, description of it, or even the name of the MS Windows driver for it indicates it's a software modem: HSP, HCF, HSF, controllerless, host-controlled, host-based, and soft-... modem. If -it's one of these modem it will only work for the few cases (so far) -where a Linux driver is available. +it's one of these modem it will only work for the cases where a Linux +driver is available. Since software modems cost less, a low price is +a clue that it's a software modem. If you don't know the model of the modem and you also have Windows on your Linux PC, click on the "Modem" icon in the "Control Panel". Then @@ -569,7 +567,7 @@ check out the modem list (see . If the above doesn't work (or isn't feasible), you can look at the package it came in (or a manual) find the section on the package that says something like "Minimum System Requirements" or just "System -Requirements". It may be in fine print. Read it closely. +Requirements". It may be in fine print. Read it closely. If it requires a Pentium CPU, then almost all of it's work is done by software and it's not likely to work under Linux. If it requires a @@ -578,15 +576,15 @@ work only if there exists a Linux driver for it. Saying that it only works with Windows is also bad news. However, even in this case there may be a Linux driver for it. -Otherwise, it may work under Linux (without a driver) if it fails to -state explicitly that you must have Windows. By saying it's "designed -for Windows" it may only mean that it fully supports Microsoft's -plug-and-play which is OK since Linux uses the same plug-and-play -specs (but it's harder to configure under Linux). Being "designed for -Windows" thus gives no clue as to whether or not it will work under -Linux. You might check the Website of the manufacturer or inquire via -email. Some manufacturers are specifically stating that certain -models work under Linux. +Otherwise, it may be a hardware modem if it fails to state explicitly +that you must have Windows. By saying it's "designed for Windows" it +may only mean that it fully supports Microsoft's plug-and-play which +is OK since Linux uses the same plug-and-play specs (but it's harder +to configure under Linux). Being "designed for Windows" thus gives no +clue as to whether or not it will work under Linux. You might check +the Website of the manufacturer or inquire via email. Some +manufacturers are specifically stating that certain models work under +Linux. Should I get a software modem?

Only if you know there is a Linux driver for it that works OK. @@ -610,11 +608,11 @@ intensive tasks when the modem is in use. The savings in modem cost could be used for a better CPU which would speed things up a little. But the on-board electronics of a modem can do the job more efficiently than a general purpose CPU (except that it's not efficient -when it's not in use). So if you use the modem a lot it's probably -better to avoid software modems (and then you can use a less powerful -CPU :-). +at all when it's not in use). So if you use the modem a lot it's +probably better to avoid all-software modems (and then you can use a +less powerful CPU :-). - PCI Modems

A PCI modem card is one which inserts into a PCI-bus slot on the motherboard of a PC. While many PCI winmodems will not work under Linux (no driver available) other PCI modems will work under Linux. @@ -636,50 +634,50 @@ into the analog wave itself (and conversely). Linux supports at least one of them. Which Internal Modems might not work with Linux

- +

+ Only roughly half have a Linux driver available. - might work, but only if + might work, but only if you first start Windows/Dos each time you power on your PC - Modems with drivers work + Modems with drivers work but with reduced performance - MWave and DSP Modems

Note that there's now a Linux driver for the ACP (Mwave) modem used in IBM Thinkpads 600+. See the mini-HOWTO: ACP-Modem. -Such modems use DSPs (Digital Signal Processors) which are programmed -by driver which must be downloaded from the hard disk to the DSPs -memory just before using the modem. Unfortunately, such downloading -is normally done by Dos/Windows programs (which doesn't work for -Linux). But there has been substantial success in getting some of -these modems to work with Linux. For example, there is a Linux driver -available to run a Lucent (DSP) modem. +While hardware modems used use DSPs (Digital Signal Processors) some +of these DSPs are programmed by a driver which must be downloaded from +the hard disk to the DSPs memory just before using the modem. +Unfortunately, such downloading is normally done by Dos/Windows +programs (which doesn't work for Linux). But there has been +substantial success in getting some of these modems to work with +Linux. For example, there is a Linux driver available to run a Lucent +(DSP) modem. Ordinary modems that work fine with Linux (without needing a driver for the modem) often have a DSP too (and may mention this on the packaging), but the program that runs the DSP is stored inside the -modem. This is not a "DSP modem" in the sense of this section. An -example of a DSP modem is the old IBM's Aptiva MWAVE. +modem. These work fine under Linux. An example of a DSP modem that +has problems working under Linux is the old IBM's Aptiva MWAVE. -If a DSP modem modem simulates a serial port, then it may be usable -with Linux provided you're willing/able to boot from DOS. You must -have Dos/Windows on the same PC. You first install the driver under +One way to get some DSP modems to work with Linux is to boot from DOS +(if you have it on your Linux PC). You first install the driver under DOS (using DOS and not Window drivers). Then start Dos/Windows and start the driver for the modem so as to program the DSP. Then without -turning off the computer, go into Linux. +turning off the computer, start Linux. One may write a "batch" file (actually a script) to do this. Here is an example but you must modify it to suit your situation. - + rem mwave is a batch file supplied by the modem maker call c:\mww\dll\mwave start rem loadlin.exe is a DOS program that will boot Linux from DOS (See -rem Config-HOWTO). +rem Config-HOWTO). c:\linux\loadlin f:\vmlinuz root=/dev/hda3 ro - + One may create an icon for the Window's desktop which points to such a batch file and set the icon properties to "Run in MSDOS Mode". Then @@ -696,24 +694,26 @@ url="http://maalox.pharmacy.ohio-state.edu/~ejolson/linux/newcom.html">. Rockwell (RPI) Drivers

Some older Rockwell chips need Rockwell RPI (Rockwell -Protocol Interface) drivers. They can still be used with Linux even -though the driver software works only under MS Windows. This is -because the MS Windows software which you don't have does only -compression and error correction. If you are willing to operate the -modem without compression and error correction then it's feasible to -use it with Linux. To do this you will need to disable RPI by sending -the modem (via the initialization string) a "RPI disable" command each -time you power on your modem. On my modem this command was +H0. Not -having data compression available makes it slower to get webpages but -is just as fast when downloading files that are already compressed. +Protocol Interface) drivers for compression and error correction. +They can still be used with Linux even though the driver software +works only under MS Windows. This is because the MS Windows software +(which you don't have) does only compression and error correction. If +you are willing to operate the modem without compression and error +correction then it's feasible to use it with Linux. To do this you +will need to disable RPI by sending the modem (via the initialization +string) a "RPI disable" command each time you power on your modem. On +my old modem this command was +H0. Not having data compression +available makes it slower to get webpages but is just as fast when +downloading files that are already compressed. Modem Pools, Digital Modems - -

A modem pool is a number of modems on the same card (such as a -multiport modem card) or many modems in an external chassis (something -like an external modem). The modems may be analog modems similar to -modems used for home/office PCs (can't send at 56k even if they are -"56k modems"). They also could be "digital modems" which can send at + Introduction +

These are multiple modems that an ISP or the like might use. A +modem pool is a number of modems on the same card (such as a multiport +modem card) or many modems in an external chassis (something like an +external modem). The modems may be analog modems similar to modems +used for home/office PCs (can't send at 56k even if they are "56k +modems"). They also could be "digital modems" which can send at nearly 56k (if you have a good line). The "digital modems" require a digital connection to the telephone line and don't use any serial ports at all. All of these modem pools will require that you install @@ -721,32 +721,32 @@ special drivers for them. Analog Modem Pools, Multiport Modem Cards -

These are just many analog modems (the common -home/office modem) provided either on a plug-in card or in an external -chassis. Each modem comes with a built-in serial port. There is -usually a system of sharing interrupts or of handling interrupts by -their own electronics, thus removing much of this burden from the CPU. -Note that these modems are not "digital modems" and will thus not be -able to use 56k for people who dial-in. +

These are just many analog modems (the common home/office modem) +provided either on a plug-in card or in an external chassis. Each +modem comes with a built-in serial port. There is usually a system of +sharing interrupts or of handling interrupts by their own electronics, +thus removing much of this burden from the CPU. Note that these +modems are not "digital modems" and will thus not be able to use 56k +for people who dial-in. Here is a list of some companies that make multiport modem cards. 8 modems/card is common. The cards listed claim to work with Linux and -the websites should point you to a driver for them. +the websites should point you to a driver for them. Multiport Modem Cards: - MultiModemISI by Multi-Tech Systems. 56k or 33.6k, PCI or ISA, - 4 or 8 ports. ISDN/56k hybrids. + MultiModemISI by Multi-Tech Systems. 56k or 33.6k, PCI or ISA, + 4 or 8 ports. ISDN/56k hybrids. RAStel by Moreton Bay Products. 56k PCI or ISA, 4 or 8 ports. -Also 2 modems + 2 vacant serial ports. +Also 2 modems + 2 vacant serial ports. RocketModem by Comtrol. ISA 33.6k, 4 or 8 port. - AccelePort (RAS Family) by Digi. + AccelePort (RAS Family) by Digi. @@ -766,7 +766,7 @@ telephone calls. It's done by "time-division multiplexing". So the first task to be done is to separate the phone calls and send each phone call to its own "digital modem". There is also the task in the reverse direction of combining all of the calls onto a single line. -These tasks are done by what is sometimes called a "... concentrator". +These tasks are done by what is sometimes called a "... concentrator". The digital modem gets the digital signal from the telephone company. It converts the waveshape it represents back to the same data bytes @@ -788,60 +788,25 @@ interface card, or just a card itself. Digi calls one such card a description of what is needed to become an ISP is: See . Cyclades promotes their own -products here so please do comparison shopping before buying anything. +products here so please do comparison shopping before buying anything. Serial Port and Modem Basics

You don't have to understand the basics to use and install a -modem. But understanding it may help to determine what is wrong if -you run into problems. After reading this section, if you want to -understand it even better you may want to see in this document (not yet -complete). More details on the serial port (including much of this -section) will be found in Serial-HOWTO. - Modem Converts Digital to Analog (and conversely) -

Most all telephone main lines are digital already but the lines -leading to your house (or business) are usually analog which means -that they were designed to transmit a voltage wave which is an exact -replica of the sound wave coming out of your mouth. Such a voltage -wave is called "analog". If viewed on an oscilloscope it looks like a -sine wave of varying frequency and amplitude. A digital signal is -like a square wave. For example 3 v (volts) might be a 1-bit and 0 v -could be a 0-bit. For most serial ports (used by external modems) +12 -v is a 0-bit and -12 v is a 1-bit (some are + or - 5 v). - -To send data from your computer over the phone line, the modem takes -the digital signal from your computer and converts it to "analog". It -does this by both creating an analog sine wave and then "MODulating" -it. Since the result still represents digital data, it could also be -called a digital signal instead of analog. But it looks something -like an analog signal and almost everyone calls it analog. At the -other end of the phone line another modem "DEModulates" this signal -and the pure digital signal is recovered. Put together the "mod" and -"dem" parts of the two words above and you get "modem" (if you drop -one of the two d's). A "modem" is thus a MODulator-DEModulator. Just -what modulation is may be found in the section . - What is a Serial Port ? Intro to Serial -

The serial port is an I/O (Input/Output) device. - -Since modems have a serial port between them and the computer, -it's necessary to understand the serial port as well as the modem. - +

The serial port is an I/O (Input/Output) device. + Most PC's have one or two serial ports. Each has a 9-pin connector (sometimes 25-pin) on the back of the computer. Computer programs can @@ -860,8 +825,8 @@ transmit pin (and conversely). Most of the electronics of the serial port is found in a computer chip (or a part of a chip) known as a UART. For more details on UARTs -see the section - "What are UARTS" in the Serial-HOWTO. +see the section + But you may want to finish this section first so that you will hopefully understand how the UART fits into the overall scheme of @@ -892,22 +857,7 @@ a connection has been made or that the telephone line is ringing (someone is attempting to call in). See the Serial-HOWTO: Pinout and Signals for more details. - - Internal Modem Contains Serial Port -

For an internal modem there is no 9-pin connector but the behavior -is almost exactly as if the above mentioned cable wires existed. -Instead of a a 12 volt signal in a wire giving the state of a modem -control line, the internal modem may just use a status bit in its own -memory (a register) to determine the state of this non-existent -"wire". The internal modem's serial port looks just like a real -serial port to the computer. It even includes the speed limits that -one may set at ordinary serial ports such as 115200 bits/sec. -Unfortunately for Linux, many internal modems today don't work exactly -this way but instead use software (running on the CPU) to do much of -the modem's work. Unfortunately, such software is often only -available for the MS Windows OS (it hasn't been ported to Linux). -Thus you can't use most of these modems with Linux See . + @@ -956,12 +906,8 @@ ttyS2) and thus it can't be used. See for more details> Interrupts

- -Bytes come in over the phone line to the modem, are converted from -analog to digital by the modem and passed along to the serial port on -their way to their destination inside your computer. - +

+ When the serial port receives a number of bytes (may be set to 1, 4, 8, or 14) into its FIFO buffer, it signals the CPU to fetch them by sending an electrical signal known as an interrupt on a certain wire @@ -989,16 +935,8 @@ hold only 16 (1 in old serial ports) incoming bytes. If the CPU fails to remove such received bytes promptly, then there will not be any space left for any more incoming bytes and the small buffer may overflow (overrun) resulting in a loss of data bytes. - - -For an external modem, there is no way (such as flow control) to stop -the flow rapidly enough to prevent this. For an internal modem the -16-byte FIFO buffer is on the same card and a good modem will not -write to it if it's full. Thus a good internal modem will not overrun -the 16-byte buffers but it may need to use to prevent the modem itself from -being overrun. This is one advantage of an internal modem over an -external. +There is no to prevent +this. Interrupts are also issued when the serial port has just sent out all 16 of its bytes from its small transmit buffer out the external cable. @@ -1013,8 +951,8 @@ also has large buffers in main memory. This will be explained later Interrupts convey a lot of information but only indirectly. The interrupt itself just tells a chip called the interrupt controller that a certain serial port needs attention. The interrupt controller -then signals the CPU. The CPU runs a special program to service the -serial port. That program is called an interrupt service routine +then signals the CPU. The CPU then runs a special program to service +the serial port. That program is called an interrupt service routine (part of the serial driver software). It tries to find out what has happened at the serial port and then deals with the problem such a transferring bytes from (or to) the serial port's hardware buffer. @@ -1024,96 +962,9 @@ software. These registers contain status information about the serial port. The software reads these registers and by inspecting the contents, finds out what has happened and takes appropriate action. - - Data Compression (by the Modem) -

Before continuing with the basics of the serial port, one needs to -understand about something done by the modem: data compression. In -some cases this task is actually done by software run on the -computer's CPU but unfortunately at present, such software only works -for MS Windows. The discussion here will be for the case where the -modem itself does the compression since this is what must happen in -order for the modem to work under Linux. -In order to send data faster over the phone line, one may compress -(encode it) using a custom encoding scheme which itself depends on the -data. The encoded data is smaller than the original (less bytes) and -can be sent over the Internet in less time. This process is called -"data compression". -If you download files from the Internet, they are likely already -compressed and it is not feasible for the modem to try to compress -them further. Your modem may sense that what is passing thru has -already been compressed and refrain from trying a compress it any -more. If you are receiving data which has been compressed by the -other modem, your modem will decompress it and create many more bytes -than were sent over the phone line. Thus the flow of data from your -modem into your computer will be higher than the flow over the phone -line to you. The ratio of this flow is called the compression ratio. -Compression ratios as high as 4 are possible, but not very likely. - Error Correction -

Similar to data compression, modems may be set to do error -correction. While there is some overhead cost involved which slows -down the byte/sec flow rate, the fact that error correction strips off -start and stop bits actually increases the data byte/sec flow rate. - -For the serial port's interface with the external world, each 8-bit -byte has 2 extra bits added to it: a start-bit and a stop-bit. -Without error correction, these extra start and stop bits usually go -right thru the modem and out over the phone lines. But when error -correction is enabled, these extra bits are stripped off and the 8-bit -bytes are put into packets. This is more efficient and results in -higher byte/sec flow in spite of the fact that there are a few more -bytes added for packet headers and error correction purposes. - - - - Data Flow (Speeds) -

Data (bytes representing letters, pictures, etc.) flows from your -computer to your modem and then out on the telephone line (and -conversely). Flow rates (such as 56k (56000) bits/sec) are -(incorrectly) called "speed". But almost everyone says "speed" -instead of "flow rate". If there were no data compression the flow -rate from the computer to the modem would be about the same as the -flow rate over the telephone line. - -Actually there are two different speeds to consider at your end of the -phone line: - - - The speed on the phone line itself (DCE speed) modem-to-modem - The speed from your computer's serial port to your modem (DTE speed) - - -When you dial out and connect to another modem on the other end of the -phone line, your modem often sends you a message like "CONNECT 28800" -or "CONNECT 115200". What do these mean? Well, its either the DCE -speed or the DTE speed. If it's higher than the advertised modem speed -it must be the DTE modem-to-computer speed. This is the case for the -115200 speed shown above. The 28800 must be a DCE (modem-to-modem) -speed since the serial port has no such speed. One may configure the -modem to report either speed. Some modems report both speeds and -report the modem-to-modem speed as (for example): CARRIER 28800. - -If you have an internal modem you would not expect that there would be -any speed limit on the DTE speed from your modem to your computer -since you modem is inside your computer and is almost part of your -computer. But there is since the modem contains a dedicated serial -port within it. - -It's important to understand that the average speed is often less than -the specified speed, especially on the short DTE computer-to-modem -line. Waits (or idle time) result in a lower average speed. These -waits may include long waits of perhaps a second due to . At the other extreme there -may be very short waits (idle time) of several micro-seconds -separating the end of one byte and the start of the next byte. In -addition, modems will fallback to lower speeds if the telephone line -conditions are less than pristine. - -For a discussion of what DTE speed is best to use see section . - @@ -1121,9 +972,9 @@ id="speed_" name="What Speed Should I Use">.

Flow control means the ability to slow down the flow of bytes in a wire. For serial ports this means the ability to stop and then restart the flow without any loss of bytes. Flow control is needed -for modems to allow a jump in instantaneous flow rates. +for modems to allow a jump in instantaneous flow rates. - Example of Flow Control + Example of Flow Control

For example, consider the case where you connect a 36.6k external modem via a short cable to your serial port. The modem sends and receives bytes over the phone line at 36.6k bits per second (bps). @@ -1135,7 +986,7 @@ However the flow from your modem out the phone line is only 33.6k bps. Since a faster flow (115.2k) is going into your modem than is coming out of it, the modem is storing the excess flow (115.2k -33.6k = 81.6k bps) in one of its buffers. This buffer would soon overrun (run out -of free storage space) unless the high 115.2k flow is stopped. +of free storage space) unless the high 115.2k flow is stopped. But now flow control comes to the rescue. When the modem's buffer is almost full, the modem sends a stop signal to the serial port. The @@ -1185,27 +1036,15 @@ bytes. All the 3 buffers use the FIFO rule but only one of them also uses it as a name. This is the essence of flow control but there are still some more details. - -You don't often need flow control in the direction from the modem to a -PC. For complex example of a case where it's needed see "Complex Flow -Control Example" in the Serial-HOWTO. But if you don't have a high -enough speed set between the modem and the computer (serial port -speed) then you do need to slow down the flow coming into the modem -from the telephone line. To do this your modem must tell the other -modem to stop sending. See . - + Hardware vs. Software Flow Control

If feasible it's best to use "hardware" flow control that uses two dedicated "modem control" wires to send the "stop" and "start" -signals. - -Modern modems almost always use hardware flow control between the -modem and the serial port. - +signals. + Software flow control uses the main receive and transmit wires to send the start and stop signals. It uses the ASCII control characters DC1 @@ -1215,36 +1054,8 @@ in reacting but also does not allow the sending of binary data unless special precautions are taken. Since binary data will likely contain DC1 and DC3, special means must be taken to distinguish between a DC3 that means a flow control stop and a DC3 that is part of the binary -code. Likewise for DC1. - -To get software flow control to work for binary data requires both -modem (hardware) and software support +code. Likewise for DC1. - Symptoms of No Flow Control -

Understanding flow-control theory can be of practical use. For -example I used my modem to access the Internet and it seemed to work -fine. But after a few months I tried to send long files from my PC to -an ISP and a huge amount of retries and errors resulted (but -eventually Kermit could send a long file after many retries). -Receiving in the other direction (from my ISP to me) worked fine. The -problem turned out to be a modem with broken flow control. My modem's -buffer was overflowing (overrunning) on long outgoing files since no -"stop" signal was ever sent to the computer to halt sending to the -modem. There was no problem in the direction from the modem to my -computer since the capacity (say 115.2k) was always higher than the -flow over the telephone line. The fix was to enable flow control by -putting into the init string an enable-flow-control command for the -modem. (It should have been enabled by default but something was -wrong). - - Modem-to-Modem Flow Control

This is the flow control of the data sent over the telephone lines -between two modems. Practically speaking, it only exists when you -have error correction enabled. Actually, even without error -correction it's possible to enable software flow control between -modems but it may interfere with sending binary data so it's not often -used. - Data Flow Path; Buffers

Much has been explained about this including flow @@ -1252,8 +1063,8 @@ control, a pair of 16-byte FIFO buffers (in the UART), and a pair of larger buffers inside a device connected to the serial port (such as a modem. But there is still another pair of buffers. These are large buffers (perhaps 8k) in main memory also known as serial port buffers. -When an application program sends bytes to the serial port -(and modem) +When an application program sends bytes to the serial port + they first get stashed in the the transmit serial port buffer in main memory. The pair consists of both this transmit buffer and a receive buffer for the opposite direction of byte-flow. Here's an example @@ -1271,14 +1082,15 @@ The serial device driver takes out say 16 bytes from this transmit buffer, one byte at a time and puts them into the 16-byte transmit buffer in the serial UART for transmission. Once in that transmit buffer, there is no way to stop them from being transmitted. They are then -transmitted to the modem +transmitted to the modem or other device connected to the serial port which also has a fair sized (say 1k) buffer. When the device driver (on orders from flow control) stops the flow of outgoing bytes from the computer, what it actually stops is the flow of outgoing bytes from the large transmit buffer in main memory. Even after this has -happened and the flow to the modem has stopped, an application program +happened and the flow to the device +connected to the serial port has stopped, an application program may keep sending bytes to the 8k transmit buffer until it becomes -fill. +fill. When it gets fill, the application program can't send any more bytes to it (a "write" statement in a C_program blocks) and the application @@ -1291,39 +1103,7 @@ stop. The above was a little oversimplified since there is another alternative of having the application program itself do something else while it is waiting to "write". - - Modem Commands -

Commands to the modem are sent to it from the communication -software over the same conductor as used to send data. The commands -are short ASCII strings. Examples are "AT&K3" for enabling -hardware flow control (RTS/CTS) between your computer and modem; and -"ATDT5393401 for Dialing the number 5393401. Note all commands are -prefaced by "AT". Some commands such as enabling flow control help -configure the modem. Other commands such as dialing a number actually -do something. There are about a hundred or so different possible -commands. When your communication software starts running, it first -sends an "init" string of commands to the modem to configure it. All -commands are sent on the ordinary data line before the modem dials (or -receives a call). -Once the modem is connected to another modem (on-line mode), -everything that is sent from your computer to your modem goes directly -to the other modem and is not interpreted by the modem as a command. -There is a way to "escape" from this mode of operation and go back to -command mode where everything sent to the modem will be interpreted as -a command. The computer just sends "+++" with a specified time -spacing before and after it. If this time spacing is correct, the -modem reverts to command mode. Another way to do this is by a signal -on a certain modem control line. - -There are a number of lists of modem commands on the Internet. The -section has links to a couple of -such web-sites. Different models and brands of modems do not use -exactly the same set of such commands. So what works for one modem -might not work for another. Some common command (not guaranteed to -work on all modems) are listed in this HOWTO in the section - @@ -1347,87 +1127,173 @@ the module is used by for more info on - for more info on + Configuring Overview -

If you want to use a modem only for MS Windows/Dos, then you can -just install almost any modem and it will work OK. With a Linux PC -it's not always this easy unless you use an external modem. All -external modems should work OK (even if they are labeled "Plug and -Play") But most new internal modems are Plug-and-Play (PnP) and have -PnP serial ports. In some cases (depending both on the modem and your -version of Linux) The PnP configuring is built into the serial driver -so you don't need to do anything. If it's an ISA modem you may need -to use the Linux "isapnp" program to configure it (but this is planned -to be built into future drivers ??). See the Plug-and-Play-HOWTO and -the isapnp docs for more information. +

Since each modem has an associated serial port and the port has both +hardware and software, there are three parts to configuring a modem: -Since each modem has an associated serial port and the port has both -hardware and software, there are four parts to configuring a modem: - - -Configure the serial port PnP hardware: Done by PnP methods - Configure the serial port driver (low-level): Done by "setserial" + +Locate the serial port hardware: IO address, IRQ; Done by PnP + methods or jumpers, setserial. See Configure the serial port driver (high-level): Done by the - communication program (stty-like) + communication program (stty-like). Sets speed, flow control, etc. + See See Configure the modem itself: Done by the communication program + See +The above omits a few other things that "setserial" can do besides +locating the serial ports. But normally you don't need to use them. +Setserial may be used in the future to enable super-high speed. + Communication programs include aConfiguring the Serial Port Hardware and Driver (low-level) +Locating the Serial Port: IO address, IRQs

-Although most PCI modems are "winmodems" without a -Linux driver (and will not work under Linux), other PCI serial cards -(usually modem cards) will often work OK under Linux. Some need no -special support in the serial driver and work fine under Linux once -setserial is used to configure them. Other PCI cards need special -support in the kernel. Some of these cards are supported by kernel -2.4 (and in later versions of the 2.3 series). Kernel 2.2 has no such -support. If your modem (or serial port) happens to be supported, then -you shouldn't need to do anything to PnP configure it. The new serial -driver will read the id number digitally stored on the card to -determine how to support the card. It should assign the I/O address -to it, determine it's IRQ, etc. So you don't need to use "setserial" -for it. + IO & IRQ Overview +

For a serial port to work properly, it must have both an IRQ and +an IO address. Without an IO address, it can't be located and will not +work at all. Without an IRQ it will need to use inefficient polling +methods for which one must set the IRQ to 0. So every serial port +needs an IO address and IRQ. In olden days this was set by jumpers on +a serial port card. Today it's set by digital signals sent to the +hardware and this is part of "Plug-and-Play (PnP). + +The driver must also know both the IO address and IRQ so that it can +locate the card. Modern drivers (kernel 2.4) determine this by PnP +methods so one doesn't need to tell them (by using "setserial"). The +driver uses PnP functions provided by Linux to determine what the IO +and IRQ are and to set them if necessary. The driver also probes +possible serial port addresses to see if there are any serial ports +there. This works for the case of jumpers and sometimes works for a +PnP port when the driver doesn't do PnP. + +Locating the serial port by giving it an IRQ and IO address is +low-level configuring. What follows repeats what was said above in +more detail. This low-level configuring consists of assigning an IO +address, IRQ, and name (such as ttyS2). This IO-IRQ pair must be set +in both the hardware and told to the serial driver. We could call +this "io-irq" configuring for short. The "setserial" program is one +way to tell the driver. The other way is for the driver to use PnP +methods to determine/set the IO/IRQ and then remember what it did. +For jumpers you must always use "setserial". If you need to configure +but don't understand certain details it's easy to get into trouble. + +When Linux starts, some effort is made to detect and configure +(low-level) a few serial ports. Exactly what happens depends on your +BIOS, hardware, Linux distribution, etc. If the serial ports work OK, +there may be no need for you to do any more low-level configuring. + +If you're having problems with the serial ports, then you may need to +do low-level configuring. If you have kernel 2.2 or lower, +then you need to do it if you: + + + Plan to use more than 2 ISA serial ports + Are installing a new serial port (such as an internal modem) + + +For kernel 2.2+ you may be able to use more that 2 serial ports +without doing any low-level configuring by sharing interrupts. All +PCI cards should support this but for ISA it only works for some +hardware. It may be just as easy to give each port a unique interrupt +if they is available. See + +The low-level configuring (setting the IRQ and IO address) seems to +cause people more trouble than the high-level, although for many it's +fully automatic and there is no configuring to be done. Until the +serial driver knows the correct IRQ and IO address, the port will not +usually not work at all. Also, PnP ports can be disabled so that they +can't be found (except with PnP tools). Applications, and utilities +such as "setserial" and "scanport" don't use PnP tools and thus can't +detect disabled ports. For example, an IO enabling bit must be set in +PCI serial port hardware by PnP so that it's IO address may be used. + +Even if the port can be found by normal (non-PnP) software, it may +work extremely slow if the IRQ is wrong. See . + +In the Wintel world, the IO address and IRQ are called "resources" and +we are thus configuring certain resources. But there are many other +types of "resources" so the term has many other meanings. In summary, +the low-level configuring consists of enabling the device, giving it a +name (ttyS2 for example) and putting two values (an IRQ number and IO +address) into two places: + + + the device driver (often by running " memory registers of the serial port hardware itself + + +You may watch the start-up (= boot-time) messages. They are usually +correct. But if you're having problems, there's a good chance that +the ones that look like "setserial" output don't show the true +configuration of the hardware (and they are not necessarily supposed +to). See . + + PCI Bus Support

+ + +If you have kernel 2.4, then there should be support for PnP (either +built-in or by modules). Some PCI serial cards can be automatically +detected and low-level configured by the serial driver. Others will +not be. +Kernel 2.2 had no support for PCI serial ports (although some people +got them working anyway). The 2.4 serial driver will read the id +number digitally stored on the serial hardware to determine how to +support it (if it knows how). It should assign the I/O address to it, +determine it's IRQ, etc. So you don't need to use "setserial" for it +?? If you have a -PCI internal modem which you are convinced is not a winmodem + but it will not work because the latest serial driver doesn't support it, you can help in attempting to create a driver for it. To do this you'll need to contact the maintainer of the serial driver, Theodore -(Ted) Y. Ts'o. - But first check out the modem list site for the latest info -on PCI modems and related topic. You will need to email Ted Ts'o a +(Ted) Y. Ts'o. + + +Look at for the details of what you need to do. Here's a summary of +what you need to do to help him. You will need to email Ted Ts'o a copy of the output of "lspci -vv" with full information about the model and manufacturer of the PCI modem (or serial port). Then he will try to point you to a test driver which might work for it. You @@ -1437,94 +1303,29 @@ and report the results to Ted Ts'o. If you are willing to do all the above (and this is the latest version of this HOWTO) then email the needed info to him at: . -PCI modems are not well standardized. Some use main memory for -communication with the PC. It you see 8-digit hexadecimal addresses -it's not likely to work with Linux. Some require special enabling of -the IRQ. The output of "lspci" can help determine if one can be -supported. If you see a 4-digit IO port and no long memory address, -the modem might work by just telling "setserial" the IO port and the -IRQ. Some people have gotten a 3COM 3CP5610 PCI Modem to work that -way. +PCI ports are not well standardized. Some use main memory for +communication with the PC. Some require special enabling of the IRQ. +The output of "lspci -vv" can help determine if one can be supported. +If you see a 4-digit IO port, the port might work by just telling +"setserial" the IO port and the IRQ. +For example, if lspci shows IRQ 10, I/O at 0xecb8 and you decide to +name it ttyS2 then the command is: - Configuring Overview

In many cases, configuring will happen automatically and you have -nothing to do. But sometimes you need to configure (or just want to -check out the configuration). If so, first you need to know about the -two parts to configuring the serial port under Linux: +setserial /dev/ttyS2 irq 10 port 0xecb8 autoconfig -The first part (low-level configuring) is assigning it an IO address, -IRQ, and name (such as ttyS2). This IO-IRQ pair must be set in both -the hardware and told to the serial driver. We might just call this -"io-irq" configuring for short. The - Plan to use more than 2 serial ports - Installing a new serial port (such as an internal modem) - Having problems with serial port(s) - - -For kernel 2.2+ you may be able to use more that 2 serial ports -without low-level configuring by sharing interrupts. This only works -if the serial hardware supports it and may be no easier than low-level -configuring. See - -The low-level configuring (setting the IRQ and IO address) seems to -cause people more trouble (than high-level), although for many it's -fully automatic and there is no configuring to be done. Thus most all -of this section is on that topic. Until the serial driver knows the -correct IRQ and IO address the port will not work at all. It may not -even be found by Linux. Even if it can be found, it may work -extremely slow if the IRQ is wrong. See . - -In the Wintel world, the IO address and IRQ are called "resources" and -we are thus configuring certain resources. But there are many other -types of "resources" so the term has many other meanings. In review, -the low-level configuring consists of putting two values (an IRQ -number and IO address) into two places: - - - the device driver (often by running " memory registers of the serial port hardware itself - - -You may watch the start-up (= boot-time) messages. They are usually -correct. But if you're having problems, there's a good chance that -some of these messages don't show the true configuration of the -hardware (and they are not supposed to). See . +Note that the boot-time message "Probing PCI hardware" means reading +the PnP configuration registers in the PCI cards which reveals the IO +addresses and IRQs. This is different that the probing of IO +addresses by the serial driver which means reading certain IO +addresses to see if what's read looks like there's a serial port at +that address. Common mistakes made re low-level configuring

Here are some common mistakes people make: setserial command: They run it (without the "autoconfig" and - auto_irq options) and think it has checked out the hardware (it - hasn't). + auto_irq options) and think it has checked the hardware to see if + what it shows is correct (it hasn't). setserial messages: They see them displayed on the screen at boot-time (or by giving the setserial command) and erroneously think that the result always shows how their hardware is actually @@ -1537,7 +1338,38 @@ name="I/O Address & IRQ: Boot-time messages">. same info (possibly erroneous) as setserial. - I/O Address & IRQ: Boot-time messages

There are really two answers to the question "What is my IO and +IRQ?" 1. What the device driver thinks has been set (This is what +setserial usually sets and shows.). 2. What is actually set in the +hardware. Both 1. and 2. above should be the same. If they're not it +spells trouble since the driver has incorrect info on the physical +serial port. In some cases the hardware is disabled so it has no IO +address or IRQ. + +If the driver has the wrong IO address it will try to send data to a +non-existing serial port --or even worse, to some other device. If it +has the wrong IRQ the driver will not get interrupt service requests +from the serial port, resulting in a very slow or no response. See +. If it has the wrong model of UART there +is also apt to be trouble. To determine if both I0-IRQ pairs are +identical you must find out how they are set in both the driver and +the hardware. + + What is the IO Address and IRQ per the driver ? + Introduction +

What the driver thinks is not necessarily how the hardware is +actually set. If everything works OK then what the driver thinks is +likely correct (set in the hardware) and you don't need to investigate +(unless you're curious or want to become a guru). Ways to determine +what the driver thinks include: boot-time messages , the +/proc directory "files" , and the "setserial" command. + + + I/O Address & IRQ: Boot-time messages

In many cases your ports will automatically get low-level configured at boot-time (but not always correctly). To see what is happening, look at the start-up messages on the screen. Don't neglect @@ -1545,10 +1377,10 @@ to check the messages from the BIOS before Linux is loaded (no examples shown here). These BIOS messages may be frozen by pressing the Pause key. Use Shift-PageUp to scroll back to the messages after they have flashed by. Shift-PageDown will scroll in the opposite -direction. The At first you see what was detected (but the irq is only a wild guess): @@ -1558,7 +1390,8 @@ ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A ttyS02 at 0x03e8 (irq = 4) is a 16550A -Later you see what was saved, but it's not necessarily correct either: +Later setserial shows you what was saved, but it's not necessarily +correct either: Loading the saved-state of the serial devices... /dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A @@ -1567,12 +1400,12 @@ Loading the saved-state of the serial devices... Note that there is a slight disagreement: The first message shows -ttyS2 at irq=4 while the second shows it at irq=5. Your may only have -the first message. In most cases the last message is the correct one. -But if your having trouble it may be misleading. Before reading the -explanation of all of this complexity in the rest of this section, you -might just try using your serial port and see if it works OK. If so -it may not be essential to read further. +ttyS2 at irq=4 while the second shows it at irq=5. dmesg may not +display the second message. In most cases the second message is the +correct one. But if your having trouble it may be misleading. Before +reading the explanation of all of this complexity in the rest of this +section, you might just try using your serial port and see if it works +OK. If so it may not be essential to read further. The second message is from the What is the current IO address and IRQ of my Serial Port ? -

If your serial port seems to work OK, then you may type "setserial --g /dev/ttyS*", look at /proc/tty/driver/serial, or inspect the -start-up messages. If you serial port doesn't work (or is very slow) -then you need to read further. - -There are really two answers to the question "What is my IO and -IRQ?" 1. What the device driver thinks has been set (This is what -setserial usually sets and shows). 2. What is actually set in the -hardware. They both should be the same. If they're not it spells -trouble since the driver has incorrect info on the physical serial -port. If the driver has the wrong IO address it will try to send data -to a non-existing serial port --or even worse, to some other device. -If it has the wrong IRQ the driver will not get interrupt service -requests from the serial port, resulting in a very slow or no -response. See . If it has the wrong model of -UART there is also apt to be trouble. To determine if both I0-IRQ -pairs are identical you must find out how they are set in both the -driver and the hardware. - - What does the device driver think? -

This is easy to find out. Just look at the start-up messages or -type "setserial -g /dev/ttyS*". If everything works OK then what -it tells you is likely also set in the hardware. There are some other + The /proc directory and setserial

Type "setserial -g /dev/ttyS*". There are some other ways to find this info by looking at "files" in the /proc directory. Be warned that there is no guarantee that the same is set in the hardware. /proc/ioports will show the IO addresses that the drivers are using. -/proc/interrupts shows the IRQs that are used by drivers of +/proc/interrupts shows the IRQs that are used by drivers of currently running processes (that have devices open). It shows how many interrupts have actually be issued. -/proc/tty/driver/serial shows most of the above, plus the +/proc/tty/driver/serial shows much of the above, plus the number of bytes that have been received and sent (even if the device is not now open). @@ -1653,59 +1463,93 @@ what the driver thinks and not necessarily what is actually set in the hardware. The data on the actual number of interrupts issued and bytes processed is real however. If you see a large number of interrupts and/or bytes then it probably means that the device is (or -was in the case of bytes) working. If there are no bytes received -(rx:0) but bytes were transmitted (tx:3749 for example), then only one -direction of flow is working (or being utilized). +was) working. But the interrupts might be from another device. If +there are no bytes received (rx:0) but bytes were transmitted (tx:3749 +for example), then only one direction of flow is working (or being +utilized). Sometimes a showing of just a few interrupts doesn't mean that the interrupt is actually being physically generated by any serial port. Thus if you see almost no interrupts for a port that you're trying to -use, that interrupt might not be set in the hardware and it implies -that the driver is using the wrong interrupt. To view +use, that interrupt might not be set in the hardware. To view /proc/interrupts to check on a program that you're currently running (such as "minicom") you need to keep the program running while you view it. - What is set in my serial port hardware ?

If it's PCI or ISA PnP then what's set in the hardware has been done +by PnP methods. Even if nothing has been set or the port disabled, +PnP ports may still be found by using "lspci -v" or "isapnp +--dumpregs". Ports disabled by jumpers (or hardware failures) are +lost. See , +, + + +PnP ports don't store their configuration in the hardware when the +power is turned off. This is in contrast to Jumpers (non-PnP) which +remain the same with the power off. That's why a PnP port is more +likely to be found in a disabled state than an old non-PnP one. + + PCI: What IOs and IRQs have been set?

For PCI, the BIOS almost always sets the IRQ and may set the IO +address as well. To see how it's set use "lspci -vv" (best) or look +in /proc/bus/pci (or for kernels <2.2 /proc/pci). The modem's +serial port is often called a "Communication controller". If more +than one IO address is shown, the first one is more likely to be it. +You can't change the IRQ (at least not with "setpci") This is +because if one writes it in it's hardware register no action is taken +on it. It's the BIOS that should actually set up the IRQs and then +write the correct value to this register for lspci to view. If you +must, change the IO address with "setpci" by changing the +BASE_ADDRESS_0 or the like. The _0 (or _1) after BASE_ADDRESS must be +the correct register. + + PCI: Is the port enabled?

If the port communicates via an IO address "then lspci -vv" should +show "Control: I/O+ ..." with + meaning that the IO address is +enabled. If it shows "I/O-" then you may need to use the setpci +command to enable it. For example "setpci -d 151f:000 command=101". +The "command" means the command register which is the same as the +"Control" register displayed by lspci. The 101h sets two bits: the 1 +sets I/O to + and the 100 part keeps SERR# set to +. In this case +only the SERR# bit of the Control register was initially observed to +be + when the lspci command was run. So we kept it enabled to + by +setting bit 8 (where bit 0 is I/O) to 1 by the first 1 in 101. My +apologies if setting bits is confusing. Bit 8 is actually the 9th bit +since we started counting bits from 0. + +ISA PnP ports

For an ISA Plug-and-Play (PnP) port one may try the Finding a port that is not disabled (ISA, PCI, PnP, non-PnP) +

Perhaps the BIOS messages will tell you some info before Linux +starts booting. Use the shift-PageUp key to step back thru the +boot-time messages and look at the very first ones which are from the +BIOS. This is how it was before Linux started. Setserial can't +change it but isapnp or setpci can. Starting with kernel 2.4, these +are built into the serial driver. Using "scanport" will probe all I/O ports and will indicate what it thinks may be serial port. After this you could try probing with setserial using the "autoconfig" option. You'll need to guess the addresses to probe at (using clues from "scanport"). See . If your -serial port is is ISA Plug-and-Play or PCI see the next two subsections. +id="set_serial" name="What is Setserial">. -For a port set with jumpers, its how the jumpers were set. If the -port is not Plug-and-Play (PnP) but has been setup by using a DOS -program then it's set at whatever the person who ran that program set -it to. +For a port set with jumpers, the IO ports and IRQs are set per the +jumpers. If the port is not Plug-and-Play (PnP) but has been setup by +using a DOS program, then it's set at whatever the person who ran that +program set it to. - What is set in my PnP serial port hardware ? -

PnP ports don't store their configuration in the hardware when the -power is turned off. This is in contrast to Jumpers (non-PnP) which -remain the same with the power off. If you have an ISA PnP port, it -can reach a state where it doesn't have any IO address or IRQ and is -in effect disabled. It should still be possible to find the port -using the Exploring via MS Windows (a last resort) +

For PnP ports, checking on how it's configured under DOS/Windows +may (or may not) imply how it's under Linux. MS Windows stores its configuration info in its Registry which is not used by Linux so they are not necessarily configured the same. If you let a PnP BIOS automatically do the configuring when you start Linux (and have told @@ -1716,12 +1560,12 @@ memory but doesn't necessarily configure it that way. Choosing Serial IRQs

If you have Plug-and-Play ports then either a PnP BIOS or the -serial driver may configure all your devices for you and then you may -not need to choose any IRQs. PnP determines what it thinks is best -and assigns them. But if you use the tools in Linux for Plug-and-Play -(isapnp and pcitools) or jumpers then you have to choose. If you -already know what IRQ you want to use you could skip this section +

If you have Plug-and-Play ports then either a PnP BIOS or a +serial driver may configure all your devices for you so then you may +not need to choose any IRQs. PnP software determines what it thinks +is best and assigns them (but it's not always best). But if you +directly use isapnp (ISA bus) or jumpers then you have to choose. If +you already know what IRQ you want to use you could skip this section except that you may want to know that IRQ 0 has a special use (see the following paragraph). @@ -1729,51 +1573,53 @@ following paragraph).

While IRQ 0 is actually the timer (in hardware) it has a special meaning for setting a serial port with setserial. It tells the driver that there is no interrupt for the port and the driver then will use -polling methods. This is quite inefficient but can be tried if there -is an interrupt conflict or mis-set interrupt. The advantage of -assigning this is that you don't need to know what interrupt is set in -the hardware. It should be used only as a temporary expedient until -you are able to find a real interrupt to use. +polling methods. Such polling puts more load on the CPU but can be +tried if there is an interrupt conflict or mis-set interrupt. The +advantage of assigning IRQ 0 is that you don't need to know what +interrupt is set in the hardware. It should be used only as a +temporary expedient until you are able to find a real interrupt to +use. - Interrupt sharing and Kernels 2.2+

The general rule is that every device should use a unique IRQ and -not share them. But there are situations where sharing is permitted -such as with most multi-port boards. Even when it is permitted, it -may not be as efficient since every time a shared interrupt is given a -check must be made to determine where it came from. Thus if it's -feasible, it's nice to allocate every device its own interrupt. + Interrupt sharing, Kernels 2.2+

Sharing of IRQs is where two devices use the same IRQ. As a +general rule, this wasn't allowed for the ISA bus. The PCI bus may +share IRQs but one can't share the same IRQ between the ISA and the +PCI bus. Most multi-port boards may share IRQs. Sharing is not as +efficient since every time a shared interrupt is given a check must be +made to determine where it came from. Thus if it's feasible, it's +nicer to allocate every device its own interrupt. -Prior to kernel 2.2, serial IRQs could be shared with each other only -for most multiport boards. Starting with kernel 2.2 serial IRQs may -be sometimes shared between all serial ports. In order for sharing to -work in 2.2 the kernel must have been compiled with +Prior to kernel 2.2, serial IRQs could not be shared with each other +except for most multiport boards. Starting with kernel 2.2 serial +IRQs may be sometimes shared between serial ports. In order for +sharing to work in 2.2 the kernel must have been compiled with CONFIG_SERIAL_SHARE_IRQ, and the serial port hardware must support sharing (so that if two serial cards put different voltages on the same interrupt wire, only the voltage that means "this is an -interrupt" will prevail). Thus even if you have 2.2, it may be best -to avoid sharing. +interrupt" will prevail). Since the PCI bus specs permit sharing, any +PCI card should allow sharing. What IRQs to choose? -

The serial hardware often has only a limited number of IRQs it can -be set at. Also you don't want IRQ conflicts. So there may not be -much of a choice. Your PC may normally come with /proc/interrupts will show which IRQs are being used by +

The serial hardware often has only a limited number of IRQs. Also +you don't want IRQ conflicts. So there may not be much of a choice. +Your PC may normally come with /proc/interrupts will show which IRQs are being used by programs currently running. You likely don't want to use one of these. Before IRQ 5 was used for sound cards, it was often used for a serial port. Here is how Greg (original author of Serial-HOWTO) set his up in /etc/rc.d/rc.serial. rc.serial is a file (shell script) which runs at -start-up (it may have a different name of location). For versions of +start-up (it may have a different name or location). For versions of "setserial" after 2.15 it's not always done this way anymore but this example does show the choice of IRQs. /sbin/setserial /dev/ttyS0 irq 3 # my serial mouse /sbin/setserial /dev/ttyS1 irq 4 # my Wyse dumb terminal -/sbin/setserial /dev/ttyS2 irq 5 # my Zoom modem +/sbin/setserial /dev/ttyS2 irq 5 # my Zoom modem /sbin/setserial /dev/ttyS3 irq 9 # my USR modem

@@ -1789,7 +1635,7 @@ Standard IRQ assignments: IRQ 7 Parallel port 1 IRQ 8 Real-time clock IRQ 9 Redirected to IRQ2 - IRQ 10 not assigned + IRQ 10 not assigned IRQ 11 not assigned IRQ 12 not assigned IRQ 13 Math coprocessor @@ -1798,37 +1644,38 @@ Standard IRQ assignments:

-There is really no Right Thing to do when choosing interrupts. Just -make sure it isn't being used by the motherboard, or any other boards. -2, 3, 4, 5, 7, 10, 11, 12 or 15 are possible choices. Note that IRQ 2 -is the same as IRQ 9. You can call it either 2 or 9, the serial -driver is very understanding. If you have a very old serial board it -may not be able to use IRQs 8 and above. +There is really no Right Thing to do when choosing interrupts. Try to +find one that isn't being used by the motherboard, or any other +boards. 2, 3, 4, 5, 7, 10, 11, 12 or 15 are possible choices. Note +that IRQ 2 is the same as IRQ 9. You can call it either 2 or 9, the +serial driver is very understanding. If you have a very old serial +board it may not be able to use IRQs 8 and above. Make sure you don't use IRQs 1, 6, 8, 13 or 14! These are used by your motherboard. You will make her very unhappy by taking her IRQs. -When you are done, double-check /proc/interrupts when -programs that use interrupts are being run and make sure there are no -conflicts. +When you are done you might want to double-check +/proc/interrupts when programs that use interrupts are being +run and make sure there are no conflicts. Choosing Addresses --Video card conflict with ttyS3

The IO address of the IBM 8514 video board (and others like it) is -allegedly 0x?2e8 where ? is 2, 4, 8, or 9. This may conflict with the -IO address of Here's a problem with some old serial cards. The IO address of +the IBM 8514 video board (and others like it) is allegedly 0x?2e8 +where ? is 2, 4, 8, or 9. This may conflict with the IO address of + ttyS0 address 0x3f8 @@ -1856,15 +1703,14 @@ possible methods of configuring PnP serial ports: Using a PnP BIOS CMOS setup menu - (usually only for external - modems + (usually only for external + devices on ttyS0 (Com1) and ttyS1 (Com2)) Letting a PnP BIOS automatically configure a PnP serial port See - Doing nothing if you have both a PnP serial port and a PnP - Linux operating system (see Plug-and-Play-HOWTO). + Doing nothing if the serial driver recognized your card OK Using Using pciutils (pcitools) for the PCI bus + Using setpci (pciutils or pcitools) for the PCI bus The IO address and IRQ must be set (by PnP) in their registers each @@ -1875,27 +1721,20 @@ automatically do this each time you start. This might cause problems in Windows (which is a PnP OS) if you start Windows with the BIOS thinking that Windows is not a PnP OS. See Plug-and-Play-HOWTO. -Plug-and-Play was designed to automate this io-irq configuring, -but for Linux at present, it has made life more complicated. The -standard kernels for Linux don't support plug-and-play very well. If -you use a patch to the Linux kernel to covert it to a plug-and-play -operating system, then all of the above should be handled -automatically by the OS. But when you want to use this to automate -configuring devices other that the serial port, you may find that -you'll still have to configure the drivers manually since many Linux -drivers are not written to support a Linux PnP OS. If you use - Using a PnP BIOS to I0-IRQ Configure

While the explanation of how to use a PnP OS or isapnp for io-irq +

While the explanation of how to use setpci or isapnp for io-irq configuring should come with such software, this is not the case if you want to let a PnP BIOS do such configuring. Not all PnP BIOS can do this. The BIOS usually has a CMOS menu for setting up the first -two serial ports. This menu may be hard to find and for an "Award" +two serial ports. This menu may be hard to find. For an "Award" BIOS it was found under "chipset features setup" There is often little to choose from. Unless otherwise indicated in a menu, these first two ports normally get set at the standard IO addresses and @@ -1904,8 +1743,8 @@ Numbers"> Whether you like it or not, when you start up a PC a PnP BIOS starts to do PnP (io-irq) configuring of hardware devices. It may do the job -partially and turn the rest over to a PnP OS (which you probably don't -have) or if thinks you don't have a PnP OS it may fully configure all +partially and turn the rest over to a PnP OS (which Linux is in some +sense) or if thinks you don't have a PnP OS it may fully configure all the PnP devices but not configure the device drivers. This is what you want but it's not always easy to figure out exactly what the PnP BIOS has done. @@ -1915,43 +1754,45 @@ should do the configuring of all PnP serial ports --not just the first two. An indirect way to control what the BIOS does (if you have Windows 9x on the same PC) is to "force" a configuration under Windows. See Plug-and-Play-HOWTO and search for "forced". It's -easier to use the CMOS BIOS menu which may override what you +easier to use the CMOS BIOS menu which may override what you "forced" under Windows. There could be a BIOS option that can set or disable this "override" capability. -If you add a new PnP device, the BIOS should change its PnP -configuration to accommodate it. It could even change the io-irq of -existing devices if required to avoid any conflicts. For this -purpose, it keeps a list of non-PnP devices provided that you have -told the BIOS how these non-PnP devices are io-irq configured. One -way to tell the BIOS this is by running a program called ICU under -DOS/Windows. +If you add a new PnP device, the BIOS should PnP configure it. It +could even change the io-irq of existing devices if required to avoid +any conflicts. For this purpose, it keeps a list of non-PnP devices +provided that you have told the BIOS how these non-PnP devices are +io-irq configured. One way to tell the BIOS this is by running a +program called ICU under DOS/Windows. But how do you find out what the BIOS has done so that you set up the device drivers with this info? The BIOS itself may provide some info, either in its setup menus of via messages on the screen when you turn on your computer. See . Other ways of finding out is to use lspci for +the PCI bus or isapnp --dumpregs for the ISA bus. The cryptic results +it shows you may not be clear to a novice. Giving the IRQ and IO Address to Setserial

Once you've set the IRQ and IO address in the hardware (or arranged for it to be done by PnP) you also need to insure that the "setserial" command is run each time you start Linux. See the subsection +id="sets_boot_time" name="Boot-time Configuration"> Configuring the Serial Driver (high-level) "stty" +

This configuring is normally done by your communications program -such as wvdial and it may do much of it without even letting you know what -it's done. In olden days it was done with the stty utility. If you +such as wvdial. It may do much of it without even letting you know what +it's done. In olden days it was done with the "stty" utility. If you set something with stty, the communications program may change the setting so it's usually best to just let the communications program handle it. See - Hardware flow control (RTS/CTS) + Hardware flow control (RTS/CTS)

See for an explanation of it. You should always use hardware flow control if possible. Your communication program or " You need to add the following to such a file for each serial port (example is ttyS2) you want to enable hardware flow control on: - -stty crtscts < /dev/ttyS2 + +stty crtscts < /dev/ttyS2 or stty -F /dev/ttyS2 crtscts - + If you want to see if flow control is enabled do the following: In -minicom (or the like) type AT&V to see how the modem is configured and -look for &K3 which means hardware flow control. Then see if the -device driver knows about it by typing: stty -F /dev/ttyS2 -a Look for +minicom (or the like) type AT&V to see how the modem is configured +and look for &K3 which means hardware flow control. Then without +exiting the communications program (such as minicom) see if the device +driver knows about it by typing: stty -F /dev/ttyS2 -a. Look for "crtscts" (without a disabling minus sign). - Other Driver Settings (high level) -

Besides flow control and speed, there is speed. See . There's -also are parity and bits-per-byte settings. Normally the port is set -by the communications program at 8N1 (8-bits per byte, No parity, and -1 stop bit). If you're running PPP then you must use 8N1. So if you -get a complaint that it's not 8-bit clean then it's likely not 8N1 as -it should be. + Speed Settings +

Besides flow control there is speed. See . There's also are +parity and bits-per-byte settings. Normally the port is set by the +communications program at 8N1 (8-bits per byte, No parity, and 1 stop +bit). If you're running PPP then you must use 8N1. So if you get a +complaint that it's not 8-bit clean then it's likely not 8N1 as it +should be. + + Ignore CD Setting: clocal +

If the modem is not sending a CD signal and clocal is disabled +(stty shows -clocal) then a program may not be able to open the serial +port. If the port can't open, the program may just hang, waiting +(often in vain) for a CD signal from the modem. Actually, a skilled +programmer can write the program in such a way as to force the port to +open even when CD and -clocal say not to so it's not always a problem. + +One way to avoid any possible problems is to send "AT&C" to the +modem so that CD from the modem will always be on. CD always-on is +fine for dial-out but for dial-in the CD signal is sometimes (but +rarely) used to detected an incoming call. + +Minicom sets clocal automatically when it starts up so there is no +problem. But version 6.0.192 of Kermit hung when I set -clocal and +tried to "set line ...". + +Here's a problem that existed prior to the year 2000 or thereabouts. +It's since been fixed. If -clocal is set and there is no CD signal, +then the "stty" command will hang and there is seemingly no way to set +clocal (except by running minicom). But minicom will restore -clocal +when it exits. One way to get out of this is to use minicom to send +the "AT&C" to the modem (to get the CD signal) and then exit +minicom with no reset so that the CD signal always remains on. Then +you may use stty again. + + What is stty ?

Modem Configuration (excluding serial port)

Since the channel for sending AT commands to the modem is the same @@ -2253,7 +2134,7 @@ in Modem and Serial HOWTOs Serial Port Devices /dev/ttyS2, etc. -->

For creating devices in the device directory see: -the Serial-HOWTO: "Creating Devices In the /dev directory". + Devfs (The new Device File System) @@ -2303,7 +2184,7 @@ COM4 /dev/ttyS3 4, 67; /dev/cua3 5, 67 2E8 /dev/tts/3 the USB are: /dev/ttyUSB0 /dev/ttyUSB1, etc. Link ttySN to /dev/modem -

On some installations, two extra devices will be created, +

On some installations, two extra devices will be created, /dev/modem for your modem and /dev/mouse for a mouse. Both of these are symbolic links to the appropriate serial device in /dev which you specified during the installation @@ -2347,7 +2228,7 @@ should be avoided if possible. @@ -3065,7 +2917,7 @@ checks it and starts whatever process is specified in your password file. This process is often the bash shell. If so, bash starts and replaces the login process. Note that one process replaces another and that the bash shell process originally started as the getty -process. The implications of this will be explained below. +process. The implications of this will be explained below. Now in the /etc/inittab file getty is supposed to respawn (restart) if killed. It says so on the line that calls getty. But if the bash shell @@ -3076,7 +2928,7 @@ fact if you observe the details you will notice that the replacement process will have the same process ID as the original process. Thus bash is sort of getty in disguise with the same process ID number. If bash is killed it is just like getty was killed (even though getty -isn't running anymore). This results in getty respawning. +isn't running anymore). This results in getty respawning. When one logs out, all the processes on that serial port are killed including the bash shell. This may also happen (if enabled) if a @@ -3136,7 +2988,7 @@ and the modem send the same string back and forth over and over. You may see a "respawning too rapidly" error message if this happens. To prevent this you need to disable all echoing and result codes from the modem (E0 and Q1). Also use the -i option with agetty to prevent any -/etc/issue file from being sent. +/etc/issue file from being sent. If you start getty on the modem port and a few seconds later find that you have the login process running on that port instead of getty, it @@ -3158,9 +3010,9 @@ dialin, there's no easy way to dial out. When someone first dials in to agetty, they should hit the return key to get the login prompt. About mingetty, and fbgetty + About mingetty, and fbgetty

fbgetty is as above but supports framebuffers. Why "Manual" Answer is Best @@ -3199,7 +3051,7 @@ remains open for the other process). Thus if another process dials out, mgetty doesn't interfere with it. When the other process finally closes the port, then mgetty resumes "listening". It's a special type of "listening" that refrains from reading until mgetty believes that -what it will read is for mgetty (hopefully a "RING" message). +what it will read is for mgetty (hopefully a "RING" message). When mgetty checks to see if another process is using the port, it actually checks for valid lockfiles on the port. If the other process @@ -3227,7 +3079,7 @@ the user to log out. This will kill the remote user's shell on your PC. Now since there is nothing running on this port, the port is closed and sends a hangup signal to the modem by negating DTR. This will only happen if stty -a shows hupcl (hang up on close) but this -should be the default. +should be the default. The modem getting this hangup (negated DTR signal) will then hang up the phone line (provided the modem has been configured to do this @@ -3243,13 +3095,13 @@ command mode, a hangup command (H0) may be sent to the modem as well as other AT commands. If the PC fails to successfully signal the modem when a logout happens (or to use the +++ escape when restarting getty), then the modem is apt to remain in on-line mode and no more -incoming calls can be received. +incoming calls can be received. - When DTR drops (is negated) + When DTR drops (is negated)

When DTR (the "hang-up" signal) is negated, what the modem does depends on the value of the &D option in the modem's profile. If it's &D0 nothing at all happens (the modem ignores the negation of -DTR). +DTR). &D2: The modem will hang up and go into AT command mode (off-line) to wait for the next call. Except that it will not @@ -3299,7 +3151,7 @@ ignored (by Linux). Dial-in Modem Configuration

The getty programs have a provision for sending an init string to the modem to configure it. But you may need to edit it. Another -method is to save a suitable init string inside the modem (see +method is to save a suitable init string inside the modem (see for how to save it in the modem). @@ -3310,16 +3162,16 @@ other documentation here are some hints using Hayes AT commands: &C1 Make the CD line to the serial port track the actual state of the carrier (CD asserted only when there's carrier). - Getty_em requires &C0 (CD always asserted) -&D3 Do a hard reset of the modem when someone logs out + Getty_em requires &C0 (CD always asserted) +&D3 Do a hard reset of the modem when someone logs out (or hangs up). For some modems it's reported that &D2 is required since they can't tolerate a hard reset ?? &K3 Use hardware flow control -&K3 Use hardware flow control +S0=? mgetty suggests S0=0 (manual answer). If you set S0=3 the modem will auto-answer on the 3rd ring, etc. Agetty uses @@ -3432,7 +3284,7 @@ GUI on a Linux PC, and run Windows programs on the remote Windows PC. Of course the Windows PC must be running VNC (as a server). Obviously, a GUI connection over a modem will be slower than a text-only connection especially if you run KDE or GNOME or want 16-bit -color. +color. Interoperability with MS Windows

Once you have dial-in set up, others may call in to you using @@ -3466,7 +3318,7 @@ It is possible for two people to crudely chat and send files using Minicom on the Linux end and HyperTerminal on the Windows end. It's all done manually by two live persons, one on each end of the phone connection. See . +Dial-In">. At the opposite extreme, one would like to run a dial-in so that the person calling would get a GUI interface. For that a network protocol @@ -3484,24 +3336,24 @@ gettys. Installing getty_ps

Since uugetty is part of getty_ps you'll first have to install -getty_ps. If you don't have it, get the latest version from . In particular, if you want to use high speeds (57600 and 115200 bps), you must get version 2.0.7j or later. You must also have libc 5.x or greater. -

By default, By default, /sbin, and the config files -will be named /etc/conf.{uu}getty.ttyS/var/lock. Make sure you have the /var/lock -directory. +will be named /etc/conf.{uu}getty.ttyS/var/lock. Make sure you have the /var/lock +directory.

If you don't want FSSTND compliance, binaries will go -in /etc, config files will go in +in /etc, config files will go in /etc/default/{uu}getty.ttyS/usr/spool/uucp. I recommend doing things this way if you +/usr/spool/uucp. I recommend doing things this way if you are using UUCP, because UUCP will have problems if you move the lock files to where it isn't looking for them.

@@ -3510,18 +3362,18 @@ pages for /var/adm/getty.log by +can edit /var/adm/getty.log by default.

Decide on if you want FSSTND compliance and syslog capability. You can also choose a combination of the two. Edit the Setting up uugetty -

+

With /etc/gettydefs to include an entry for @@ -3536,26 +3388,26 @@ linux# getty -c /etc/gettydefs Modern Modems -

If you have a 9600 bps or faster modem with data compression, -you can lock your serial port to one speed. For example: +

If you have a 9600 bps or faster modem with data compression, +you can lock your serial port to one speed. For example: # 115200 fixed speed F115200# B115200 CS8 # B115200 SANE -ISTRIP HUPCL #@S @L @B login: #F115200

If you have your modem set up to do RTS/CTS hardware flow control, you -can add # 115200 fixed speed with hardware flow control F115200# B115200 CS8 CRTSCTS # B115200 SANE -ISTRIP HUPCL CRTSCTS #@S @L @B login: #F115200 - Old slow modems + Old slow modems

If you have a slow modem (under 9600 bps) Then, instead of one line for a single speed, your need several lines to try a number of speeds. Note the these lines are linked to each other by the last "word" in the line such as #4800. Blank lines are needed between -each entry. Are the higher modem-to-serial_port speeds in this +each entry. Are the higher modem-to-serial_port speeds in this example really needed for a slow modem ?? The uugetty documentation shows them so I'm not yet deleting them. @@ -3598,16 +3450,16 @@ serial line, and the current bps rate. You can add other things: Customizing uugetty -

There are lots of parameters you can tweak for each port you have. +

There are lots of parameters you can tweak for each port you have. These are implemented in separate config files for each port. The file /etc/conf.uugetty will be used by /etc/conf.uugetty.ttyS/etc/default/uugetty.ttyS/etc/default/uugetty.ttyS/etc/conf.uugetty.ttyS3 looked like this: # sample uugetty configuration file for a Hayes compatible modem to allow @@ -3617,7 +3469,7 @@ default file will be /etc/default/uugetty.ttyS ... (chat sequence) INIT="" AT\r OK\r\n WAITFOR=RING @@ -3627,7 +3479,7 @@ DELAY=1 #DEBUG=010

-Add the following line to your /etc/inittab, so that +Add the following line to your /etc/inittab, so that Restart -linux# init q +linux# init q -For the speed parameter in your /etc/inittab, you want to use +For the speed parameter in your /etc/inittab, you want to use the highest bps rate that your modem supports.

Now Linux will be watching your serial port for connections. @@ -3688,7 +3540,7 @@ if the flow (speed) from the PC to the modem was 20,000 bytes/sec would flow over the telephone line. Thus for a 2:1 compression ratio you need to set the DTE speed to double the maximum modem speed on the phone line. If the compression ratio were 3 to 1 you need to set it 3 -times faster, etc. +times faster, etc. Where do I Set Speed ?

This DTE (PC-to-modem) speed is normally set by a menu in your @@ -3700,30 +3552,37 @@ set the modem-to-modem speed with the S37 register but you shouldn't do it. If the two modems on a connection were to be set this way to different speeds, then they couldn't communicate with each other. - Can't Set a High Enough Speed + Can't Set a High Enough Speed

The top speed of 115.2k has been the standard speed since the -mid 1990's. By the year 2000, many serial ports supported higher -speeds but Linux seldom used them due to lack of drivers. These -high-speed ports by default only support 115.2k and must have special -software to enable the higher speeds. Today (2001) almost all new -serial ports support speeds of 230.4k and 460.8k. Some also support -921.6k. Unfortunately, to get these speeds you need to compile the -kernel with a special patch and it seems the patch doesn't support the -2.4 kernels yet. +

The top speed of 115.2k has been standard since the mid 1990's. +But by the year 2000, most new serial ports supported higher speeds of +230.4k and 460.8k. Some also support 921.6k. Unfortunately Linux +seldom uses these speeds due to lack of drivers. These ports behave +just like 115.2k ports unless the higher speeds are enabled by special +software. To get these speeds you need to compile the kernel with +special patches but it seems that the 2.4 kernels not yet supported + +The patch software is fairly simple since it only needs to enable the +higher speeds by dialog with the hardware. But it's not quite as +simple as just putting an enable byte in a hardware register since the +registers weren't designed for this. But unfortunately, there is no +standard way to enable the higher speeds so the driver needs to +support a variety of hardware. + +A patch to support high-speed is called shsmod (Super High Speed +Mode). There are both Windows and Linux versions of this patch. See +. For Linux (as of late +2001), most of the documentation is only in Japanese and the patch is +for the old kernel 2.2.x. There is also a module for the VIA +VT82C686 chip . Using it may +result in buffer overflow. For internal modems, only a minority of them advertise that they -support speeds of over 115.2k for their built-in serial ports. -Will shsmod support these ?? - -The patch to support high-speed is called shsmod (Super High Speed). -There are both Windows and Linux versions of this patch. See . For Linux, much of the -documentation is only in Japanese. There is also a module for the -VIA VT82C686 chip . +support speeds of over 115.2k for their built-in serial ports. +Does shsmod support these ?? How speed is set in hardware: the divisor and baud_base

To correct this accounting (but not always fix the problem) you may use "setserial" to change the baud_base to the actual maximal speed of your port such as 230.4k. Then if you set the speed (by your application or by stty) to 230.4k, a divisor of 1 will be used and -you'll get the same speed as you set. PROBLEM: stty and many -communication programs (as of mid 1999) still have 115.2k as their -maximum speed setting and will not let you set 230.4k, etc. So in -these cases one solution is not to change anything with -setserial /dev/ttyS2 spd_cust baud_base 230400 divisor 1 -Don't try using "divisor" for any other purpose other than the special -use illustrated above (with spd_cust). +If you have old software which will not permit such a high speed (but +your hardware has it enabled) then you might want to look into using +the "spd_cust" parameter for setserial with "divisor 1". Then when +you tell the application that the speed it 38,400, it will use divisor +1 and get the highest speed. -If there are two or more high speeds that you want to use that your -communication program can't set, then it's not quite as easy as above. -But the same principles apply. You could just keep the default -baud_base and understand that when you set a speed you are really only -setting a divisor. So your actual speed will always be your maximum -speed divided by whatever divisor is set by the serial driver. See - +There are some brands of UARTs that uses a very high divisor to set +high speeds. There isn't any satisfactory way to use "setserial" (say +set "divisor 32770") to get such a speed since then setserial would +then think that the speed is very low and disable the FIFO in the +UART. - Crystal frequency is not baud_base + Crystal frequency is higher than baud_base

Note that the baud_base setting is usually much lower than the frequency of the crystal oscillator in the hardware since the crystal frequency is often divided by 16 in the hardware to get the actual top speed. The reason the crystal frequency needs to be higher is so that -this high crystal speed can be used to take a number of samples of -each bit to determine if it's a 1 or a 0. +this high crystal speed can generate clock ticks to take a number of +samples of each bit to determine if it's a 1 or a 0. @@ -3801,7 +3649,7 @@ are some suggested speeds to set your serial line if your modem speed is: - 56k (v.90): use 115.2 kbps or 230.4 kbps (best) + 56k (v.90): use 115.2 kbps or 230.4 kbps (best) 33.6k (v.34bis): use 115.2 kbps 28.8k (v.34): use 115.2 kbps 14.4k (v.32bis): use 57600 bps @@ -3812,7 +3660,7 @@ is: All the above speeds may use v.42bis data compression and v.42 error correction. If data compression is not used then the speed may be set -lower so long as it's above the modem speed. +lower so long as it's above the modem speed. Communications Programs And Utilities

While PPP is used for Internet access you also need a dialer @@ -3841,22 +3689,22 @@ you purchase a book as the manual. However Kermit has interactive online help which tells all but lacks tutorial explanations for the beginner. Commands may be put in a script file so you don't have to type them over again each time. Kermit (as a communications program) -is more powerful than Minicom. +is more powerful than Minicom. Although all Minicom documentation is free, it's not as extensive as Kermit's. Since permission is required to include Kermit in a commercial distribution, and since the documentation is not entirely free, some distributions don't include Kermit. In my opinion it's easier to set up Minicom, there is less to learn, and you can still -use kermit from within Minicom. +use kermit from within Minicom. - List of Communication Software + List of Communication Software

Here is a list of some communication software you can choose from, If they didn't come with your distribution they should be available via FTP. I would like comparative comments on the dialout programs. Are the least popular ones obsolete? - Least Popular Dialout + Least Popular Dialout

Most Popular Dialout

PPP dialers for getting on the internet: - - portable, scriptable, serial and TCP/IP communications including file + - + portable, scriptable, serial and TCP/IP communications including file transfer, character-set translation, and zmodem support @@ -3885,8 +3733,8 @@ efficient. A fax protocol tutorial +A fax protocol tutorial @@ -3919,7 +3767,7 @@ getty_ps"> run in user space on a remote computer with a shell account. See for more details - . -Other things can be found on +Other things can be found on and or one of the + name="ftp://metalab.unc.edu/pub/Linux/apps/serialcomm"> or one of the many mirrors. These are the directories where serial programs are kept. @@ -3962,7 +3810,7 @@ SLiRP. There is an unmaintained Term HOWTO. PC then if they use: Windows 3.x: use Windows 95/98/2000: use Windows 95/98/2000: use Third party dial-out programs include HyperTerminal Private Edition. @@ -3973,7 +3821,7 @@ Third party dial-out programs include HyperTerminal Private Edition. doubled. It takes two modems and two phone lines. There are two methods of doing this. One is "modem bonding" where software at both ends of the modem-to-modem connection enables the paired modems to -work like a single channel. +work like a single channel. The second method is called "modem teaming. Only one end of the connection uses software to make 2 different connections to the @@ -3998,7 +3846,7 @@ modem2, etc. To keep each modem busy, it may be necessary to send out more packets on one modem than the other. Since EQL is not packet based, it doesn't split up the flow on packet boundaries. - EQL + EQL

EQL is "serial line load balancing" which has been available for Linux since at least 1995. An old (1995) howto on it is in the kernel documentation (in the networking subdirectory). Unfortunately, ISPs @@ -4041,7 +3889,7 @@ Another way try to find out if there's a modem on a port is to start "minicom" on the port (after first setting up minicom for the correct serial port --you will need to save the setup and then exit minicom and start it again). Then type "AT" and you should see OK (or 0 if -it's set for "digit result codes"). The results may be: +it's set for "digit result codes"). The results may be: No response. See It takes many seconds to get an expected truncated response @@ -4059,7 +3907,7 @@ packets or the like. type to the modem (using minicom or the like). If you don't see "OK" (and in most cases don't even see the "AT" you typed either) then the modem is not responding (often because what you type doesn't even get -to the modem). +to the modem). A common cause is that there is no modem on the serial port you are typing to. For the case of an internal modem, that serial port likely @@ -4067,7 +3915,7 @@ doesn't exist either. That's because the PnP modem card (which has a built-in serial port) has either not been configured (by isapnp or the like) or has been configured incorrectly. See . +be Found">. If what you type is really getting thru to a modem, then the lack of response could be due to the modem being in "online data" mode where @@ -4129,14 +3977,14 @@ test this you might connect your modem directly at the point where the telephone line enters the building with the feeds for everything else on that line disconnected (if others can tolerate such a test). - Uploading (downloading) files is broken/slow + Uploading (downloading) files is broken/slow

Flow control (both at your PC and/or modem-to-modem) may not be enabled. For the uploading case: If you have set a high DTE speed (like 115.2k) then flow from your modem to your PC may work OK but uploading flow in the other direction will not all get thru due to the telephone line bottleneck. This will result in many errors and the resending of packets. It may thus take far too long to send a file. -In some cases, files don't make it thru at all. +In some cases, files don't make it thru at all. For the downloading case: If you're downloading long uncompressed files or web pages (and your modem uses data compression) or if you've @@ -4145,10 +3993,10 @@ flow control. For Dial-in I Keep Getting "line NNN of inittab invalid"

-Make sure you are using the correct syntax for your version of -/etc/inittab file. Make sure you are using the -correct syntax for your version of /etc/inittab file. Make sure you are using the +correct syntax for your version of I Keep Getting: ``Id "S3" respawning too fast: disabled for 5 minutes''

Id "S3" is just an example. In this case look on the line which @@ -4161,7 +4009,7 @@ killed again, etc. Thus it respawns over and over (too fast). It seems that if the cable to the modem is disconnected or you have the wrong serial port, it's just like CD is negated. All this can occur when your modem is chatting with getty. Make sure your modem is -configured correctly. Look at AT commands If you use uugetty, verify that your /etc/gettydefs syntax is @@ -4175,7 +4023,7 @@ See section . My Modem is Hosed after Someone Hangs Up, or uugetty doesn't respawn

-This can happen when your modem doesn't reset when DTR is dropped. +This can happen when your modem doesn't reset when DTR is dropped. Greg Hankins saw his RD and SD LEDs go crazy when this happened. You need to have your modem reset. Most Hayes compatible modems do this with uugetty Still Doesn't Work

-There is a /etc/conf.{uu}getty.ttyS/etc/conf.{uu}getty.ttyS @@ -4199,18 +4047,18 @@ D_RUN 040 other runtime diagnostics D_RB 100 ringback debugging D_LOCK 200 uugetty lockfile processing D_SCH 400 schedule processing -D_ALL 777 everything +D_ALL 777 everything Setting -If you are running /tmp/getty:ttyS/tmp/getty:ttyS/tmp/uugetty:ttyS/var/adm/getty.log. Look at the -debugging info and see what is going on. Most likely, you will need -to tune some of the parameters in your config +and /tmp/uugetty:ttyS/var/adm/getty.log. Look at the +debugging info and see what is going on. Most likely, you will need +to tune some of the parameters in your config file, and reconfigure your modem.

You could also try Troubleshooting started above --> (The following subsections are in both the Serial and Modem HOWTOs) - My Serial Port is Physically There but Can't be Found + My Serial Port is Physically There but Can't be Found

If a physical device (such as a modem) doesn't work at all it may mean that the device is not at the I/O address that setserial thinks it's at. It could also mean (for a PnP card) that is doesn't -yet have an address. Thus it can't be found. +yet have an address. Thus it can't be found. Check the BIOS menus and BIOS messages. For the PCI bus use lspci or scanpci. If it's an ISA bus PnP serial port, try "pnpdump --dumpregs" @@ -4256,9 +4104,9 @@ devices illegally "sharing" a port but the fact that there are two devices on the same a port doesn't seem to get detected (except hopefully by you). In the above case, if the IRQs are different then probing for IRQs with setserial might "detect" this situation by -failing to detect any IRQ. See . +failing to detect any IRQ. See . - Extremely Slow: Text appears on the screen slowly after long delays + Extremely Slow: Text appears on the screen slowly after long delays

It's likely mis-set/conflicting interrupts. Here are some of the symptoms which will happen the first time you try to use a modem, @@ -4272,9 +4120,9 @@ a long wait of many seconds for the next batch of characters. You might also get "input overrun" error messages (or find them in logs). For more details on the symptoms and why this happens see -the Serial-HOWTO section: "Interrupt Problem Details". -If it involves Plug-and-Play devices, see also Plug-and-Play-HOWTO. + +If it involves Plug-and-Play devices, see also Plug-and-Play-HOWTO. As a quick check to see if it really is an interrupt problem, set the IRQ to 0 with "setserial". This will tell the driver to use @@ -4303,15 +4151,11 @@ thinks the hardware is set. Somewhat Slow: I expected it to be a few times faster

One reason may be that whatever is on the serial port (such as a modem, terminal, printer) doesn't work as fast as you thought it did. -A 56k Modem seldom works at 56k and the Internet often has -congestion and bottlenecks that slow things down. If the modem on the -other end does not have a digital connection to the phone line (and -uses a special "digital modem" not sold in most computer stores), then -speeds above 33.6k are not possible. + Another possible reason is that you have an obsolete serial port: UART 8250, 16450 or early 16550 (or the serial driver thinks you do). See - "What are UARTS" in the Serial-HOWTO. + Use "setserial -g /dev/ttyS*". If it shows anything less than a 16550A, this may be your problem. @@ -4321,7 +4165,7 @@ really do have an obsolete serial port, lying about it to setserial will only make things worse. The Startup Screen Show Wrong IRQs for the Serial Ports. -

Linux does not do any IRQ detection on startup. When the serial module loads it only does serial device detection. Thus, disregard what it says about the IRQ, because it's just assuming the standard @@ -4337,7 +4181,7 @@ ttyS02 at 0x03e8 (irq = 4) is a 16550A at first when Linux boots. (Older kernels may show "ttyS02" as "tty02" which is the same as ttyS2). You may need to use - "Cannot open /dev/ttyS?: Permission denied"

Check the file permissions on this port with "ls -l /dev/ttyS?"_ @@ -4374,7 +4218,7 @@ permissions are OK: usually rwx for everyone (repeated 3 times). If it's wrong, use "chmod" to fix it. Of course, if there is no "lock" directory no lockfile can be created there. For more info on lockfiles see the Serial-HOWTO subsection: "What Are Lock -Files". +Files". "Device /dev/ttyS? is locked."

This means that someone else (or some other process) is supposedly @@ -4429,7 +4273,7 @@ What you need to do is to find the interrupt setserial thinks it). You should also be able to find it with the "setserial" command for Overrun errors on serial port

This is an overrun of the hardware FIFO buffer and you can't -increase its size. See "Higher Serial Thruput" in the Serial-HOWTO. +increase its size. See + - Modem doesn't pick up incoming calls -

This paragraph is for the case where a modem is used for both -dial-in and dial-out. If the modem generates a DCD (=CD) signal, some - programs (but not mgetty) will think that the modem is busy. -This will cause a problem when you are trying to dial out with a modem -and the modem's DCD or DTR are not implemented correctly. The modem -should assert DCD only when there is an actual connection (ie someone -has dialed in), not when Port get characters only sporadically

There could be some other program running on the port. Use "top" @@ -4482,15 +4315,15 @@ on a serial port. Troubleshooting Tools

These are some of the programs you might want to use in -troubleshooting: +troubleshooting: "lsof /dev/ttyS*" will list serial ports which are open. "setserial" shows and sets the low-level hardware configuration of a port (what the driver thinks it is). See + name="What is Setserial"> "stty" shows and sets the configuration of a port (except for that handled by "setserial"). - See the Serial-HOWTO section: "Stty". "modemstat" or "statserial" will show the current state of + "modemstat" or "statserial" will show the current state of various modem signal lines (such as DTR, CTS, etc.) "irqtune" will give serial port interrupts higher priority to improve performance. @@ -4558,13 +4391,13 @@ Here's an example session for a certain Rockwell modem (C-a is ^A): Misc

-man pages for: man pages for: Your modem manual (if it exists). Some modems come without manuals. by Vern Hoxie is a collection of blurbs about the care and - feeding of the Linux serial port plus some simple programs. + feeding of the Linux serial port plus some simple programs. The Linux serial mailing list. To subscribe, send email to , with @@ -4582,7 +4415,7 @@ Contains too much info about obsolete topics. More up-to-date info may be found on the Internet. Modems For Dummies by Tina Rathbone, 1996. (Have never seen it.) The Modem Technical Guide by Douglas Anderson, 1996. -Ultimate Modem Handbook by Cass R. Lewart, 1998. +Ultimate Modem Handbook by Cass R. Lewart, 1998. Black, Uyless D.: Physical Layer Interfaces & Protocols, IEEE Computer Society Press, Los Alamitos, CA, 1996. @@ -4591,7 +4424,7 @@ may be found on the Internet.

Cable-Modem mini-howto ISDN Howto (not a LDP Howto) : drivers for ISDN +url="http://sdb.suse.de/sdb/en/html/isdn.html">: drivers for ISDN "Modems". Much related info on this is in German. Linux-Modem-Sharing mini-howto. Computers on a network share a single modem for dial-out (like a shared printer). @@ -4601,21 +4434,18 @@ a single modem for dial-out (like a shared printer). Serial-HOWTO has info on Multiport Serial Cards used for both terminals and banks of modems. Covers the serial port in more detail than in the HOWTO. -Serial-Programming-HOWTO: for some aspects of serial-port programming +Serial-Programming-HOWTO: for some aspects of serial-port programming Text-Terminal-HOWTO: (including connecting up with modems) UUCP-HOWTO: for information on setting up UUCP Usenet newsgroups

- comp.os.linux.answers -FAQs, How-To's, READMEs, etc. about Linux. - comp.os.linux.hardware -Hardware compatibility with the Linux operating system. - comp.os.linux.setup -Linux installation and system administration. - comp.dcom.modems -Modems for all OS's + comp.os.linux.answers; FAQs, How-To's, READMEs, etc. about Linux. + comp.os.linux.hardware; Hardware compatibility with the + Linux operating system. + comp.os.linux.setup; Linux installation and system administration. + comp.dcom.modems; Modems for all OS's Web Sites

While I haven't intentionally tried to mislead you, there are @@ -103,7 +109,7 @@ be a trademark). Such trademarks belong to their respective owners. Credits -

Most of the original Serial-HOWTO was written by Greg Hankins. +

Most of the original Serial-HOWTO was written by Greg Hankins. He also rewrote many contributions by others in order to maintain continuity in the writing style and flow. He wrote: ``Thanks to @@ -120,10 +126,11 @@ sites see: . Various formats are available. If you only want to quickly check the date of the latest version look at and compare -it to this version: v2.13 August 2001 . New in recent versions: -v.2.13 August 2001: fixed typos: done->down and "is is", USRT chip, +it to this version: v2.14 August 2001 . New in recent versions: +v2.14 August 2001: major revision of Configuring the Serial Port +v2.13 August 2001: fixed typos: done->down and "is is", USRT chip, synchronous defined better -v2.12 July 2001: serial printing under LPRng +v2.12 July 2001: serial printing under LPRng v2.11 May 2001: stty 0 => hangup (was ok in v2.08. ) v2.10 EIA-485, frame errors on networks, gkermit, firewire @@ -142,7 +149,7 @@ explained above. C programs (or parts of them) that read and write to the serial port and/or check/set its state. A new version has been written by Vern Hoxie but not submitted. A copy is at . -Text-Terminal-HOWTO is about how they work, how to install +Text-Terminal-HOWTO is about how they work, how to install configure, and repair them. It includes a section on "Make a Terminal the Console" which is useful for using a remote terminal to control a server (via the serial port). @@ -150,9 +157,9 @@ explained above. Feedback

-Please send me any questions, comments, suggestions, or additional +Please send me any questions, comments, suggestions, or additional material. I'm always eager to hear about what you think about this -HOWTO. I'm also always on the lookout for improvements! Tell me +HOWTO. I'm also always on the lookout for improvements! Tell me exactly what you don't understand, or what could be clearer. You can reach me via email at (David Lawyer). @@ -162,7 +169,7 @@ Lawyer). port) is a very old I/O port. Almost all PC's have them. But Macs (Apple Computer) after mid 1998 (with colored cases) only have the USB port. It's possible, however, to put a conventional serial port -device on the USB. +device on the USB. The common specification for the conventional serial port is RS-232 (or EIA-232). The connector for the serial port is often seen as one @@ -194,7 +201,7 @@ you just installed another serial port in your PC.

Below is an introduction to the topic, but for a more advanced treatment of it see . - Transmitting + Transmitting

Transmitting is sending bytes out of the serial port away from the computer. Once you understand transmitting, receiving is easy to understand since it's similar. The first explanation given here will @@ -218,7 +225,7 @@ the last bit has been sent and the shift register needs another byte to send it could just ask the CPU to send it another byte. Thus would be simple but it would likely introduce delays since the CPU might not be able to get the byte immediately. After all, the CPU is usually -doing other things besides just handling the serial port. +doing other things besides just handling the serial port. A way to eliminate such delays is to arrange things so that the CPU gets the byte before the shift register needs it and stores it in a @@ -232,7 +239,7 @@ today it is usually 16 bytes (more in higher priced serial ports). Now there is still the problem of keeping this buffer sufficiently supplied with bytes so that when the shift register needs a byte to transmit it will always find one there (unless there are no more bytes -to send). This is done by contacting the CPU using an interrupt. +to send). This is done by contacting the CPU using an interrupt. First we'll explain the case of the old fashioned one-byte buffer, since 16-byte buffers work similarly (but are more complex). When the @@ -253,17 +260,17 @@ has happened. It finds out that the serial's transmit buffer is empty and waiting for another byte. So if there are more bytes to send, it sends the next byte to the serial port's I/0 address. This next byte should arrive when the previous byte is still in the transmit shift -register and is still being transmitted bit-by-bit. +register and is still being transmitted bit-by-bit. In review, when a byte has been fully transmitted out the transmit wire of the serial port and the shift register is now empty the following 3 things happen almost simultaneously: - + The next byte is moved from the transmit buffer into -the transmit shift register +the transmit shift register The transmission of this new byte (bit-by-bit) begins - Another interrupt is issued to tell the device driver to send + Another interrupt is issued to tell the device driver to send yet another byte to the now empty transmit buffer @@ -315,7 +322,7 @@ been received, there could be 16 bytes to get if 2 more bytes have arrived since the interrupt. But if 3 more bytes should arrive (instead of 2), then the 16-byte buffer will overrun. It also may pick up less than 14 bytes by setting it that way or due to timeouts. -See for more details. +See for more details. The Large Serial Buffers

We've talked about small 16-byte serial port hardware @@ -333,7 +340,7 @@ transmit buffer in the hardware. Serial Port Basics

The serial port (not the USB) is usually a RS-232-C, EIA-232-D, or EIA-232-E. These three are almost the same thing. The original RS (Recommended Standard) prefix became EIA (Electronics Industries @@ -469,7 +476,7 @@ ttyS2) and thus it can't be used. See for more details> Interrupts

+

When the serial port receives a number of bytes (may be set to 1, 4, 8, or 14) into its FIFO buffer, it signals the CPU to fetch them by @@ -499,7 +506,7 @@ to remove such received bytes promptly, then there will not be any space left for any more incoming bytes and the small buffer may overflow (overrun) resulting in a loss of data bytes. There is no to prevent -this. +this. Interrupts are also issued when the serial port has just sent out all 16 of its bytes from its small transmit buffer out the external cable. @@ -514,8 +521,8 @@ also has large buffers in main memory. This will be explained later Interrupts convey a lot of information but only indirectly. The interrupt itself just tells a chip called the interrupt controller that a certain serial port needs attention. The interrupt controller -then signals the CPU. The CPU runs a special program to service the -serial port. That program is called an interrupt service routine +then signals the CPU. The CPU then runs a special program to service +the serial port. That program is called an interrupt service routine (part of the serial driver software). It tries to find out what has happened at the serial port and then deals with the problem such a transferring bytes from (or to) the serial port's hardware buffer. @@ -534,7 +541,7 @@ contents, finds out what has happened and takes appropriate action.

Data (bytes representing letters, pictures, etc.) flows into and out of your serial port. Flow rates (such as 56k (56000) bits/sec) are (incorrectly) called "speed". But almost everyone says "speed" -instead of "flow rate". +instead of "flow rate". It's important to understand that the average speed is often less than the specified speed. Waits (or idle time) result in a lower average @@ -550,9 +557,9 @@ be reduced.

Flow control means the ability to slow down the flow of bytes in a wire. For serial ports this means the ability to stop and then restart the flow without any loss of bytes. Flow control is needed -for modems to allow a jump in instantaneous flow rates. +for modems to allow a jump in instantaneous flow rates. - Example of Flow Control + Example of Flow Control

For example, consider the case where you connect a 36.6k external modem via a short cable to your serial port. The modem sends and receives bytes over the phone line at 36.6k bits per second (bps). @@ -564,7 +571,7 @@ However the flow from your modem out the phone line is only 33.6k bps. Since a faster flow (115.2k) is going into your modem than is coming out of it, the modem is storing the excess flow (115.2k -33.6k = 81.6k bps) in one of its buffers. This buffer would soon overrun (run out -of free storage space) unless the high 115.2k flow is stopped. +of free storage space) unless the high 115.2k flow is stopped. But now flow control comes to the rescue. When the modem's buffer is almost full, the modem sends a stop signal to the serial port. The @@ -629,7 +636,7 @@ contiguous chunks. Hardware vs. Software Flow Control

If feasible it's best to use "hardware" flow control that uses two dedicated "modem control" wires to send the "stop" and "start" -signals. +signals. Software flow control uses the main receive and transmit wires to send @@ -640,7 +647,7 @@ in reacting but also does not allow the sending of binary data unless special precautions are taken. Since binary data will likely contain DC1 and DC3, special means must be taken to distinguish between a DC3 that means a flow control stop and a DC3 that is part of the binary -code. Likewise for DC1. +code. Likewise for DC1. Data Flow Path; Buffers @@ -649,8 +656,8 @@ control, a pair of 16-byte FIFO buffers (in the UART), and a pair of larger buffers inside a device connected to the serial port (such as a modem. But there is still another pair of buffers. These are large buffers (perhaps 8k) in main memory also known as serial port buffers. -When an application program sends bytes to the serial port - +When an application program sends bytes to the serial port + they first get stashed in the the transmit serial port buffer in main memory. The pair consists of both this transmit buffer and a receive buffer for the opposite direction of byte-flow. Here's an example @@ -676,7 +683,7 @@ from the large transmit buffer in main memory. Even after this has happened and the flow to the device connected to the serial port has stopped, an application program may keep sending bytes to the 8k transmit buffer until it becomes -fill. +fill. When it gets fill, the application program can't send any more bytes to it (a "write" statement in a C_program blocks) and the application @@ -705,7 +712,7 @@ text-terminal has a limit to the speed at which bytes can be displayed on its screen and issues a flow control "stop" from time to time to slow down the flow. What happens when such a "stop" is issued? Let's consider a case where the "stop" is long enough to get thru to the BBS -and stop the program at the BBS which is sending out the bytes. +and stop the program at the BBS which is sending out the bytes. Let's trace out the flow of this "stop" (which may be "hardware" on some links and "software" on others). First, suppose I'm "capturing" @@ -728,7 +735,7 @@ a "stop signal" to the other modem at the BBS. This modem stops sending bytes out of its buffer and when its buffer gets fill, another stop signal is sent to the serial port of the BBS. At the BBS, the 8-k (or whatever) buffer fills up and the program at the BBS can't -write to it anymore and thus temporarily halts. +write to it anymore and thus temporarily halts. Thus a stop signal from a text terminal has halted a programs on a BBS computer. What a complex sequence of events! Note that the stop @@ -745,7 +752,7 @@ stopping the program that is sending from the BBS as explained above. But you may ask: How can a "stop" last so long that 11 buffers (some of them large) all get filled up? It can actually happen this way if all the buffers were near their upper limits when the terminal sent -out the "stop". +out the "stop". But if you were to run a simulation on it you would discover that it's usually more complicated than this. At an instant of time some links @@ -790,8 +797,8 @@ the module is used by -See for more info on - for more info on + @@ -841,7 +848,7 @@ this purpose many I/O devices (such as serial ports) use a special type of address known as an I/O addresses (sometimes called an I/O port). It's actually a range of addresses and the lower address in this range is the base address. If someone only says (or writes) -"address" it likely really means "base address" +"address" it likely really means "base address" Instead of using I/O, addresses some I/O devices read and write directly from/to main memory. This provides more bandwidth since the @@ -856,8 +863,8 @@ with its interrupt driven (every 14 bytes) interface and single bytes transfers on a bus which could accommodate 4 (or 8) bytes at a time is not suited for very high speed I/O. - Multiport Serial Boards/Cards/Adapters - Intro to Multiport Serial + Multiport Serial Boards/Cards/Adapters + Intro to Multiport Serial

Multiport serial cards install in slots in a PC on the ISA or PCI bus. Instead of being called "... cards" they are also called "... @@ -887,7 +894,7 @@ digital modem and have a digital connection to a digital phone line (such as a T1 line). Modem banks that connect to multiport cards do exist, and some have a card that can access multiplexed digital phone lines. Thus one can use a multiport card with a few 56k digital -modems. +modems. For both analog and digital modem there is one modem on each serial port so there needs to be an external cable (modem bank to multiport) @@ -895,7 +902,7 @@ for each modem. This can lead to a large number of cables. So it's less clutter (and cheaper) to use internal modems without a multiport card. It's somewhat analogous to the lower cost of an internal modem for a desktop PC as compared to the higher cost (and more cabling) for -an external modem. See Modem-HOWTO: Modem Pools, Digital Modems. +an external modem. See Modem-HOWTO: Modem Pools, Digital Modems. Dumb vs. Smart Cards

Dumb multiport cards are not too much different than ordinary serial @@ -905,7 +912,7 @@ sharing a single interrupt for all the ports. This doesn't decrease the load on the CPU since the single interrupt will be sent to the CPU each time any one port needs servicing. Such devices usually require special drivers that you must put into the kernel or activate by -putting a #define in the source code (or the like). +putting a #define in the source code (or the like). Smart boards may use ordinary UARTs but handle most interrupts from the UARTs internally within the board. This frees the CPU from the @@ -953,7 +960,7 @@ You might also want to look at the kernel documentation in to compiling see: Configure.help and search for "serial", etc. There are also kernel documentation files for certain boards including computone, hayes-esp, moxa-smartio, riscom8, specialix, stallion, and -sx (specialix). +sx (specialix). Making multiport devices in the /dev directory

@@ -993,7 +1000,7 @@ may have some different links.

In olden days PCs came with a serial card installed. Later on the serial function was put on the hard-drive interface card. Today, one or two serial ports are usually built into the motherboard. Most of -them (as of 2001) use a 16550 but some use 16650 (32-byte FIFOs). +them (as of 2001) use a 16550 but some use 16650 (32-byte FIFOs). But one may still buy the old PC serial cards if they need 1-4 more serial ports. These are for ttyS0-ttyS3 (COM1 - COM4). They can be used to connect external serial devices (modems, serial mice, etc...). @@ -1005,7 +1012,7 @@ Here's a list of a few popular brands: Byte Runner (may order directly, shows prices) - SIIG + SIIG Dolphin

@@ -1014,7 +1021,7 @@ IBM8514 video card (or some others) simultaneously. See -Dumb Multiport Serial Boards (with standard UART chips) +Dumb Multiport Serial Boards (with standard UART chips)

They are also called "serial adapters". They often have a special method of sharing interrupts which requires that you compile support for them into the kernel. @@ -1043,7 +1050,7 @@ support for them into the kernel. Moxa C104, Moxa C104+ (AST FourPort compatible) * by National Instruments -PC-COMM (4 ports) PC-COMM (4 ports) COMM-2 (2 ports), COMM-4 (4 ports) and COMM-8 (8 ports) SIIG I/O Expander 2S IO1812 (4 ports) # @@ -1053,11 +1060,11 @@ url="http://digital.natinst.com/manuals.nsf/web%2Fbyproductcurrent?OpenView& VScom (uses same driver as ByteRunner)

-In general, Linux will support any serial board which uses a 8250, +In general, Linux will support any serial board which uses a 8250, 16450, 16550, 16550A, 16650, etc. UART. See the latest man page for "setserial" for a more complete list. -Notes: +Notes: AST Fourport: You might need to specify driver status: for 2.2 kernel. Supported by Chase. Comtrol RocketPort (36MHz ASIC; 4, 8, 16, 32, up to 128 ports) - webpage: + webpage: driver status: supported by Comtrol. rocket.o - driver location: -Computone IntelliPort II (ISA, PCI and EISA busses up to 64 +Computone IntelliPort II (ISA, PCI and EISA busses up to 64 ports) webpage: driver location: , - patch at - mailing list: with + mailing list: with "subscribe linux-computone" in body note: Old ATvantage and Intelliport cards are not supported by Computone Connecttech website: driver location: - -Cyclades + +Cyclades Cyclom-Y (Cirrus Logic CD1400 UARTs; 8 - 32 ports), Cyclom-Z (MIPS R3000; 8 - 64 ports) website: driver status: supported by Cyclades driver location: and included in Linux + name="ftp://ftp.cyclades.com/pub/cyclades"> and included in Linux kernel since version 1.1.75: cyclades.o Decision PCCOM (2-8 ports; ISA and PCI; AKA PC COM) @@ -1149,9 +1156,9 @@ driver status: for 2.2 kernel. Supported by Chase. PC/Xem (20MHz IDT3051; 8 - 64 ports) website: driver status: supported by Digi - driver location: and + name="ftp://ftp.dgii.com/drivers/linux"> and included in Linux kernel since version 2.0. epca.o Digi COM/Xi (10MHz 80188; 4 or 8 ports) @@ -1167,8 +1174,8 @@ driver status: for 2.2 kernel. Supported by Chase. website: driver status: supported by Equinox - driver location: Globetek @@ -1182,26 +1189,26 @@ driver status: for 2.2 kernel. Supported by Chase. website: driver status: supported by GTEK - driver location: - -Hayes ESP (COM-bic; 1 - 8 ports) + +Hayes ESP (COM-bic; 1 - 8 ports) website: driver status: Supported by Linux kernel (1998) since v. 2.1.15. - esp.o. Setserial 2.15+ supports. Also supported by author + esp.o. Setserial 2.15+ supports. Also supported by author driver location: + name="http://www.nyx.net/˜arobinso"> Intelligent Serial Interface by Multi-Tech Systems PCI: 4 or 8 port. ISA 8 port. DTE speed 460.8k webpage: Maxpeed SS (Toshiba; 4, 8 and 16 ports) - website: driver status: supported by Maxpeed - driver location: Microgate SyncLink ISA and PCI high speed multiprotocol @@ -1209,35 +1216,35 @@ driver status: for 2.2 kernel. Supported by Chase. website: driver status: supported by Microgate: synclink.o - -Moxa C218 (12MHz 80286; 8 ports), + +Moxa C218 (12MHz 80286; 8 ports), Moxa C320 (40MHz TMS320; 8 - 32 ports) website: driver status: supported by Moxa - driver locations: (also from Taiwan at www.moxa.com.tw/...) where ... is the same as above) SDL RISCom/8 (Cirrus Logic CD180; 8 ports) - website: driver status: supported by SDL driver location: - + Specialix SX (25MHz T225; 8? - 32 ports), SIO/XIO (20 MHz Zilog Z280; 4 - 32 ports) webpage: driver status: Supported by Specialix driver location: - old driver location: Stallion EasyIO-4 (4 ports), EasyIO-8 (8 ports), and - EasyConnection (8 - 32 ports) - each with + EasyConnection (8 - 32 ports) - each with Cirrus Logic CD1400 UARTs, Stallion (8MHz 80186 CPU; 8 or 16 ports), Brumby (10/12 MHz 80186 CPU; 4, 8 or 16 ports), @@ -1245,7 +1252,7 @@ driver status: for 2.2 kernel. Supported by Chase. EasyConnection 8/64 (25MHz 80186 CPU; 8 - 64 ports) contact: or - driver status: supported by Stallion driver location: System Base website: - +

-A review of Comtrol, Cyclades, Digi, and Stallion products was printed -in the June 1995 issue of the . +A review of Comtrol, Cyclades, Digi, and Stallion products was printed +in the June 1995 issue of the . Unsupported Multiport Boards

The following boards don't mention any Linux support as of 1 Jan. @@ -1270,27 +1277,135 @@ name="http://www.ssc.com/lj/issue14">. Aurora (PCI only) -Configuring the Serial Port +Configuring Overview +

The first part (locating the hardware or low-level configuring) is +assigning each port an IO address, IRQ, and name (such as ttyS2). This +IO-IRQ pair must be set in both the hardware and told to the serial +driver. We might just call this "io-irq" configuring for short. The +"setserial" program is sometimes used to tell the driver. PnP +methods, jumpers, etc, are used to set the hardware. Details will be +supplied later. If you need to configure but don't understand certain +details it's easy to get into trouble. +See + +The second part (high-level configuring) is assigning it a speed (such +as 115.2k bits/sec), selecting flow control, etc. This is often done +by communication programs such as PPP, minicom, or by getty (which you +may run on the port so that others may log into your computer). +However you will need to tell these programs what speed you want, etc. +by using a menu or a configuration file. This high-level configuring +may also be done with the + +Locating the Serial Port: IO address, IRQs

-Although most PCI modems are "winmodems" without a -Linux driver (and will not work under Linux), other PCI serial cards -(usually modem cards) will often work OK under Linux. Some need no -special support in the serial driver and work fine under Linux once -setserial is used to configure them. Other PCI cards need special -support in the kernel. Some of these cards are supported by kernel -2.4 (and in later versions of the 2.3 series). Kernel 2.2 has no such -support. If your modem (or serial port) happens to be supported, then -you shouldn't need to do anything to PnP configure it. The new serial -driver will read the id number digitally stored on the card to -determine how to support the card. It should assign the I/O address -to it, determine it's IRQ, etc. So you don't need to use "setserial" -for it. + IO & IRQ Overview +

For a serial port to work properly, it must have both an IRQ and +an IO address. Without an IO address, it can't be located and will not +work at all. Without an IRQ it will need to use inefficient polling +methods for which one must set the IRQ to 0. So every serial port +needs an IO address and IRQ. In olden days this was set by jumpers on +a serial port card. Today it's set by digital signals sent to the +hardware and this is part of "Plug-and-Play (PnP). + +The driver must also know both the IO address and IRQ so that it can +locate the card. Modern drivers (kernel 2.4) determine this by PnP +methods so one doesn't need to tell them (by using "setserial"). The +driver uses PnP functions provided by Linux to determine what the IO +and IRQ are and to set them if necessary. The driver also probes +possible serial port addresses to see if there are any serial ports +there. This works for the case of jumpers and sometimes works for a +PnP port when the driver doesn't do PnP. + +Locating the serial port by giving it an IRQ and IO address is +low-level configuring. What follows repeats what was said above in +more detail. This low-level configuring consists of assigning an IO +address, IRQ, and name (such as ttyS2). This IO-IRQ pair must be set +in both the hardware and told to the serial driver. We could call +this "io-irq" configuring for short. The "setserial" program is one +way to tell the driver. The other way is for the driver to use PnP +methods to determine/set the IO/IRQ and then remember what it did. +For jumpers you must always use "setserial". If you need to configure +but don't understand certain details it's easy to get into trouble. + +When Linux starts, some effort is made to detect and configure +(low-level) a few serial ports. Exactly what happens depends on your +BIOS, hardware, Linux distribution, etc. If the serial ports work OK, +there may be no need for you to do any more low-level configuring. + +If you're having problems with the serial ports, then you may need to +do low-level configuring. If you have kernel 2.2 or lower, +then you need to do it if you: + + + Plan to use more than 2 ISA serial ports + Are installing a new serial port (such as an internal modem) + + +For kernel 2.2+ you may be able to use more that 2 serial ports +without doing any low-level configuring by sharing interrupts. All +PCI cards should support this but for ISA it only works for some +hardware. It may be just as easy to give each port a unique interrupt +if they is available. See + +The low-level configuring (setting the IRQ and IO address) seems to +cause people more trouble than the high-level, although for many it's +fully automatic and there is no configuring to be done. Until the +serial driver knows the correct IRQ and IO address, the port will not +usually not work at all. Also, PnP ports can be disabled so that they +can't be found (except with PnP tools). Applications, and utilities +such as "setserial" and "scanport" don't use PnP tools and thus can't +detect disabled ports. For example, an IO enabling bit must be set in +PCI serial port hardware by PnP so that it's IO address may be used. + +Even if the port can be found by normal (non-PnP) software, it may +work extremely slow if the IRQ is wrong. See . + +In the Wintel world, the IO address and IRQ are called "resources" and +we are thus configuring certain resources. But there are many other +types of "resources" so the term has many other meanings. In summary, +the low-level configuring consists of enabling the device, giving it a +name (ttyS2 for example) and putting two values (an IRQ number and IO +address) into two places: + + + the device driver (often by running " memory registers of the serial port hardware itself + + +You may watch the start-up (= boot-time) messages. They are usually +correct. But if you're having problems, there's a good chance that +the ones that look like "setserial" output don't show the true +configuration of the hardware (and they are not necessarily supposed +to). See . + + PCI Bus Support

+ + +If you have kernel 2.4, then there should be support for PnP (either +built-in or by modules). Some PCI serial cards can be automatically +detected and low-level configured by the serial driver. Others will +not be. +Kernel 2.2 had no support for PCI serial ports (although some people +got them working anyway). The 2.4 serial driver will read the id +number digitally stored on the serial hardware to determine how to +support it (if it knows how). It should assign the I/O address to it, +determine it's IRQ, etc. So you don't need to use "setserial" for it +?? If you have a @@ -1299,8 +1414,12 @@ Serial-HOWTO. If you just have a PCI serial port card (with no modem on the card) but it will not work because the latest serial driver doesn't support it, you can help in attempting to create a driver for it. To do this you'll need to contact the maintainer of the serial driver, Theodore -(Ted) Y. Ts'o. - You will need to email Ted Ts'o a +(Ted) Y. Ts'o. + + +Look at for the details of what you need to do. Here's a summary of +what you need to do to help him. You will need to email Ted Ts'o a copy of the output of "lspci -vv" with full information about the model and manufacturer of the PCI modem (or serial port). Then he will try to point you to a test driver which might work for it. You @@ -1310,94 +1429,29 @@ and report the results to Ted Ts'o. If you are willing to do all the above (and this is the latest version of this HOWTO) then email the needed info to him at: . -PCI modems are not well standardized. Some use main memory for -communication with the PC. It you see 8-digit hexadecimal addresses -it's not likely to work with Linux. Some require special enabling of -the IRQ. The output of "lspci" can help determine if one can be -supported. If you see a 4-digit IO port and no long memory address, -the modem might work by just telling "setserial" the IO port and the -IRQ. Some people have gotten a 3COM 3CP5610 PCI Modem to work that -way. +PCI ports are not well standardized. Some use main memory for +communication with the PC. Some require special enabling of the IRQ. +The output of "lspci -vv" can help determine if one can be supported. +If you see a 4-digit IO port, the port might work by just telling +"setserial" the IO port and the IRQ. +For example, if lspci shows IRQ 10, I/O at 0xecb8 and you decide to +name it ttyS2 then the command is: - Configuring Overview

In many cases, configuring will happen automatically and you have -nothing to do. But sometimes you need to configure (or just want to -check out the configuration). If so, first you need to know about the -two parts to configuring the serial port under Linux: +setserial /dev/ttyS2 irq 10 port 0xecb8 autoconfig -The first part (low-level configuring) is assigning it an IO address, -IRQ, and name (such as ttyS2). This IO-IRQ pair must be set in both -the hardware and told to the serial driver. We might just call this -"io-irq" configuring for short. The -When Linux starts, some effort is made to detect and configure -(low-level) a few serial ports. Exactly what happens depends on your -BIOS, hardware, Linux distribution, etc. If the serial ports work OK, -there may be no need for you to do any configuring. Application -programs often do the high-level configuring but you may need to -supply them with the required information. With Plug-and-Play serial -ports (often built into an internal modem), the situation has become -more complex. Here are cases when you need to do low-level -configuring (set IRQ and IO addresses): - - - Plan to use more than 2 serial ports - Installing a new serial port (such as an internal modem) - Having problems with serial port(s) - - -For kernel 2.2+ you may be able to use more that 2 serial ports -without low-level configuring by sharing interrupts. This only works -if the serial hardware supports it and may be no easier than low-level -configuring. See - -The low-level configuring (setting the IRQ and IO address) seems to -cause people more trouble (than high-level), although for many it's -fully automatic and there is no configuring to be done. Thus most all -of this section is on that topic. Until the serial driver knows the -correct IRQ and IO address the port will not work at all. It may not -even be found by Linux. Even if it can be found, it may work -extremely slow if the IRQ is wrong. See . - -In the Wintel world, the IO address and IRQ are called "resources" and -we are thus configuring certain resources. But there are many other -types of "resources" so the term has many other meanings. In review, -the low-level configuring consists of putting two values (an IRQ -number and IO address) into two places: - - - the device driver (often by running " memory registers of the serial port hardware itself - - -You may watch the start-up (= boot-time) messages. They are usually -correct. But if you're having problems, there's a good chance that -some of these messages don't show the true configuration of the -hardware (and they are not supposed to). See . +Note that the boot-time message "Probing PCI hardware" means reading +the PnP configuration registers in the PCI cards which reveals the IO +addresses and IRQs. This is different that the probing of IO +addresses by the serial driver which means reading certain IO +addresses to see if what's read looks like there's a serial port at +that address. Common mistakes made re low-level configuring

Here are some common mistakes people make: setserial command: They run it (without the "autoconfig" and - auto_irq options) and think it has checked out the hardware (it - hasn't). + auto_irq options) and think it has checked the hardware to see if + what it shows is correct (it hasn't). setserial messages: They see them displayed on the screen at boot-time (or by giving the setserial command) and erroneously think that the result always shows how their hardware is actually @@ -1410,7 +1464,38 @@ name="I/O Address & IRQ: Boot-time messages">. same info (possibly erroneous) as setserial. - I/O Address & IRQ: Boot-time messages

There are really two answers to the question "What is my IO and +IRQ?" 1. What the device driver thinks has been set (This is what +setserial usually sets and shows.). 2. What is actually set in the +hardware. Both 1. and 2. above should be the same. If they're not it +spells trouble since the driver has incorrect info on the physical +serial port. In some cases the hardware is disabled so it has no IO +address or IRQ. + +If the driver has the wrong IO address it will try to send data to a +non-existing serial port --or even worse, to some other device. If it +has the wrong IRQ the driver will not get interrupt service requests +from the serial port, resulting in a very slow or no response. See +. If it has the wrong model of UART there +is also apt to be trouble. To determine if both I0-IRQ pairs are +identical you must find out how they are set in both the driver and +the hardware. + + What is the IO Address and IRQ per the driver ? + Introduction +

What the driver thinks is not necessarily how the hardware is +actually set. If everything works OK then what the driver thinks is +likely correct (set in the hardware) and you don't need to investigate +(unless you're curious or want to become a guru). Ways to determine +what the driver thinks include: boot-time messages , the +/proc directory "files" , and the "setserial" command. + + + I/O Address & IRQ: Boot-time messages

In many cases your ports will automatically get low-level configured at boot-time (but not always correctly). To see what is happening, look at the start-up messages on the screen. Don't neglect @@ -1418,10 +1503,10 @@ to check the messages from the BIOS before Linux is loaded (no examples shown here). These BIOS messages may be frozen by pressing the Pause key. Use Shift-PageUp to scroll back to the messages after they have flashed by. Shift-PageDown will scroll in the opposite -direction. The At first you see what was detected (but the irq is only a wild guess): @@ -1431,7 +1516,8 @@ ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A ttyS02 at 0x03e8 (irq = 4) is a 16550A -Later you see what was saved, but it's not necessarily correct either: +Later setserial shows you what was saved, but it's not necessarily +correct either: Loading the saved-state of the serial devices... /dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A @@ -1440,12 +1526,12 @@ Loading the saved-state of the serial devices... Note that there is a slight disagreement: The first message shows -ttyS2 at irq=4 while the second shows it at irq=5. Your may only have -the first message. In most cases the last message is the correct one. -But if your having trouble it may be misleading. Before reading the -explanation of all of this complexity in the rest of this section, you -might just try using your serial port and see if it works OK. If so -it may not be essential to read further. +ttyS2 at irq=4 while the second shows it at irq=5. dmesg may not +display the second message. In most cases the second message is the +correct one. But if your having trouble it may be misleading. Before +reading the explanation of all of this complexity in the rest of this +section, you might just try using your serial port and see if it works +OK. If so it may not be essential to read further. The second message is from the What is the current IO address and IRQ of my Serial Port ? -

If your serial port seems to work OK, then you may type "setserial --g /dev/ttyS*", look at /proc/tty/driver/serial, or inspect the -start-up messages. If you serial port doesn't work (or is very slow) -then you need to read further. - -There are really two answers to the question "What is my IO and -IRQ?" 1. What the device driver thinks has been set (This is what -setserial usually sets and shows). 2. What is actually set in the -hardware. They both should be the same. If they're not it spells -trouble since the driver has incorrect info on the physical serial -port. If the driver has the wrong IO address it will try to send data -to a non-existing serial port --or even worse, to some other device. -If it has the wrong IRQ the driver will not get interrupt service -requests from the serial port, resulting in a very slow or no -response. See . If it has the wrong model of -UART there is also apt to be trouble. To determine if both I0-IRQ -pairs are identical you must find out how they are set in both the -driver and the hardware. - - What does the device driver think? -

This is easy to find out. Just look at the start-up messages or -type "setserial -g /dev/ttyS*". If everything works OK then what -it tells you is likely also set in the hardware. There are some other + The /proc directory and setserial

Type "setserial -g /dev/ttyS*". There are some other ways to find this info by looking at "files" in the /proc directory. Be warned that there is no guarantee that the same is set in the hardware. /proc/ioports will show the IO addresses that the drivers are using. -/proc/interrupts shows the IRQs that are used by drivers of +/proc/interrupts shows the IRQs that are used by drivers of currently running processes (that have devices open). It shows how many interrupts have actually be issued. -/proc/tty/driver/serial shows most of the above, plus the +/proc/tty/driver/serial shows much of the above, plus the number of bytes that have been received and sent (even if the device is not now open). @@ -1526,59 +1589,93 @@ what the driver thinks and not necessarily what is actually set in the hardware. The data on the actual number of interrupts issued and bytes processed is real however. If you see a large number of interrupts and/or bytes then it probably means that the device is (or -was in the case of bytes) working. If there are no bytes received -(rx:0) but bytes were transmitted (tx:3749 for example), then only one -direction of flow is working (or being utilized). +was) working. But the interrupts might be from another device. If +there are no bytes received (rx:0) but bytes were transmitted (tx:3749 +for example), then only one direction of flow is working (or being +utilized). Sometimes a showing of just a few interrupts doesn't mean that the interrupt is actually being physically generated by any serial port. Thus if you see almost no interrupts for a port that you're trying to -use, that interrupt might not be set in the hardware and it implies -that the driver is using the wrong interrupt. To view +use, that interrupt might not be set in the hardware. To view /proc/interrupts to check on a program that you're currently running (such as "minicom") you need to keep the program running while you view it. - What is set in my serial port hardware ?

If it's PCI or ISA PnP then what's set in the hardware has been done +by PnP methods. Even if nothing has been set or the port disabled, +PnP ports may still be found by using "lspci -v" or "isapnp +--dumpregs". Ports disabled by jumpers (or hardware failures) are +lost. See , +, + + +PnP ports don't store their configuration in the hardware when the +power is turned off. This is in contrast to Jumpers (non-PnP) which +remain the same with the power off. That's why a PnP port is more +likely to be found in a disabled state than an old non-PnP one. + + PCI: What IOs and IRQs have been set?

For PCI, the BIOS almost always sets the IRQ and may set the IO +address as well. To see how it's set use "lspci -vv" (best) or look +in /proc/bus/pci (or for kernels <2.2 /proc/pci). The modem's +serial port is often called a "Communication controller". If more +than one IO address is shown, the first one is more likely to be it. +You can't change the IRQ (at least not with "setpci") This is +because if one writes it in it's hardware register no action is taken +on it. It's the BIOS that should actually set up the IRQs and then +write the correct value to this register for lspci to view. If you +must, change the IO address with "setpci" by changing the +BASE_ADDRESS_0 or the like. The _0 (or _1) after BASE_ADDRESS must be +the correct register. + + PCI: Is the port enabled?

If the port communicates via an IO address "then lspci -vv" should +show "Control: I/O+ ..." with + meaning that the IO address is +enabled. If it shows "I/O-" then you may need to use the setpci +command to enable it. For example "setpci -d 151f:000 command=101". +The "command" means the command register which is the same as the +"Control" register displayed by lspci. The 101h sets two bits: the 1 +sets I/O to + and the 100 part keeps SERR# set to +. In this case +only the SERR# bit of the Control register was initially observed to +be + when the lspci command was run. So we kept it enabled to + by +setting bit 8 (where bit 0 is I/O) to 1 by the first 1 in 101. My +apologies if setting bits is confusing. Bit 8 is actually the 9th bit +since we started counting bits from 0. + +ISA PnP ports

For an ISA Plug-and-Play (PnP) port one may try the Finding a port that is not disabled (ISA, PCI, PnP, non-PnP) +

Perhaps the BIOS messages will tell you some info before Linux +starts booting. Use the shift-PageUp key to step back thru the +boot-time messages and look at the very first ones which are from the +BIOS. This is how it was before Linux started. Setserial can't +change it but isapnp or setpci can. Starting with kernel 2.4, these +are built into the serial driver. Using "scanport" will probe all I/O ports and will indicate what it thinks may be serial port. After this you could try probing with setserial using the "autoconfig" option. You'll need to guess the addresses to probe at (using clues from "scanport"). See . If your -serial port is is ISA Plug-and-Play or PCI see the next two subsections. +id="set_serial" name="What is Setserial">. -For a port set with jumpers, its how the jumpers were set. If the -port is not Plug-and-Play (PnP) but has been setup by using a DOS -program then it's set at whatever the person who ran that program set -it to. +For a port set with jumpers, the IO ports and IRQs are set per the +jumpers. If the port is not Plug-and-Play (PnP) but has been setup by +using a DOS program, then it's set at whatever the person who ran that +program set it to. - What is set in my PnP serial port hardware ? -

PnP ports don't store their configuration in the hardware when the -power is turned off. This is in contrast to Jumpers (non-PnP) which -remain the same with the power off. If you have an ISA PnP port, it -can reach a state where it doesn't have any IO address or IRQ and is -in effect disabled. It should still be possible to find the port -using the Exploring via MS Windows (a last resort) +

For PnP ports, checking on how it's configured under DOS/Windows +may (or may not) imply how it's under Linux. MS Windows stores its configuration info in its Registry which is not used by Linux so they are not necessarily configured the same. If you let a PnP BIOS automatically do the configuring when you start Linux (and have told @@ -1589,12 +1686,12 @@ memory but doesn't necessarily configure it that way. Choosing Serial IRQs

If you have Plug-and-Play ports then either a PnP BIOS or the -serial driver may configure all your devices for you and then you may -not need to choose any IRQs. PnP determines what it thinks is best -and assigns them. But if you use the tools in Linux for Plug-and-Play -(isapnp and pcitools) or jumpers then you have to choose. If you -already know what IRQ you want to use you could skip this section +

If you have Plug-and-Play ports then either a PnP BIOS or a +serial driver may configure all your devices for you so then you may +not need to choose any IRQs. PnP software determines what it thinks +is best and assigns them (but it's not always best). But if you +directly use isapnp (ISA bus) or jumpers then you have to choose. If +you already know what IRQ you want to use you could skip this section except that you may want to know that IRQ 0 has a special use (see the following paragraph). @@ -1602,51 +1699,53 @@ following paragraph).

While IRQ 0 is actually the timer (in hardware) it has a special meaning for setting a serial port with setserial. It tells the driver that there is no interrupt for the port and the driver then will use -polling methods. This is quite inefficient but can be tried if there -is an interrupt conflict or mis-set interrupt. The advantage of -assigning this is that you don't need to know what interrupt is set in -the hardware. It should be used only as a temporary expedient until -you are able to find a real interrupt to use. +polling methods. Such polling puts more load on the CPU but can be +tried if there is an interrupt conflict or mis-set interrupt. The +advantage of assigning IRQ 0 is that you don't need to know what +interrupt is set in the hardware. It should be used only as a +temporary expedient until you are able to find a real interrupt to +use. - Interrupt sharing and Kernels 2.2+

The general rule is that every device should use a unique IRQ and -not share them. But there are situations where sharing is permitted -such as with most multi-port boards. Even when it is permitted, it -may not be as efficient since every time a shared interrupt is given a -check must be made to determine where it came from. Thus if it's -feasible, it's nice to allocate every device its own interrupt. + Interrupt sharing, Kernels 2.2+

Sharing of IRQs is where two devices use the same IRQ. As a +general rule, this wasn't allowed for the ISA bus. The PCI bus may +share IRQs but one can't share the same IRQ between the ISA and the +PCI bus. Most multi-port boards may share IRQs. Sharing is not as +efficient since every time a shared interrupt is given a check must be +made to determine where it came from. Thus if it's feasible, it's +nicer to allocate every device its own interrupt. -Prior to kernel 2.2, serial IRQs could be shared with each other only -for most multiport boards. Starting with kernel 2.2 serial IRQs may -be sometimes shared between all serial ports. In order for sharing to -work in 2.2 the kernel must have been compiled with +Prior to kernel 2.2, serial IRQs could not be shared with each other +except for most multiport boards. Starting with kernel 2.2 serial +IRQs may be sometimes shared between serial ports. In order for +sharing to work in 2.2 the kernel must have been compiled with CONFIG_SERIAL_SHARE_IRQ, and the serial port hardware must support sharing (so that if two serial cards put different voltages on the same interrupt wire, only the voltage that means "this is an -interrupt" will prevail). Thus even if you have 2.2, it may be best -to avoid sharing. +interrupt" will prevail). Since the PCI bus specs permit sharing, any +PCI card should allow sharing. What IRQs to choose? -

The serial hardware often has only a limited number of IRQs it can -be set at. Also you don't want IRQ conflicts. So there may not be -much of a choice. Your PC may normally come with /proc/interrupts will show which IRQs are being used by +

The serial hardware often has only a limited number of IRQs. Also +you don't want IRQ conflicts. So there may not be much of a choice. +Your PC may normally come with /proc/interrupts will show which IRQs are being used by programs currently running. You likely don't want to use one of these. Before IRQ 5 was used for sound cards, it was often used for a serial port. Here is how Greg (original author of Serial-HOWTO) set his up in /etc/rc.d/rc.serial. rc.serial is a file (shell script) which runs at -start-up (it may have a different name of location). For versions of +start-up (it may have a different name or location). For versions of "setserial" after 2.15 it's not always done this way anymore but this example does show the choice of IRQs. /sbin/setserial /dev/ttyS0 irq 3 # my serial mouse /sbin/setserial /dev/ttyS1 irq 4 # my Wyse dumb terminal -/sbin/setserial /dev/ttyS2 irq 5 # my Zoom modem +/sbin/setserial /dev/ttyS2 irq 5 # my Zoom modem /sbin/setserial /dev/ttyS3 irq 9 # my USR modem

@@ -1662,7 +1761,7 @@ Standard IRQ assignments: IRQ 7 Parallel port 1 IRQ 8 Real-time clock IRQ 9 Redirected to IRQ2 - IRQ 10 not assigned + IRQ 10 not assigned IRQ 11 not assigned IRQ 12 not assigned IRQ 13 Math coprocessor @@ -1671,37 +1770,38 @@ Standard IRQ assignments:

-There is really no Right Thing to do when choosing interrupts. Just -make sure it isn't being used by the motherboard, or any other boards. -2, 3, 4, 5, 7, 10, 11, 12 or 15 are possible choices. Note that IRQ 2 -is the same as IRQ 9. You can call it either 2 or 9, the serial -driver is very understanding. If you have a very old serial board it -may not be able to use IRQs 8 and above. +There is really no Right Thing to do when choosing interrupts. Try to +find one that isn't being used by the motherboard, or any other +boards. 2, 3, 4, 5, 7, 10, 11, 12 or 15 are possible choices. Note +that IRQ 2 is the same as IRQ 9. You can call it either 2 or 9, the +serial driver is very understanding. If you have a very old serial +board it may not be able to use IRQs 8 and above. Make sure you don't use IRQs 1, 6, 8, 13 or 14! These are used by your motherboard. You will make her very unhappy by taking her IRQs. -When you are done, double-check /proc/interrupts when -programs that use interrupts are being run and make sure there are no -conflicts. +When you are done you might want to double-check +/proc/interrupts when programs that use interrupts are being +run and make sure there are no conflicts. Choosing Addresses --Video card conflict with ttyS3

The IO address of the IBM 8514 video board (and others like it) is -allegedly 0x?2e8 where ? is 2, 4, 8, or 9. This may conflict with the -IO address of Here's a problem with some old serial cards. The IO address of +the IBM 8514 video board (and others like it) is allegedly 0x?2e8 +where ? is 2, 4, 8, or 9. This may conflict with the IO address of + ttyS0 address 0x3f8 @@ -1729,15 +1829,14 @@ possible methods of configuring PnP serial ports: Using a PnP BIOS CMOS setup menu - (usually only for external + (usually only for external devices on ttyS0 (Com1) and ttyS1 (Com2)) Letting a PnP BIOS automatically configure a PnP serial port See - Doing nothing if you have both a PnP serial port and a PnP - Linux operating system (see Plug-and-Play-HOWTO). + Doing nothing if the serial driver recognized your card OK Using Using pciutils (pcitools) for the PCI bus + Using setpci (pciutils or pcitools) for the PCI bus The IO address and IRQ must be set (by PnP) in their registers each @@ -1748,27 +1847,20 @@ automatically do this each time you start. This might cause problems in Windows (which is a PnP OS) if you start Windows with the BIOS thinking that Windows is not a PnP OS. See Plug-and-Play-HOWTO. -Plug-and-Play was designed to automate this io-irq configuring, -but for Linux at present, it has made life more complicated. The -standard kernels for Linux don't support plug-and-play very well. If -you use a patch to the Linux kernel to covert it to a plug-and-play -operating system, then all of the above should be handled -automatically by the OS. But when you want to use this to automate -configuring devices other that the serial port, you may find that -you'll still have to configure the drivers manually since many Linux -drivers are not written to support a Linux PnP OS. If you use - Using a PnP BIOS to I0-IRQ Configure

While the explanation of how to use a PnP OS or isapnp for io-irq +

While the explanation of how to use setpci or isapnp for io-irq configuring should come with such software, this is not the case if you want to let a PnP BIOS do such configuring. Not all PnP BIOS can do this. The BIOS usually has a CMOS menu for setting up the first -two serial ports. This menu may be hard to find and for an "Award" +two serial ports. This menu may be hard to find. For an "Award" BIOS it was found under "chipset features setup" There is often little to choose from. Unless otherwise indicated in a menu, these first two ports normally get set at the standard IO addresses and @@ -1777,8 +1869,8 @@ Numbers"> Whether you like it or not, when you start up a PC a PnP BIOS starts to do PnP (io-irq) configuring of hardware devices. It may do the job -partially and turn the rest over to a PnP OS (which you probably don't -have) or if thinks you don't have a PnP OS it may fully configure all +partially and turn the rest over to a PnP OS (which Linux is in some +sense) or if thinks you don't have a PnP OS it may fully configure all the PnP devices but not configure the device drivers. This is what you want but it's not always easy to figure out exactly what the PnP BIOS has done. @@ -1788,53 +1880,58 @@ should do the configuring of all PnP serial ports --not just the first two. An indirect way to control what the BIOS does (if you have Windows 9x on the same PC) is to "force" a configuration under Windows. See Plug-and-Play-HOWTO and search for "forced". It's -easier to use the CMOS BIOS menu which may override what you +easier to use the CMOS BIOS menu which may override what you "forced" under Windows. There could be a BIOS option that can set or disable this "override" capability. -If you add a new PnP device, the BIOS should change its PnP -configuration to accommodate it. It could even change the io-irq of -existing devices if required to avoid any conflicts. For this -purpose, it keeps a list of non-PnP devices provided that you have -told the BIOS how these non-PnP devices are io-irq configured. One -way to tell the BIOS this is by running a program called ICU under -DOS/Windows. +If you add a new PnP device, the BIOS should PnP configure it. It +could even change the io-irq of existing devices if required to avoid +any conflicts. For this purpose, it keeps a list of non-PnP devices +provided that you have told the BIOS how these non-PnP devices are +io-irq configured. One way to tell the BIOS this is by running a +program called ICU under DOS/Windows. But how do you find out what the BIOS has done so that you set up the device drivers with this info? The BIOS itself may provide some info, either in its setup menus of via messages on the screen when you turn on your computer. See . Other ways of finding out is to use lspci for +the PCI bus or isapnp --dumpregs for the ISA bus. The cryptic results +it shows you may not be clear to a novice. Giving the IRQ and IO Address to Setserial

Once you've set the IRQ and IO address in the hardware (or arranged for it to be done by PnP) you also need to insure that the "setserial" command is run each time you start Linux. See the subsection +id="sets_boot_time" name="Boot-time Configuration"> - High-level Configuring: stty, etc. -

As a rule, your application program will do most (or all) of this. -The command which does it is + Configuring the Serial Driver (high-level) "stty" +

See the section . The "stty" command +sets many things such as flow control, speed, and parity. The only +one discussed in this section is flow control. - Configuring Flow Control: Hardware Flow Control is Best -

See for an explanation of + Flow Control +

Configuring Flow Control: Hardware Flow Control is Usually Best +See for an explanation of it. It's usually better to use hardware flow control rather than software flow control using Xon/Xoff. To use full hardware flow control you must normally have two wires for it in the cable between -the serial port and the device. If the device is on a card, then it -should always be possible to use hardware flow control. +the serial port and the device. If the device is on a card or the +motherboard, then it should always be possible to use hardware flow +control. Many applications (and the getty program) give you an option regarding flow control and will set it for you. It might even set -hardware flow control by default. Like the IRQ and IO address, it -must be set both in the serial driver and the hardware connected to -the serial port. How it's set into the hardware is hardware -dependent. Often there is a certain "init string" you send to the -hardware device via the serial port from your PC. For a modem, the -communication program should set it in both places. +hardware flow control by default. It must be set both in the serial +driver and in the hardware connected to the serial port. How it's set +into the hardware is hardware dependent. Sometimes there is a certain +"init string" you send to the hardware device via the serial port from +your PC. For a modem, the communication program should set it in both +places. If a program you use doesn't set flow control in the serial driver, then you may do it yourself using the -stty crtscts < /dev/ttyS2 + +stty crtscts < /dev/ttyS2 or for stty version >= 1.17: stty -F /dev/ttyS2 crtscts - + Serial Port Devices /dev/ttyS2, etc.

"man stty" or "info stty". @@ -2480,7 +2578,7 @@ same thing) as the arguments to the stty command. Flow control options

To set hardware flow control use "crtscts". For software flow -control there are 3 settings: ixon, ixoff, and ixany. +control there are 3 settings: ixon, ixoff, and ixany. ixany: Mainly for terminals. Hitting any key will restarts the flow after a flow-control stop. If you stop scrolling with the "stop @@ -2621,10 +2719,10 @@ One place to put it would be in the same file that runs setserial when the system is booted. The location is distribution and version dependent. It would seem best to put it after the setserial command so that the low level stuff is done first. If you have directories in -the /etc tree where every file in them is executed at boot-time +the /etc tree where every file in them is executed at boot-time (System V Init) then you could create a file named "stty" for this purpose. - + What is isapnp ? @@ -2656,25 +2754,32 @@ uses the serial port. See section is unique to each HOWTO. --> Speeds over 115.2k -

The top speed of 115.2k has been the standard speed since the -mid 1990's. By the year 2000, many serial ports supported higher -speeds but Linux seldom used them due to lack of drivers. These -high-speed ports by default only support 115.2k and must have special -software to enable the higher speeds. Today (2001) almost all new -serial ports support speeds of 230.4k and 460.8k. Some also support -921.6k. Unfortunately, to get these speeds you need to compile the -kernel with a special patch and it seems the patch doesn't support the -2.4 kernels yet. +

The top speed of 115.2k has been standard since the mid 1990's. +But by the year 2000, most new serial ports supported higher speeds of +230.4k and 460.8k. Some also support 921.6k. Unfortunately Linux +seldom uses these speeds due to lack of drivers. These ports behave +just like 115.2k ports unless the higher speeds are enabled by special +software. To get these speeds you need to compile the kernel with +special patches but it seems that the 2.4 kernels not yet supported + +The patch software is fairly simple since it only needs to enable the +higher speeds by dialog with the hardware. But it's not quite as +simple as just putting an enable byte in a hardware register since the +registers weren't designed for this. But unfortunately, there is no +standard way to enable the higher speeds so the driver needs to +support a variety of hardware. + +A patch to support high-speed is called shsmod (Super High Speed +Mode). There are both Windows and Linux versions of this patch. See +. For Linux (as of late +2001), most of the documentation is only in Japanese and the patch is +for the old kernel 2.2.x. There is also a module for the VIA +VT82C686 chip . Using it may +result in buffer overflow. For internal modems, only a minority of them advertise that they -support speeds of over 115.2k for their built-in serial ports. -Will shsmod support these ?? - -The patch to support high-speed is called shsmod (Super High Speed). -There are both Windows and Linux versions of this patch. See . For Linux, much of the -documentation is only in Japanese. There is also a module for the -VIA VT82C686 chip . +support speeds of over 115.2k for their built-in serial ports. +Does shsmod support these ?? How speed is set in hardware: the divisor and baud_base

To correct this accounting (but not always fix the problem) you may use "setserial" to change the baud_base to the actual maximal speed of your port such as 230.4k. Then if you set the speed (by your application or by stty) to 230.4k, a divisor of 1 will be used and -you'll get the same speed as you set. PROBLEM: stty and many -communication programs (as of mid 1999) still have 115.2k as their -maximum speed setting and will not let you set 230.4k, etc. So in -these cases one solution is not to change anything with -setserial /dev/ttyS2 spd_cust baud_base 230400 divisor 1 -Don't try using "divisor" for any other purpose other than the special -use illustrated above (with spd_cust). +If you have old software which will not permit such a high speed (but +your hardware has it enabled) then you might want to look into using +the "spd_cust" parameter for setserial with "divisor 1". Then when +you tell the application that the speed it 38,400, it will use divisor +1 and get the highest speed. -If there are two or more high speeds that you want to use that your -communication program can't set, then it's not quite as easy as above. -But the same principles apply. You could just keep the default -baud_base and understand that when you set a speed you are really only -setting a divisor. So your actual speed will always be your maximum -speed divided by whatever divisor is set by the serial driver. See - +There are some brands of UARTs that uses a very high divisor to set +high speeds. There isn't any satisfactory way to use "setserial" (say +set "divisor 32770") to get such a speed since then setserial would +then think that the speed is very low and disable the FIFO in the +UART. - Crystal frequency is not baud_base + Crystal frequency is higher than baud_base

Note that the baud_base setting is usually much lower than the frequency of the crystal oscillator in the hardware since the crystal frequency is often divided by 16 in the hardware to get the actual top speed. The reason the crystal frequency needs to be higher is so that -this high crystal speed can be used to take a number of samples of -each bit to determine if it's a 1 or a 0. +this high crystal speed can generate clock ticks to take a number of +samples of each bit to determine if it's a 1 or a 0. Higher Serial Throughput

-If you are seeing slow throughput and serial port overruns on a +If you are seeing slow throughput and serial port overruns on a system with (E)IDE disk drives, you can get hdparm. This is a utility that can modify (E)IDE parameters, including unmasking other IRQs during a disk IRQ. This will improve responsiveness @@ -2750,8 +2844,8 @@ and will help eliminate overruns. Be sure to read the man page very carefully, since some drive/controller combinations don't like this and may corrupt the filesystem.

-Also have a look at a utility called irqtune that will change -the IRQ priority of a device, for example the serial port that your +Also have a look at a utility called irqtune that will change +the IRQ priority of a device, for example the serial port that your modem is on. This may improve the serial throughput on your system. The @@ -2776,7 +2870,7 @@ happened. One way to implement locking is to design the kernel to handle it but Linux thus far has shunned this solution (with an exception involving the cua device which is now obsolete). Two solutions used by Linux -is to: +is to: create lock-files modify the permissions and/or owners of devices such as /dev/ttyS2 @@ -2813,7 +2907,7 @@ the same device. This results in lockfiles with different names that actually are the same device. Formerly each physical serial port was known by two different device names: ttyS0 and cua0. To solve this lockfile alias problem, 3 methods have been used. It may be overkill -since any one of these methods would have fixed the problem. +since any one of these methods would have fixed the problem. The lock checking software was made aware of ttyS vs. cua. @@ -2825,7 +2919,7 @@ since any one of these methods would have fixed the problem. Using alternate names such as /dev/modem for /dev/ttyS2 may cause problems with older versions. For dumb terminals, lockfiles are not used since this would not permit someone else to send a message to -your terminal using the write or talk program. +your terminal using the write or talk program. Change Owners, Groups, and/or Permissions of Device Files

In order to use a device, you (or the program you run if you have @@ -2862,28 +2956,28 @@ available via FTP, if they didn't come with your distribution. - - portable, scriptable, serial and TCP/IP communications including file + - + portable, scriptable, serial and TCP/IP communications including file transfer, character-set translation, and zmodem support gkermit Tiny GPLed kermit run only from the command line. Can't connect to another computer -kermit and zmodem

For use of kermit with modems see the Modem-HOWTO. One can run -zmodem within the kermit program. To do this (for ttyS3), add the +zmodem within the kermit program. To do this (for ttyS3), add the following to your define rz !rz < /dev/ttyS3 > /dev/ttyS3 define sz !sz \%0 > /dev/ttyS3 < /dev/ttyS3 Be sure to put in the correct port your modem is on. Then, to use it, -just type sz <filename> at the sz <filename> at the Serial Tips And Miscellany @@ -2958,7 +3052,7 @@ modem control signals from the printer and empty the buffer. Modern printers have large buffers and often a button on the printer to empty the buffer. - Known Defective Hardware + Known Defective Hardware Avoiding IO Address Conflicts with Certain Video Boards

The IO address of the IBM 8514 video board (and others) is @@ -3005,7 +3099,7 @@ PC). Some have test points for connecting a voltmeter. Others have LED lamps which light when certain modem control lines are asserted (turned on). The color of the light may indicate the polarity of the signal (positive or negative voltage). Still others have jumpers so -that you can connect any wire to any wire. Some have switches. +that you can connect any wire to any wire. Some have switches. Radio Shack sells (in 1998) a "RS-232 Troubleshooter" or "RS-232 Line Tester" which checks TD, RD, CD, RTS, CTS, DTR, and DSR. A green @@ -3048,14 +3142,14 @@ Put the other test lead on your tongue. If the lead on your tongue is positive, there will be a noticeable taste. You might try this with flashlight batteries first so you will know what taste to expect. - Serial Monitoring/Diagnostics + Serial Monitoring/Diagnostics

A few Linux programs will monitor the modem control lines and indicate if they are positive (1) or negative (0). See section (The following subsections are in both the Serial and Modem HOWTOs) - My Serial Port is Physically There but Can't be Found + My Serial Port is Physically There but Can't be Found

If a physical device (such as a modem) doesn't work at all it may mean that the device is not at the I/O address that setserial thinks it's at. It could also mean (for a PnP card) that is doesn't -yet have an address. Thus it can't be found. +yet have an address. Thus it can't be found. Check the BIOS menus and BIOS messages. For the PCI bus use lspci or scanpci. If it's an ISA bus PnP serial port, try "pnpdump --dumpregs" @@ -3093,9 +3187,9 @@ devices illegally "sharing" a port but the fact that there are two devices on the same a port doesn't seem to get detected (except hopefully by you). In the above case, if the IRQs are different then probing for IRQs with setserial might "detect" this situation by -failing to detect any IRQ. See . +failing to detect any IRQ. See . - Extremely Slow: Text appears on the screen slowly after long delays + Extremely Slow: Text appears on the screen slowly after long delays

It's likely mis-set/conflicting interrupts. Here are some of the symptoms which will happen the first time you try to use a modem, @@ -3113,7 +3207,7 @@ For more details on the symptoms and why this happens see and/or and/or . -If it involves Plug-and-Play devices, see also Plug-and-Play-HOWTO. +If it involves Plug-and-Play devices, see also Plug-and-Play-HOWTO. As a quick check to see if it really is an interrupt problem, set the IRQ to 0 with "setserial". This will tell the driver to use @@ -3156,7 +3250,7 @@ really do have an obsolete serial port, lying about it to setserial will only make things worse. The Startup Screen Show Wrong IRQs for the Serial Ports. -

Linux does not do any IRQ detection on startup. When the serial module loads it only does serial device detection. Thus, disregard what it says about the IRQ, because it's just assuming the standard @@ -3172,7 +3266,7 @@ ttyS02 at 0x03e8 (irq = 4) is a 16550A at first when Linux boots. (Older kernels may show "ttyS02" as "tty02" which is the same as ttyS2). You may need to use - "Cannot open /dev/ttyS?: Permission denied"

Check the file permissions on this port with "ls -l /dev/ttyS?"_ @@ -3209,7 +3303,7 @@ permissions are OK: usually rwx for everyone (repeated 3 times). If it's wrong, use "chmod" to fix it. Of course, if there is no "lock" directory no lockfile can be created there. For more info on lockfiles see +Are Lock Files"> "Device /dev/ttyS? is locked."

This means that someone else (or some other process) is supposedly @@ -3264,7 +3358,7 @@ What you need to do is to find the interrupt setserial thinks it). You should also be able to find it with the "setserial" command for Troubleshooting Tools

These are some of the programs you might want to use in -troubleshooting: +troubleshooting: "lsof /dev/ttyS*" will list serial ports which are open. "setserial" shows and sets the low-level hardware configuration of a port (what the driver thinks it is). See + name="What is Setserial"> "stty" shows and sets the configuration of a port (except for that handled by "setserial"). See the section "modemstat" or "statserial" will show the current state of @@ -3370,7 +3464,7 @@ start the second device (without quitting the first device) you get Symptoms of Mis-set or Conflicting Interrupts

The symptoms depend on whether or not you have a modern serial port with FIFO buffers or an obsolete serial port without FIFO buffers. -It's important to understand the symptoms for the obsolete ones also +It's important to understand the symptoms for the obsolete ones also since sometimes modern ports seem to behave that way. For the obsolete serial ports, only one character gets thru every @@ -3408,7 +3502,7 @@ device driver will not catch any interrupts sent by the serial port. Since the serial port uses interrupts to call its driver to service the port (fetching bytes from its 16-byte receive buffer or putting another 16-bytes in its transmit buffer) one might expect that the -serial port would not work at all. +serial port would not work at all. But it still may work anyway --sort of. Why? Well, besides the interrupt method of servicing the port there's a slow polling method @@ -3448,7 +3542,7 @@ an internal modem, the serial port is on the same card and it's likely to check that this receive buffer has room for more bytes before putting received bytes into it. In this case there will be no overrun of this receive buffer, but text will just appear on your screen in -16-byte chunks spaced at intervals of several seconds. +16-byte chunks spaced at intervals of several seconds. Even with an external modem you might not get overruns. If just a few characters (under 16) are sent you don't get overruns since the buffer @@ -3537,7 +3631,7 @@ sends out a stream of bits, one bit at a time. Conversely, the bit stream that enters the serial port via the external cable is converted to parallel bytes that the computer can understand. UARTs deal with data in byte sized pieces, which is conveniently also the size of -ASCII characters. +ASCII characters. Say you have a terminal hooked up to your PC. When you type a character, the terminal gives that character to its transmitter (also @@ -3554,7 +3648,7 @@ transmitted. See the Serial-HOWTO section, ``Voltage Waveshapes'' for details. Also, while the flow rate (in bytes/sec) on the parallel bus inside the computer is very high, the flow rate out the UART on the serial port side of it is much lower. The UART has a fixed set of -rates (speeds) which it can use at its serial port interface. +rates (speeds) which it can use at its serial port interface. Two Types of UARTs

There are two basic types of UARTs: dumb UARTS and FIFO UARTS. @@ -3602,7 +3696,7 @@ Note that the interrupt threshold of FIFO buffers (trigger level) may be set at less than 14. 1, 4 and 8 are other possible choices. As of late 2000 there was no way the Linux user could set these directly (setserial can't do it). While many PC's only have a 16550 with -16-byte buffers, better UARTS have even larger buffers. +16-byte buffers, better UARTS have even larger buffers. Note that the interrupt is issued slightly before the buffer gets full (at say a "trigger level" of 14 bytes for a 16-byte buffer). This @@ -3642,7 +3736,7 @@ kilo-byte range. The reason is flow control. Flow control stops the flow of data (bytes) on serial line when necessary. If a stop signal is sent to serial port, then the stop request is handled by software (even if the flow control is "hardware"). The serial port hardware -knows nothing about flow control. +knows nothing about flow control. If the serial port buffer contains 64 bytes ready to send when it receives a flow control signal to stop sending, it will send out the @@ -3655,11 +3749,11 @@ control's request to stop.

Here's a list of UARTs. 8250, 16450, early 16550: Obsolete with 1-byte buffers - 16550, 16550A, 16c552: 16-byte buffers, TL=1,4,8,14 + 16550, 16550A, 16c552: 16-byte buffers, TL=1,4,8,14 16650: 32-byte buffers. Speed up to 460.8 kbps 16750: 64-byte buffer for send, 56-byte for receive. Speed up to 921.6 kbps - Hayes ESP: 1k-byte buffers. + Hayes ESP: 1k-byte buffers. The obsolete ones are only good for modems no higher than 14.4k (DTE @@ -3669,12 +3763,12 @@ percent faster with a 16650 (especially if you are downloading large uncompressed files). The main advantage of the 16650 is its larger buffer size as the extra speed isn't needed unless the modem compression ratio is high. Some 56k internal modems may come with a -16650 ?? +16650 ?? -Non-UART, and intelligent multiport boards use DSP chips to +Non-UART, and intelligent multiport boards use DSP chips to do additional buffering and control, thus relieving the CPU even more. For example, the Cyclades Cyclom, and Stallion -EasyIO boards use a Cirrus Logic CD1400 RISC UART, and many +EasyIO boards use a Cirrus Logic CD1400 RISC UART, and many boards use 80186 CPUs or even special RISC CPUs, to handle the serial IO. @@ -3685,7 +3779,7 @@ newer ones in pre 1990 hardware see the Appendix: Obsolete ... Pinout and Signals

+

PINOUT of the SERIAL PORT (--> direction is out of PC) (Note DCD is sometimes labeled CD) @@ -3785,7 +3879,7 @@ exist for a specific application which supports DTR/DSR flow control). Only RTS/CTS flow control will be discussed since DTR/DSR flow control works the same way. To get RTS/CTS flow control one needs to either select hardware flow control in an application program or use the -command: +command: stty crtscts < /dev/ttyS2 (or the like). This enables RTS/CTS hardware flow control in the Linux device driver. @@ -4032,7 +4126,7 @@ tri-state mode where besides the 0 and 1 binary states there is also an open circuit state to permit other nodes to uses the twisted pair line. Instead of a transmitter keeping a 1-state voltage on the line during line idle, the line is open circuited and all nodes just listen -(receive mode). +(receive mode). The most common architecture is master/slave. The master polls the slaves to see if they have anything to send. A slave can only @@ -4043,15 +4137,15 @@ for sending data. One pair is only for the Master to send to the Slaves. Since no one transmits on this line except the master, there is no need for it to be tri-state. Thus the Master may just be EIA-232 but the slaves must still be EIA-485. See - for more + for more details. EIA-530

EIA-530-A (balanced but can also be used unbalanced) at 2Mbits/s (balanced) was intended to be a replacement for EIA-232 but few have -been installed. It uses the same 25-pin connector as EIA-232. +been installed. It uses the same 25-pin connector as EIA-232. - EIA-612/613 + EIA-612/613

The High Speed Serial Interface ( HSSI = EIA-612/613) uses a 50-pin connector and goes up to about 50 Mbits/s but the distance is limited to only several meters. For Linux there are PCI cards @@ -4108,7 +4202,7 @@ often a separate wire or channel for sending the clock signal. The clock signal might also be embedded in the transmitted bytes. Asynchronous bytes may be sent out erratically with various time intervals between bytes (like someone typing characters at a -keyboard). +keyboard). When a file is being sent thru the async serial port, the flow of bytes will likely be at the speed of the port (say 115.2k) which is a @@ -4116,7 +4210,7 @@ constant rate. This flow may frequently start and stop due to flow control. Is this sync or async? Ignoring the flow control stops, it might seem like sync since it's a steady flow. But it's not because there is no clock signal and the bytes could have been sent -erratically since they are framed by start/stop bits. +erratically since they are framed by start/stop bits. Another case is where data bytes (without any start-stop bits) are put into packets with possible erratic spacing between one packet and the @@ -4140,7 +4234,7 @@ SCC stands for "Serial Communication Controller" or "Serial Controller Chip". It's likely old terminology and since it doesn't say "sync" or "async" it might support both. -Besides the sync part of the EIA-232, there are various other EIA +Besides the sync part of the EIA-232, there are various other EIA synchronous standards. For EIA-232, 3 pins of the connector are reserved for clock (or timing) signals. Sometimes it's a modem's task to generate some timing signals making it impossible to use @@ -4153,10 +4247,10 @@ does often take place over telephone lines using modems which use V.42 error correction. This strips off the start/stop bits and puts the data bytes in packets resulting in synchronous operation over the phone line. - - Other Sources of Information - Books -

+ + Other Sources of Information + Books +

Axleson, Jan: Serial Port Complete, Lakeview Research, Madison, WI, 1998. @@ -4165,17 +4259,17 @@ phone line. Campbell, Joe: The RS-232 Solution, 2nd ed., Sybex, 1982. Campbell, Joe: C Programmer's Guide to Serial Communications, 2nd ed., Unknown Publisher, 1993. - , O'Reilly, 1991. Nelson, Mark: Serial Communications Developer's Guide, 2nd ed., Hungry Minds, 2000. Putnam, Byron W.: RS-232 Simplified, Prentice Hall, 1987. Seyer, Martin D.: RS-232 Made Easy, 2nd ed., Prentice Hall, 1991. - , - (ISBN 0-201-56317-7; Addison-Wesley) + name="Stevens, Richard W.: Advanced Programming in the UNIX Environment">, + (ISBN 0-201-56317-7; Addison-Wesley) Tischert, Michael & Bruno Jennrich: PC Intern, Abacus 1996. Chapter 7: Serial Ports @@ -4209,7 +4303,7 @@ Monitoring/Diagnostics"> Related Linux Documents

-man pages for: setserial and man pages for: setserial and part of "GNU C Library Reference manual" (in libc (or glibc) docs package). It covers the detailed @@ -4217,17 +4311,17 @@ meaning of "stty" commands, etc. Modem-HOWTO: modems on the serial port PPP-HOWTO: help with PPP (using a modem on the serial port) Printing-HOWTO: for setting up a serial printer -Serial-Programming-HOWTO: for some aspects of serial-port programming -Text-Terminal-HOWTO: how they work and how to install and configure -UPS-HOWTO: setting up UPS sensors connected to your serial port +Serial-Programming-HOWTO: for some aspects of serial-port programming +Text-Terminal-HOWTO: how they work and how to install and configure +UPS-HOWTO: setting up UPS sensors connected to your serial port UUCP-HOWTO: for information on setting up UUCP - Usenet newsgroups: + Usenet newsgroups:

comp.os.linux.answers - comp.os.linux.hardware: Hardware compatibility with the Linux + comp.os.linux.hardware: Hardware compatibility with the Linux operating system. comp.os.linux.networking: Networking and communications under Linux. comp.os.linux.setup: Linux installation and system administration. @@ -4244,7 +4338,7 @@ meaning of "stty" commands, etc. of mailing lists. Internet -

+

Includes info about PCI support.