Serial HOWTO
Serial HOWTO Table of Contents Serial HOWTO...................................................................................................................................................1 David S.Lawyer dave@lafn.org original by Greg Hankins.....................................................................1 1. Introduction..........................................................................................................................................1 2. Quick Help...........................
Serial HOWTO Table of Contents Serial HOWTO 4.4 Interrupts.........................................................................................................................................12 4.5 Data Flow (Speeds)..........................................................................................................................13 4.6 Flow Control...................................................................................................................................
Serial HOWTO Table of Contents Serial HOWTO 8.8 Choosing Serial IRQs.....................................................................................................................33 IRQ 0 is not an IRQ.........................................................................................................................33 Interrupt sharing, Kernels 2.2+......................................................................................................34 What IRQs to choose?........................
Serial HOWTO Table of Contents Serial HOWTO 11.5 What is isapnp ?.............................................................................................................................51 11.6 Connecting two PCs together via serial ports................................................................................51 11.7 Connect the serial port to a fast network: ser2net..........................................................................51 12. Speed (Flow Rate).................................
Serial HOWTO Table of Contents Serial HOWTO 16.14 "Device /dev/ttyS? is locked.".....................................................................................................62 16.15 "/dev/tty? Device or resource busy"...........................................................................................63 16.16 "Input/output error" from setserial, stty, pppd, etc......................................................................64 16.17 "LSR safety check engaged".............................
Serial HOWTO Table of Contents Serial HOWTO 22.2 Serial Software...............................................................................................................................79 22.3 Related Linux Documents..............................................................................................................79 22.4 Serial Mailing List.........................................................................................................................79 22.5 Internet...............
Serial HOWTO David S.Lawyer dave@lafn.org original by Greg Hankins v2.27 February 2011 This document is for the UART serial port. This port has mostly disappeared from desktops and laptops is still used elsewhere such as for embedded systems. It covers information other than that which should be covered by Modem-HOWTO, PPP-HOWTO, Serial-Programming-HOWTO, or Text-Terminal-HOWTO. It lists info on multiport serial cards.
Serial HOWTO 5. Multiport Serial Boards/Cards/Adapters • 5.1 Intro to Multiport Serial • 5.2 Dumb vs. Smart Cards • 5.3 Getting/Enabling a Driver • 5.4 Multiport Devices in the /dev Directory, • 5.5 Making Legacy Multiport Devices in the /dev Directory • 5.6 Standard PC Serial Cards • 5.7 Dumb Multiport Serial Boards (with standard UART chips) • 5.8 Intelligent Multiport Serial Boards • 5.9 Unsupported Multiport Boards 6. Servers for Serial Ports 7. Configuring Overview 8.
Serial HOWTO 11. Interesting Programs You Should Know About • 11.1 Serial Monitoring/Diagnostics Programs • 11.2 Changing Interrupt Priority • 11.3 What is Setserial ? • 11.4 Stty • 11.5 What is isapnp ? • 11.6 Connecting two PCs together via serial ports • 11.7 Connect the serial port to a fast network: ser2net 12. Speed (Flow Rate) • 12.1 Very High Speeds • 12.2 Higher Serial Throughput 13. Locking Out Others • 13.1 Introduction • 13.2 Lock-Files • 13.
Serial HOWTO • 16.9 "Cannot open /dev/ttyS?: Device or resource busy • 16.10 "Cannot open /dev/ttyS?: Permission denied" • 16.11 "Cannot open /dev/ttyS?" • 16.12 "Operation not supported by device" for ttyS? • 16.13 "Cannot create lockfile. Sorry" • 16.14 "Device /dev/ttyS? is locked." • 16.15 "/dev/tty? Device or resource busy" • 16.16 "Input/output error" from setserial, stty, pppd, etc. • 16.17 "LSR safety check engaged" • 16.18 Overrun errors on serial port • 16.
Serial HOWTO 21. Other Serial Devices (not async RS-232) • 21.1 Successors to RS-232 • 21.2 EIA-422-A (balanced) and EIA-423-A (unbalanced) • 21.3 EIA-485 • 21.4 EIA-530 • 21.5 EIA-612/613 • 21.6 The Universal Serial Bus (USB) • 21.7 Firewire • 21.8 MIDI • 21.9 Synchronization & Synchronous 22. Other Sources of Information • 22.1 Books • 22.2 Serial Software • 22.3 Related Linux Documents • 22.4 Serial Mailing List • 22.5 Internet 23. Appendix A: Very Obsolete Hardware/Software • 23.
Serial HOWTO as well as some of the other HOWTOs. (See Related HOWTO's) This HOWTO lists info on various multiport serial cards. This HOWTO addresses Linux running on PCs (ISA and/or PCI buses), although it might be valid for other architectures. 1.1 Copyright, Disclaimer, & Credits Copyright Copyright (c) 1993-1997 by Greg Hankins, (c) 1998-2005 by David S. Lawyer mailto:dave@lafn.org Please freely copy and distribute (sell or give away) this document in any format.
Serial HOWTO compare it to this version: v2.27 February 2011 . 1.3 New in Recent Versions For a full revision history going back to the time I started maintaining this HOWTO, see the source file (in linuxdoc format): (cvs) Serial-HOWTO.sgml • TO do: explain use of udev for serial port for setting names and permissions. Fix dead links. • 2.27 Feb. 2011: The serial port is still widely used in embedded systems, etc., and is not really obsolete. Better definition of input, output.
Serial HOWTO Each serial port has a "file" associated with it in the /dev directory. It isn't really a file but it seems like one. For example, /dev/ttyS0. Other serial ports are /dev/ttyS1, /dev/ttyS2, etc. But ports on the USB bus, multiport cards, etc. have different names. The common specification for the conventional serial port is RS-232 (or RS-232). So it's often called a "RS-232 serial port".
Serial HOWTO 3.1 Transmitting Transmitting is sending bytes out of the serial port away from the computer (output). Once you understand transmitting, receiving (input) is easy to understand since it's similar. The first explanation given here will be grossly oversimplified. Then more detail will be added in later explanations.
Serial HOWTO 3. Another interrupt is issued to tell the device driver to send yet another byte to the now empty transmit buffer Thus we say that the serial port is interrupt driven. Each time the serial port issues an interrupt, the CPU sends it another byte. Once a byte has been sent to the transmit buffer by the CPU, then the CPU is free to pursue some other activities until it gets the next interrupt.
Serial HOWTO Both of these buffers are managed by the serial driver. But the driver does more than just dealing with these buffers. It also does limited filtering (minor modifications) of data passing thru these buffers and listens for control certain characters. All this is configurable using the Stty program. 4. Serial Port Basics You don't have to understand the basics to use the serial port But understanding it may help to determine what is wrong if you run into problems.
Serial HOWTO RS-232 (EIA-232, etc.) 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 officially became EIA (Electronics Industries Association) and later EIA/TIA after EIA merged with TIA (Telecommunications Industries Association). The EIA-232 spec provides also for synchronous (sync) communication but the hardware to support sync is almost always missing on PC's.
Serial HOWTO only by that port. Thus the FIFO waits until it has received a number of bytes and then issues an interrupt. However, this interrupt will also be sent if there is an unexpected delay while waiting for the next byte to arrive (known as a timeout). Thus if the bytes are being received slowly (such as from someone typing on a terminal keyboard) there may be an interrupt issued for every byte received.
Serial HOWTO 4.6 Flow Control 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 and other hardware to allow a jump in instantaneous flow rates. Example of Flow Control For example, consider the case where you connect a 33.6k external modem via a short cable to your serial port. The modem sends and receives bytes over the phone line at 33.
Serial HOWTO Symptoms of No Flow Control Understanding flow-control theory can be of practical use. The symptom of no flow control is that chunks of data missing from files sent without the benefit of flow control. When overflow happens, often hundreds or even thousands of bytes get lost, and all in 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.
Serial HOWTO 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 sent from the modem) 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.
Serial HOWTO Now lets consider an example of the operation of flow control. Consider the flow of bytes from the remote computer at the other end of the phone line to the screen on the text-terminal that I'm sitting at. A real 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. This "stop" propagates in a direction opposite to the flow of bytes it controls.
Serial HOWTO remote computer had a flow path to the hard-disk without bottlenecks, the same flow also went to a terminal which issued flow control "stops" with disastrous results for the branch of the flow going to a file on the hard-disk. The flow to the hard-disk passed thru my modem and since the overflow happened at the modem, bytes intended for the hard-disk were lost. 4.9 Serial Driver Module The device driver for the serial port is the software that operates the serial port.
Serial HOWTO In 1888 (over 120 years ago) the "Cable Conference" reported its support of twisted-pair (for telephone systems) and pointed out its advantages. But over 80 years after this approval by the "Cable Conference", RS-232 failed to utilize it. Since RS-232 was originally designed for connecting a terminal to a low speed modem located nearby, the need for high speed and longer distance transmission was apparently not recognized.
Serial HOWTO like dumb serial cards do). Not all "smart" boards are equally efficient. Many boards today are Plug-and-Play. 5.3 Getting/Enabling a Driver Introduction For a multiport board to work, a special driver for it must be used. This driver may either be built into the kernel source code or supplied as a module. For the 2.6 kernels on, most drivers are supplied both ways: as a module or it can be built into the kernel.
Serial HOWTO 5.4 Multiport Devices in the /dev Directory, The serial ports your multiport board uses depends on what kind of board you have. Some have their own device names like /dev/ttyE27 (Stallion) or /dev/ttyD2 (Digiboard), etc. For various other brands, see see devices.txt in the kernel documentation. Some use the standard names like /dev/ttyS14 and may be found in configuration files that used as arguments to setserial. Such files may be included in a setserial or serial package. 5.
Serial HOWTO others) simultaneously. See Avoiding IO Address Conflicts with Certain Video Boards 5.7 Dumb Multiport Serial Boards (with standard UART chips) They are also called "serial adapters". Each port has its own address. They often have a special method of sharing interrupts which requires that you compile support for them into the kernel.
Serial HOWTO BB-1004 and BB-1008 do not support DCD and RI lines, and thus are not usable for dialin modems. They will work fine for all other purposes. Digi PC/8 Interrupt Status Register is at 0x140. SIIG IO1812 manual for the listing for COM5-COM8 is wrong. They should be COM5=0x250, COM6=0x258, COM7=0x260, and COM8=0x268. 5.8 Intelligent Multiport Serial Boards Make sure that a Linux-compatible driver is available and read the information that comes with it.
Serial HOWTO • Decision PCCOM (2-8 ports; ISA and PCI; aka PC COM) ISA: contact: mailto:info@cendio.se driver location: (dead link) ftp://ftp.cendio.se/pub/pccom8 PCI: drivers: http://www.decision.com.tw driver status: Support in serial driver 5.03. For an earlier driver, there exists a patch for kernel 2.2.16 at http://www.qualica.com/serial/ and for kernels 2.2.14-2.2.17 at http://www.pccompci.com/mains/installing_pci_linux1.html • Digi PC/Xi (12.5MHz 80186; 4, 8, or 16 ports), PC/Xe (12.
Serial HOWTO driver status: supported by Microgate: synclink.o • Moxa C218 (12MHz 80286; 8 ports), Moxa C320 (40MHz TMS320; 8 - 32 ports) website: http://www.moxa.com driver status: supported by Moxa driver locations: http://www.moxa.com/support/download/download.php3> ftp://ftp.moxa.com/drivers/linux (also from Taiwan at www.moxa.com.tw/...) where ... is the same as above) • SDL RISCom/8 (Cirrus Logic CD180; 8 ports) website: http://www.sdlcomm.
Serial HOWTO server, communicating with the server over a network. There are two basic types of serial servers. One type is just an ordinary computer (perhaps rack mounted) that uses multiport cards on a PCI bus (or the like). The other type is a proprietary server that is a dedicated computer that serves a special purpose. Servers of both types may be called: serial servers, console servers, print servers, or terminal servers. They are not the same.
Serial HOWTO using a menu or a configuration file. This high-level configuring may also be done manually with the stty program. stty is also useful to view the current status if you're having problems. See the section Stty 8. Locating the Serial Port: IO address, IRQs 8.1 What Bus is my Serial Port On? If you need to find a serial port it often helps if you know what bus it's on. If the serial port is on a card, you may know what bus the card inserts into such as a PCI slot.
Serial HOWTO When Linux starts, an effort is made to detect and configure (low-level) the serial ports. Exactly what happens depends on your BIOS, hardware, Linux distribution, kernel version, 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.
Serial HOWTO While kernel 2.2 supported PCI in general, it had no support for PCI serial ports (although some people got them working anyway). Starting with kernel 2.4, the serial driver will read the id number digitally stored in the serial hardware to determine how to support it (if it knows how). It should assign an I/O address to it, determine its IRQ, etc. So you don't need to use "setserial" for it. There is a possible problem if you don't use the device filesystem.
Serial HOWTO pairs are identical you must find out how they are set in both the driver and the hardware. 8.6 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).
Serial HOWTO there because the configuration file is incorrect. With old jumper-set serial ports Linux sometimes gets IRQs wrong because it doesn't by default probe for IRQs. It just assumes the "standard" ones (first message) or accepts what is in a configuration file (second message). Neither of these is necessarily correct. If the serial driver has the wrong IRQ, the serial port is very slow or doesn't seem to work at all.
Serial HOWTO 8.7 What is the IO Address & IRQ of my Serial Port Hardware? Introduction 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 completely lost.
Serial HOWTO ISA PnP ports For an ISA Plug-and-Play (PnP) port one may try the pnpdump program (part of isapnptools). If you use the --dumpregs option then it should tell you the actual IO address and IRQ set in the port. It should also find an ISA PnP port that is disabled. The address it "trys" is not the device's IO address, but a special address used for communicating with PnP cards.
Serial HOWTO 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.
Serial HOWTO 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 you might want to double-check /proc/interrupts when programs that use interrupts are being run and make sure there are no conflicts. 8.9 Choosing Addresses --Video card conflict with ttyS3 Here's a problem with some old serial cards.
Serial HOWTO Plug-and-Play (PnP) was designed to automate this io-irq configuring, but for Linux it initially made life much more complicated. In modern Linux (2.4 kernels --partially in 2.2 kernels), each device driver has to do its own PnP (using supplied software which it may utilize). There is unfortunately no centralized planning for assigning IO addresses and IRQs as there is in MS Windows. But it usually works out OK in Linux anyway.
Serial HOWTO 9.2 Flow Control Configuring Flow Control: Hardware Flow Control is Usually Best See Flow Control 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 dedicated wires for it in the cable between 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.
Serial HOWTO this to /etc/udev/udev.rules BUS=="pci" KERNEL=="ttyS3", NAME="ttyS14" On-board serial ports on motherboards which have both PCI and ISA slots are likely to still be ISA ports. Even for all-PCI-slot motherboards, the serial ports are often not PCI. Instead, they are either ISA, on an internal ISA bus or on a LPC bus which is intended for slow legacy I/O devices: serial/parallel ports and floppy drives. 10.3 Serial Port Device Names & Numbers Devices in Linux have major and minor numbers.
Serial HOWTO doesn't fall into this trap so it's now OK to use such links. 10.7 Which Connector on the Back of my PC is ttyS1, etc? Inspect the connectors Inspecting the connectors may give some clues but is often not definitive. The serial connectors on the back side of a PC are usually DB connectors with male pins. 9-pin is the most common but some are 25-pin (especially older PCs like 486s). There may be one 9-pin (perhaps ttyS0 ??) and one 25-pin (perhaps ttyS1 ??).
Serial HOWTO virtual terminal you may send something to ttyS2 (or whatever) by "echo test_message > /dev/ttyS2". Then go back to the receive virtual terminal and look for the test_message. See Serial Electrical Test Equipment for more info. Connect a device to the connector Another way to try to identify a serial port is to connect some physical serial device to it and see if it works. But a problem here is that it might not work because it's not configured right.
Serial HOWTO 11.1 Serial Monitoring/Diagnostics Programs A few Linux programs (and one "file") will monitor various modem control lines and indicate if they are positive (1 or green) or negative (0 or red). • serlook can snoop on serial line traffic (via a wiretap) and also send/receive on a serial line. • The "file": /proc/tty/driver/serial lists those that are asserted (positive voltage) • modemstat (Only works correctly on Linux PC consoles.) Status monitored in a tiny window. Color-coded and compact.
Serial HOWTO the jumperless serial port is set, setserial is not really needed anymore unless you're having problems or using old hardware. Furthermore, if the configuration file used by setserial is wrong, then there's trouble. In this case, if you use setserial to try to find out how the port is configured, it may just repeat the incorrect information in the configuration file. setserial can sometimes be of help to find a serial port.
Serial HOWTO buffer (in main memory) were sent to the printer. The result was a truncated print job that didn't print the last paragraph or last page, etc. But the newer lprng print program (and possibly other printing programs) keeps the port open until printing is finished so "problem solved", even if you're using an antique printer. Setserial can modify the time that the port will keep operating after it's closed (in order to output any characters still in its buffer in main RAM).
Serial HOWTO should show where the configuration file(s) reside. In Debian there are 4 options for use of this configuration file: 1. Don't use this file at all. At each boot, the serial driver alone detects the ports and setserial doesn't ever run. ("kernel" option) 2. Save what setserial reports when the system is first shutdown and put it in the configuration file.
Serial HOWTO Boot-time Configuration While setserial may run via an initialization script, something akin to setserial also runs earlier when the serial module is loaded (or when the kernel starts the built-in serial driver if it was compiled into the kernel). Thus when you watch the start-up messages on the screen it may look like it ran twice, and in fact it has. If the first message is for a legacy port, the IRQs shown may be wrong since it didn't probe for IRQs.
Serial HOWTO setserial, and a valid device name. You could do a test by executing this file manually (just type its name as the super-user) to see if it works right. Testing like this was a lot faster than doing repeated reboots to get it right. For versions >= 2.15 (provided your distribution implemented the change, Redhat didn't at first) it may be more tricky to do since the file that runs setserial on startup, /etc/init.d/setserial or the like was not intended to be edited by the user.
Serial HOWTO "AUTOSAVE-ONCE" option was created which only does a save when time the system is shut down for the first time (just after you install or update the setserial program). The file most commonly used to run setserial at boot-time (in conformance with the configuration file) is now /etc/init.d/setserial (Debian) or /etc/init.d/serial (Redhat), or etc., but it should not normally be edited. For 2.15, Redhat 6.0 just had a file /usr/doc/setserial-2.15/rc.serial which you have to move to /etc/init.
Serial HOWTO Introduction stty does much of the configuration of the serial port but since application programs (and the getty program) often handle this, you may not need to use it much. It's handy if you're having problems or want to see how the port is set up. Try typing ``stty -a'' at your terminal/console to see how it's now set. Also try typing it without the -a (all) for a short listing which shows how it's set different than "normal" which is how it's set using the command "stty sane".
Serial HOWTO ixany: Mainly for terminals. Hitting any key will restart the flow after a flow-control stop. If you stop scrolling with the "stop scroll" key (or the like) then hitting any key will resume scrolling. It's seldom needed since hitting the "scroll lock" key again will do the same thing. ixon: Enables the port to listen for Xoff and to stop transmitting when it gets an Xoff. Likewise, it will resume transmitting if it gets an Xon.
Serial HOWTO it's a setting not allowed in raw mode). This situation can create problems. For example, suppose you corrupt your terminal interface. To restore it you go to another terminal and "stty -F dev/ttyS1 sane" (or the like). It will not work! Of course you can try to type "stty sane ..." at the terminal that is corrupted but you can't see what you typed. All the above not only applies to dumb terminals but to virtual terminals used on a PC Monitor as well as to the terminal windows in X.
Serial HOWTO this you likely will have to reconfigure minicom and then exit it and restart it. Instead of all this bother, it may be simpler to just reboot the PC or via using a virtual terminal kill the process using "top" (or "ps" to get the process number and then "kill" to kill that process. The obsolete redirection method (which still works in later versions) is to type ``stty ... < /dev/ttyS2''.
Serial HOWTO 12. Speed (Flow Rate) By "speed" we really mean the "data flow rate" but almost everybody incorrectly calls it speed. The speed is measured in bits/sec (or baud). Speed is set using the "stty" command or by a program which uses the serial port. See Stty 12.1 Very High Speeds Speeds over 115.2kbps 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.
Serial HOWTO (a positive integer). This "divisor" divides the "maximum speed" of the hardware resulting in a slower speed (except a divisor of 1 obviously tells the hardware to run at maximum speed). There are exceptions to the above since for certain serial port hardware, speeds above 115.2k are set by using a very high divisor. Keep that exception in mind as you read the rest of this section. Normally, if you specify a speed of 115.
Serial HOWTO FAQ is at http://www.best.com/~cae/irqtune 13. Locking Out Others 13.1 Introduction When you are using a serial port, you may want to prevent others from using it at the same time. However there may be cases where you do want others to use it, such as sending you an important message if you are using a text-terminal. There are various ways of preventing others (or other processes) from using your serial port when you are using it (locking).
Serial HOWTO Using alternate names such as /dev/modem for /dev/ttyS2 may cause problems if one program opens /dev/ttyS2 while another program opens /dev/modem. This problem was supposedly fixed around 2000, but is still present in 2005. 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. 13.
Serial HOWTO • ZyXEL is a control program for ZyXEL U-1496 modems. It handles dialin, dialout, dial back security, FAXing, and voice mailbox functions. • SLIP and PPP software (if not in your Linux distribution) can be found at ftp://metalab.unc.edu/pub/Linux/system/network/serial. 14.2 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 following to your .
Serial HOWTO 15.2 Kernel Configuration 15.3 Number of Serial Ports Supported If you have more than 4 (or possibly 2) serial ports, then you must insure that the kernel knows this. It can be done by configuring the kernel when compiling or by a parameter given to the kernel when it starts (boot-prompt or kernel command line). The kernel configuration parameters: CONFIG_SERIAL_8250_RUNTIME_UARTS=4 and CONFIG_SERIAL_8250_NR_UARTS=4 set the maximum number of ordinary serial ports (UARTs) equal to 4.
Serial HOWTO Avoiding IO Address Conflicts with Certain Video Boards The IO address of the IBM 8514 video board (and others) is allegedly 0x?2e8 where ? is 2, 4, 8, or 9. This may conflict (but shouldn't if the serial port is well designed) with the IO address of ttyS3 at 0x02e8 if the serial port ignores the leading 0 hex digit when it decodes the address (many do). That is bad news if you try to use ttyS3 at this IO address.
Serial HOWTO means off (-12 v). They also sell a "RS-232 Serial Jumper Box" Cat. #276-1403. This permits connecting the pins anyway you choose. Both these items are under the heading of "Peripheral hookup helpers". Unfortunately, they are not listed in the index to the printed catalog. They are on the same page as the D type connecters so look in the index under "Connectors, Computer, D-Sub". A store chain named "Active Components" may have them.
Serial HOWTO number to it. 3. Your port does have a ttyS number assigned to it (like ttyS14) but you don't know which physical connector it is (on the back of your PC). See Which Connector on the Back of my PC is ttyS1, etc? First check BIOS messages at boot-time (and possibly the BIOS menu for the serial port). Then for the PCI bus type lspci -v.
Serial HOWTO to create a conflict. But a real conflict can be created if "setserial" has told the kernel incorrect info. The kernel has been lied to and thus doesn't think there is any conflict. Thus using "setserial" will not reveal the conflict (nor will looking at /proc/interrupts which bases its info on "setserial"). You still need to know what "setserial" thinks so that you can pinpoint where it's wrong and change it when you determine what's really set in the hardware.
Serial HOWTO Check the file permissions on this port with "ls -l /dev/ttyS?"_ If you own the ttyS? then you need read and write permissions: crw with the c (Character device) in col. 1. It you don't own it then it will work for you if it shows rw- in cols. 8 & 9 which means that everyone has read and write permission on it. Use "chmod" to change permissions. There are more complicated (and secure) ways to get access like belonging to a "group" that has group permission.
Serial HOWTO manually. Of course if there is no such process as 100 then you may just remove the lockfile but in most cases the lockfile should have been automatically removed if it contained a stale process id (such as 100). 16.15 "/dev/tty? Device or resource busy" This means that the device you are trying to access (or use) is supposedly busy (in use) or that a resource it needs (such as an IRQ) is supposedly being used by another device and can't be shared.
Serial HOWTO busy message goes away, it was likely a potential interrupt conflict. It's not a good idea to leave it permanently set at 0 since it will put more load on the CPU. 16.16 "Input/output error" from setserial, stty, pppd, etc. This means that communication with the serial port isn't working right. It could mean that there isn't any serial port at the IO address that setserial thinks your port is at. It could also be an interrupt conflict (or an IO address conflict).
Serial HOWTO 16.21 Almost all characters are wrong; Many missing or many extras Perhaps a baud mismatch. If one port sends at twice the speed that the other port is set to receive, then every two characters sent will be received as one character. Each bit of this received character will be a sample of two bits of what is sent and will be wrong. Also, only half the characters sent seem to get received. For flow in the reverse direction, it's just the opposite.
Serial HOWTO For the obsolete serial ports, only one character gets thru every several seconds. This is so slow that it seems almost like nothing is working (especially if the character that gets thru is invisible (such a space or newline). For the modern ports with FIFO buffers you will likely see bursts of up to 16 characters every several seconds. If you have a modem on the port and dial a number, it seemingly may not connect since the CONNECT message may not make it thru.
Serial HOWTO internal modem, the serial port is on the same card and it's likely to check that this 16-byte 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. Even with an external modem you might not get overruns.
Serial HOWTO Check /proc/interrupts to see if the IRQ is currently in use by another process. If it's in use by another serial port you could try "top" (type f and then enable the TTY display) or "ps -e" to find out which serial ports are in use. If you suspect that setserial has a wrong IRQ then see What is the current IO address and IRQ of my Serial Port ? 18. What Are UARTs? How Do They Affect Performance? 18.
Serial HOWTO a one-byte buffer. 18.3 FIFOs To understand the differences between dumb and FIFO (First In, First Out queue discipline) first let's examine what happens when a UART has sent or received a byte. The UART itself can't do anything with the data passing thru it, it just receives and sends it. For the obsolete dumb UARTS, the CPU gets an interrupt from the serial device every time a byte has been sent or received.
Serial HOWTO 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 64 bytes anyway in violation of the stop request. There is no stopping it since it doesn't know about flow control. If the buffer was large, then many more bytes would be sent in violation of flow control's request to stop. 18.5 UART Model Numbers Here's a list of some UARTs.
Serial HOWTO 4 1 9 5 1 2 3 4 5 6 7 8 9 20 8 22 7 9-Pin DB9 DCD RxD TxD DTR SG DSR RTS CTS RI DTR DCD RI SG Data Terminal Ready--> Data Carrier Detect<-Ring Indicator <-Signal Ground Connector Carrier Detect Receive Data Transmit Data Data Terminal Ready Signal Ground Data Set Ready Request To Send Clear To Send Ring Indicator 1 2 3 4 5 6 7 8 20 22 I'm ready to communicate Modem connected to another Telephone line ringing 25-Pin DB-25 Connector Chassis Ground TxD Transmit Data RxD Receive Data RTS R
Serial HOWTO pins 2 and 3 cross over each other (if you draw them on a sheet of paper). The above example is for a 25 pin connector but for a 9-pin connector the pin numbers 2 and 3 are just the opposite. The serial pin designations were originally intended for connecting a dumb terminal to a modem. The terminal was DTE (Data Terminal Equipment) and the modem was DCE (Data Communication Equipment). Today the PC is usually used as DTE instead of a terminal (but real terminals may still be used this way).
Serial HOWTO The DTR and DSR Pins Just like RTS and CTS, these pins are paired. For DTE-to-DTE connections they are likely to cross over. There are two ways to use these pins. One way is to use them as a substitute for RTS/CTS flow control. The DTR pin is just like the RTS pin while the DSR pin behaves like the CTS pin. Although Linux doesn't support DTR/DSR flow control, it can be obtained by connecting the RTS/CTS pins at the PC to the DSR/DTR pins at the device that uses DTR/DSR flow control.
Serial HOWTO 20.2 Voltage Sequence for a Byte The transmit pin (TxD) is held at -12 V (mark) at idle when nothing is being sent. To start a byte it jumps to +12 V (space) for the start bit and remains at +12 V for the duration (period) of the start bit. Next comes the low-order bit of the data byte. If it's a 0-bit nothing changes and the line remains at +12 V for another bit-period. If it's a 1-bit the voltage jumps from +12 to -12 V. After that comes the next bit (-12 V if a 1 or +12 V if a 0), etc.
Serial HOWTO Don't confuse this type of framing with the framing used for a packet of bytes on a network. The serial port just frames every byte. For a network, many bytes are framed into a packet (sometimes called a frame). For a network frame, instead of a start bit, there is a sequence of bytes called a header. On a network that uses serial ports (with modems), a report of a frame error usually refers to a multi-byte frame and not the serial port frame of a single byte. 20.
Serial HOWTO ports as "modem port", "printer port", and/or "GeoPort". Mac also provided conventional RS-232 but at only at 5 volts (which is still legal RS-232). To make it work like at RS-232 one must use a special cable which (signal) grounds RxD+ (one side of a balanced pair) and use RxD- as the receive pin. While TxD- is used as the transmit pin, for some reason TxD+ should not be grounded. See Macintosh Communications FAQ.
Serial HOWTO limited to short distances of at most 5 meters (depends on configuration). Linux supports the bus, although not all devices that can plug into the bus are supported. It is synchronous and transmits in special packets like a network. Just like a network, it can have several devices physically attached to it, including serial ports. Each device on it gets a time-slice of exclusive use for a short time. A device can also be guaranteed the use of the bus at fixed intervals.
Serial HOWTO intervals between bytes (like someone typing characters at a 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 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.
Serial HOWTO Notes re books: 1. "... Complete" has hardware details (including register) but the programming aspect is Window oriented. 2. "Physical Layer ..." covers much more than just RS-232. 22.2 Serial Software If it's not available in your Linux distribution try: Serial Software for Linux software for the serial ports including getty and port monitors. Serial Communications for communication programs. • irqtune will give serial port interrupts higher priority to improve performance.
Serial HOWTO 23. Appendix A: Very Obsolete Hardware/Software 23.1 Replacing pre 1990 UARTS Many 486 PCs (old) and all Pentiums (or the like) should have modern 16550As (usually called just 16550's) with FIFOs. If you have something really old (pre 1990), the chip may unplug so that you may be able to upgrade by finding a plug-in 16550A chip and replacing your old existing 16450 UART. If the functionality has been built into another type of chip, you are out of luck.
Serial HOWTO 23.5 Lock-Files if you used the depreciated devfs The abandoned device-filesystem (devfs) has the /dev directory with subdirectories. As of late 2001, there were problems with lockfiles. For example, the lockfile mechanism considered dev/usb/tts/0 and /dev/tts/0 to be the same device with name "0". Ditto for all other devices that had the same "leaf" name.