Next Previous Contents

# Serial HOWTO

## David S.Lawyer `dave@lafn.org` original by Greg Hankins

v2.27 December 2008

This document describes the UART serial port features other than those which should be covered by Modem-HOWTO, PPP-HOWTO, Serial-Programming-HOWTO, or Text-Terminal-HOWTO. It lists info on multiport serial cards. It contains technical info about the serial port itself in more detail than found in the above HOWTOs and should be best for troubleshooting when the problem is the serial port itself. If you are dealing with a Modem, PPP (used for Internet access on a phone line), or a Text-Terminal, those HOWTOs should be consulted first. It's also useful as an introduction to how the serial port works before reading other documents on how to program it.

## 1. Introduction

- 1.1 Copyright, Disclaimer, & Credits
- 1.2 New Versions of this Serial-HOWTO
- 1.3 New in Recent Versions
- 1.4 Related HOWTO's, etc. about the Serial Port
- 1.5 Feedback
- 1.6 What is a Serial Port?

## 2. Quick Help

## 3. How the Hardware Transfers Bytes

- 3.1 Transmitting
- 3.2 Receiving
- 3.3 The Large Serial Buffers

## 4. Serial Port Basics

- 4.1 What is a Serial Port ?
- 4.2 IO Address & IRQ
- 4.3 Names: ttyS0, ttyS1, etc.
- 4.4 Interrupts
- 4.5 Data Flow (Speeds)
- 4.6 Flow Control
- 4.7 Data Flow Path; Buffers
- 4.8 Complex Flow Control Example
- 4.9 Serial Driver Module

## 5. Is the Serial Port Obsolete?

- 5.1 Introduction
- 5.2 RS-232 Cable Is Low Speed & Short Distance
- 5.3 Inefficient PCI Interface to the Computer (in some cases)

## 6. Multiport Serial Boards/Cards/Adapters

- 6.1 Intro to Multiport Serial
- 6.2 Dumb vs. Smart Cards
- 6.3 Getting/Enabling a Driver
- 6.4 Multiport Devices in the /dev Directory,
- 6.5 Making Legacy Multiport Devices in the /dev Directory
- 6.6 Standard PC Serial Cards
- 6.7 Dumb Multiport Serial Boards (with standard UART chips)
- 6.8 Intelligent Multiport Serial Boards
- 6.9 Unsupported Multiport Boards

## 7. Servers for Serial Ports

## 8. Configuring Overview

## 9. Locating the Serial Port: IO address, IRQs

- 9.1 What Bus is my Serial Port On?
- 9.2 IO & IRQ Overview
- 9.3 PCI Bus Support
- 9.4 Common mistakes made re low-level configuring
- 9.5 IRQ & IO Address Must be Correct
- 9.6 What is the IO Address and IRQ per the driver ?
- 9.7 What is the IO Address & IRQ of my Serial Port Hardware?
- 9.8 Choosing Serial IRQs
- 9.9 Choosing Addresses --Video card conflict with ttyS3
- 9.10 Set IO Address & IRQ in the hardware (mostly for PnP)
- 9.11 Giving the IRQ and IO Address to Setserial

## 10. Configuring the Serial Driver (high-level) "stty"

- 10.1 Overview
- 10.2 Flow Control

## 11. Serial Port Devices /dev/tts/2 = /dev/ttyS2, etc.

- 11.1 Serial Port Names: ttyS4, etc
- 11.2 The PCI Bus
- 11.3 Serial Port Device Names & Numbers
- 11.4 More on Serial Port Names
- 11.5 USB (Universal Serial Bus) Serial Ports
- 11.6 Link ttySN to /dev/modem
- 11.7 Devfs (The Improved but Obsolete Device File System)
- 11.8 Which Connector on the Back of my PC is ttyS1, etc?
- 11.9 Creating Devices In the /dev directory

## 12. Interesting Programs You Should Know About

- 12.1 Serial Monitoring/Diagnostics Programs
- 12.2 Changing Interrupt Priority
- 12.3 What is Setserial ?
- 12.4 Stty
- 12.5 What is isapnp ?
- 12.6 Connecting two PCs together via serial ports
- 12.7 Connect the serial port to a fast network: ser2net

## 13. Speed (Flow Rate)

