Serial Port
The old, simple connection that sends data one bit at a time, inherited from teleprinters and modems, gone from consumer computers but still the last-resort console for servers, network gear, and embedded boards.
A serial port sends data one bit at a time over a single wire in each direction. For decades it was how computers talked to terminals, modems, printers, and mice. It disappeared from consumer computers around the turn of the century, but it remains in daily use wherever simplicity and reliability matter more than speed.
The common standard, RS-232, was introduced in 1960 to connect terminals to modems. The connection inherited the habits of teleprinters, which is why Unix still calls terminal devices TTYs, after teletypewriters; see Pseudoterminal. The unit of speed, the baud, is named after Émile Baudot, whose telegraph code preceded ASCII.
Most serial links are asynchronous. There's no shared clock wire. Instead, both ends agree on a speed in advance, such as 9,600 or 115,200 bits per second, and each byte is framed:
- A start bit signals that a byte is coming and lets the receiver synchronize.
- Usually eight data bits follow.
- An optional parity bit catches single-bit errors.
- A stop bit marks the end.
The chip that does this framing is called a UART, for universal asynchronous receiver-transmitter. If the two ends disagree about the speed, the result is garbled characters, a familiar sight to anyone who has set up a serial console.
Flow control prevents a fast sender from overwhelming a slow receiver. Hardware flow control uses extra wires to signal readiness. Software flow control uses two special characters, one to pause and one to resume. That convention survives in modern terminals, where pressing the pause key combination can freeze output until the resume combination is pressed; see Flow Control.
USB replaced serial ports on consumer machines because it was faster, carried power, and supported many devices identifying themselves automatically; see Universal Serial Bus. Ironically, much modern hardware also uses fast serial links internally; the change was in signaling technique, not in sending bits one at a time.
The serial port persists for good reasons:
- Consoles. Servers, routers, and switches offer a serial console that works before networking starts and after it fails, showing boot messages and kernel crashes; see Boot Process and Kernel Panic.
- Embedded systems. Microcontrollers and single-board computers use UART pins for debugging, and circuit boards inside consumer devices often expose unlabeled serial pins; see Internet of Things.
- Instruments. Lab equipment, industrial machines, and GPS receivers still speak serial protocols.
Adapters that present a serial port over USB are a standard item in technicians' kits. On Linux the port appears as a device file that programs open and read like any other.
See also2
Motherboard
The main circuit board of a computer, which carries the processor socket, memory slots and expansion slots and ties them together with the chipset, power regulation and firmware that let separately bought parts work as one machine.
Systems & Tooling6 connections
ANSI Escape Code
The in-band byte sequences, starting with the escape character, that tell a terminal to move the cursor, change color, or clear the screen, inherited from 1970s video terminals and still how every command-line tool draws.
Systems & Tooling12 connections
Linked from9
- ANSI Escape CodeSystems & Tooling
The in-band byte sequences, starting with the escape character, that tell a terminal to move the cursor, change color, or clear the screen, inherited from 1970s video terminals and still how every command-line tool draws.
- BackpressureNetworks & Distribution
Backpressure is a slow receiver telling a fast sender to hold up, so a queue grows on purpose instead of by accident.
- Boot ProcessSystems & Tooling
The chain of handoffs from power button to login screen, firmware to bootloader to kernel to init, and where each link can break or be verified.
- Device FileSystems & Tooling
Special files that represent hardware and kernel services, letting programs read a disk, a mouse, or a stream of random bytes with the same calls they use on ordinary files.
- Internet of ThingsNetworks & Distribution
Everyday objects with network connections, from thermostats and light bulbs to industrial sensors, notorious for weak security, dependence on vendor clouds, and devices that outlive the companies supporting them.
- Kernel PanicSystems & Tooling
The operating system kernel deliberately halting when it detects an error it can't safely recover from, the Unix version of the Blue Screen of Death, and how crash dumps and watchdogs turn it into a fast reboot.
- LoopbackNetworks & Distribution
The network address a computer uses to talk to itself, where packets go out and come straight back without touching any hardware, the home of development servers and a recurring blind spot in security.
- MotherboardSystems & Tooling
The main circuit board of a computer, which carries the processor socket, memory slots and expansion slots and ties them together with the chipset, power regulation and firmware that let separately bought parts work as one machine.
- Universal Serial BusSystems & Tooling
The connector standard that replaced a drawer of serial, parallel, and keyboard ports in the late 1990s, built around a host that polls every device, and later a single reversible plug for data, video, and power.