Next Previous Contents

## 1. Introduction

This HOWTO covers basic info about the old analog Serial Port and multiport serial cards. It contains much more information in it than most people who use serial ports need to know and most people are able to use the serial port without reading this HOWTO. But if you're having problems or just want to understand how it works, this is one place to find out about it.

This HOWTO is about the old and slow original serial port but it could have been designed to be much faster. See RS-232 Cable Is Low Speed & Short Distance. It uses a UART chip and is sometimes called a "UART serial port" to differentiate it from the newer types of serial devices: Universal Serial Bus or IEEE 1394 (Firewire). Information specific to devices which use serial ports: modems, text-terminals, infrared devices, and a few printers are found in Modem-HOWTO, Text-Terminal-HOWTO, Infrared-HOWTO, and Printing-HOWTO. Info on getty (the program that runs the login process or the like) has been also moved to other HOWTOs since mgetty and uugetty are best for modems while agetty is best for text-terminals. If you are dealing with a modem, text terminal, infrared device, or printer, then you may not need to consult this HOWTO. But if you are using the serial port for some other device, using a multiport serial card, trouble-shooting the serial port itself, or want to understand more technical details of the serial port, then you may want to use this 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-2009 by David S. Lawyer mailto:dave@lafn.org

Please freely copy and distribute (sell or give away) this document in any format. Send any corrections and comments to the document maintainer. You may create a derivative work and distribute it provided that you:

1. If it's not a translation: Email a copy of your derivative work (in a format LDP accepts) to the author(s) and maintainer (could be the same person). If you don't get a response then email the LDP (Linux Documentation Project): submit@en.tldp.org.
2. License the derivative work in the spirit of this license or use GPL. Include a copyright notice and at least a pointer to the license used.
3. Give due credit to previous authors and major contributors.

If you're considering making a derived work other than a translation, it's requested that you discuss your plans with the current maintainer.

### Disclaimer

While I haven't intentionally tried to mislead you, there are likely a number of errors in this document. Please let me know about them. Since this is free documentation, it should be obvious that I cannot be held legally responsible for any errors.

### Trademarks.

Any brand names (starts with a capital letter such as MS Windows) should be assumed to be a trademark). Such trademarks belong to their respective owners.

### Credits

Most of the original Serial-HOWTO was written by Greg Hankins. mailto:gregh@twoguys.org. He also rewrote many contributions by others in order to maintain continuity in the writing style and flow. He wrote: ``Thanks to everyone who has contributed or commented, the list of people has gotten too long to list (somewhere over one hundred). Special thanks to Ted Ts'o for answering questions about the serial drivers.'' Approximately half of v2.00 was from Greg Hankins HOWTO and the other half were additions by David Lawyer. Ted Ts'o has continued to be helpful. In Jan. 2006 "Charles Brockman" found many typos (which I fixed).

## 1.2 New Versions of this Serial-HOWTO

Since the serial port is legacy technology and much faster means of communication exist, new versions of the Serial-HOWTO will be released every year or so. A list of mirror sites where you'll find copies is at http://www.tldp.org/mirrors.html. If you only want to quickly check the date of the latest version look at http://www.tldp.org/HOWTO/Serial-HOWTO.html and compare it to this version: v2.27 December 2008 .

## 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

- 2.27 Dec. 2008: Changed 12 volts to 5 volts for typical serial port voltages today. generic_serial.ko module is not utilized by serial drivers. Use 8250.nr_uarts=16 etc. if serial support built into kernel and use nr_uarts=16 if a module. Erroneously had this reversed.
- 2.26 Nov. 2008: Changed EIA-232 to RS-232. PCI-e bus is serial. No serial port on most new PCs.
- 2.25 Jan. 2007 picocom. devfs is obsolete. ser2net. Revised parts on drivers as modules vs. built into kernel. Serial Programming wikibook.

## 1.4 Related HOWTO's, etc. about the Serial Port

Modems, Text-Terminals, some printers, and other peripherals often use the serial port. Get these HOWTOs from the nearest mirror site as explained above.

- `Modem-HOWTO` is about installing and configuring modems
- `Printing-HOWTO` has info for serial printers using old lpr command
- `LPRng-HOWTO` (not a LDP HOWTO, may come with software) has info for using the serial port for connecting to old printers using the "Next Generation" lpr program.
- Serial Programming is a wiki-book on the Internet
- `Serial-Programming-HOWTO` helps you write C programs that read and write to the serial port and/or check/set its state. A better version written by Vern Hoxie but not submitted to LDP is at Serial Programming HOWTO
- `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).
- `Remote-Serial-Console-HOWTO` is about making a text-terminal be the console so it can display boot-time messages, etc.

## 1.5 Feedback

Please send me any suggestions, or additional material. Tell me what you don't understand, or what could be clearer. You can reach me via email at `mailto:dave@lafn.org`.

## 1.6 What is a Serial Port?

The conventional serial port (not the newer USB port, or 1394 port) is a very old I/O (Input/Output) port. Until around 2006, most new desktop PC's had one, and old PC's from the 1990's sometimes had 2 of them. Most laptops gave up them before the desktops did. Macs (Apple Computer) after mid-1998 only had the USB port. However, it's possible, to put a conventional serial port device on the USB bus which is on all modern PCs.

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 (or /dev/tts/0 for the Device File System). 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". The connector(s) for the serial port are often seen as one or two 9-pin connectors (in some cases 25-pin) on the back of a PC. But the serial port is more than just connectors. It includes the associated electronics which must produce signals conforming to the RS-232 specification. See Voltage Waveshapes. One pin is used to send out data bytes and another to receive data bytes. Another pin is a common signal ground. The other "useful" pins are used mainly for signalling purposes with a steady negative voltage meaning "off" and a steady positive voltage meaning "on".

The UART (Universal Asynchronous Receiver-Transmitter) chip does most of the work. Today, the functionality of this chip is usually built into another chip. See What Are UARTs? These have improved over time and old models (prior to say 1994) are very obsolete.

The serial port was originally designed for connecting external modems to a PC but it's used to connect many other devices also such as mice, text-terminals, some printers, etc. to a computer. You just plug these devices into the serial port using the correct cable. Many internal modem cards have a built-in serial port so when you install one inside your PC it's as if you just installed another serial port in your PC.

The serial port is part of what Linux kernel programmers call the "tty layer". The text interface using the console on a PC is also part of the tty layer. Starting in 2005, Alan Cox and others made major improvements to this tty layer. A significant amount of work still was underway in 2008 to eliminate bugs including "race conditions" in this layer.

Next Previous Contents