setserial
TLDR
Print all information about a serial device
SYNOPSIS
setserial [-abqvVWz] device [parameter [arg]]...
setserial -g [-abGv] device...
DESCRIPTION
setserial configures and queries serial port settings including I/O port addresses, IRQ lines, UART types, and operational flags. It is primarily used during system startup to initialize serial ports beyond the standard COM1-COM4 ports or to configure non-standard hardware.
The command can auto-detect UART types and set custom baud rates for specialized hardware. Modern systems with udev often handle serial configuration automatically, but setserial remains useful for legacy hardware and custom configurations.
PARAMETERS
-a
Display all available configuration information-b
Print summary configuration suitable for bootup scripts-g
Report characteristics of multiple devices-G
Print configuration as setserial command-line arguments-q
Quiet mode; suppress status output-v
Verbose mode; display additional status info-V
Print version and exit-z
Zero out flags before setting new valuesport portnumber_
Set the I/O port addressirq irqnumber_
Set the interrupt request lineuart uarttype_
Set UART type (none, 8250, 16450, 16550, 16550A, 16650, 16750, etc.)autoconfig
Automatically detect UART type and IRQbaud_base baud
Set base baud rate (clock frequency / 16)divisor divisor
Set custom clock divisor for non-standard baud rateslow_latency
Minimize receive latency at the cost of CPU overhead
CAVEATS
Incorrect settings can cause serial ports to malfunction or conflict with other devices. The -W wild interrupt initialization is obsolete on modern kernels. Many settings require root privileges. On systems using systemd, serial port configuration may be handled differently through udev rules.
HISTORY
setserial was written by Theodore Ts'o and has been part of Linux since the early 1990s, originally to help configure the diverse serial hardware of that era. The tool became essential for setting up modems, terminals, and serial mice. While less critical on modern hardware with automatic detection, it remains in the setserial package for legacy support.