- 13.1 Very High Speeds
- 13.2 Higher Serial Throughput

## 14. Locking Out Others

- 14.1 Introduction
- 14.2 Lock-Files
- 14.3 Lock-Files if you use devfs
- 14.4 Change Owners, Groups, and/or Permissions of Device Files

## 15. Serial Communications Programs And Utilities

- 15.1 List of Software
- 15.2 kermit and zmodem

## 16. Serial Tips And Miscellany

- 16.1 Serial Modules
- 16.2 Kernel Configuration
- 16.3 Number of Serial Ports Supported
- 16.4 Serial Console (console on the serial port)
- 16.5 Line Drivers
- 16.6 Stopping the Data Flow when Printing, etc.
- 16.7 Known IO Address Conflicts
- 16.8 Known Defective Hardware

## 17. Troubleshooting

- 17.1 Serial Electrical Test Equipment
- 17.2 Serial Monitoring/Diagnostics
- 17.3 (The following subsections are in both the Serial and Modem HOWTOs)
- 17.4 Serial Port Can't be Found
- 17.5 Linux Creates an Interrupt Conflict (your PC has an ISA slot)
- 17.6 Extremely Slow: Text appears on the screen slowly after long delays
- 17.7 Somewhat Slow: I expected it to be a few times faster
- 17.8 The Startup Screen Shows Wrong IRQs for the Serial Ports
- 17.9 "Cannot open /dev/ttyS?: Device or resource busy
- 17.10 "Cannot open /dev/ttyS?: Permission denied"
- 17.11 "Cannot open /dev/ttyS?"
- 17.12 "Operation not supported by device" for ttyS?
- 17.13 "Cannot create lockfile. Sorry"
- 17.14 "Device /dev/ttyS? is locked."
- 17.15 "/dev/tty? Device or resource busy"
- 17.16 "Input/output error" from setserial, stty, pppd, etc.
- 17.17 "LSR safety check engaged"
- 17.18 Overrun errors on serial port
- 17.19 Port gets characters only sporadically
- 17.20 Troubleshooting Tools
- 17.21 Almost all characters are wrong; Many missing or many extras

## 18. Interrupt Problem Details

- 18.1 Types of interrupt problems
- 18.2 Symptoms of Mis-set or Conflicting Interrupts
- 18.3 Mis-set Interrupts
- 18.4 Interrupt Conflicts
- 18.5 Resolving Interrupt Problems

## 19. What Are UARTs? How Do They Affect Performance?

- 19.1 Introduction to UARTS
- 19.2 Two Types of UARTs
- 19.3 FIFOs
- 19.4 Why FIFO Buffers are Small
- 19.5 UART Model Numbers

## 20. Pinout and Signals

- 20.1 Pinout of 9-pin and 25-pin serial connectors
- 20.2 Signals May Have No Fixed Meaning
- 20.3 Cabling Between Serial Ports
- 20.4 RTS/CTS and DTR/DSR Flow Control
- 20.5 Preventing a Port From Opening

## 21. Voltage Waveshapes

- 21.1 Voltage for a Bit
- 21.2 Voltage Sequence for a Byte
- 21.3 Parity Explained
- 21.4 Forming a Byte (Framing)
- 21.5 How "Asynchronous" is Synchronized

## 22. Other Serial Devices (not async RS-232)

- 22.1 Successors to RS-232
- 22.2 EIA-422-A (balanced) and EIA-423-A (unbalanced)
- 22.3 EIA-485
- 22.4 EIA-530
- 22.5 EIA-612/613
- 22.6 The Universal Serial Bus (USB)
- 22.7 IEEE 1394 (Firewire)
- 22.8 Ethernet
- 22.9 MIDI
- 22.10 Synchronization & Synchronous

## 23. Other Sources of Information

- 23.1 Books
- 23.2 Serial Software
- 23.3 Related Linux Documents
- 23.4 Usenet newsgroups:
- 23.5 Serial Mailing List
- 23.6 Internet

## 24. Appendix A: Obsolete Hardware/Software

- 24.1 Replacing pre 1990 UARTS
- 24.2 Two Ports with the Same IO address
- 24.3 Configuring by modifying source code
- 24.4 Modems on Multiport Cards Obsolete for Sending at 56k

Next Previous Contents