setserial
Configure and query serial port settings
TLDR
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, 16650V2, 16654, 16750, 16850, 16950, 16954)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 ratesspd_hi
Use 57600 baud when an application requests 38400 baudspd_vhi
Use 115200 baud when an application requests 38400 baudspd_cust
Use custom divisor (set via divisor parameter) when an application requests 38400 baudspd_normal
Use standard 38400 baud rate (resets spdhi, spdvhi, etc.)close_delay delay
Time in hundredths of a second that DTR should be kept low after port closeclosing_wait delay
Time in hundredths of a second to wait for data to drain on closeauto_irq
Attempt to determine IRQ during autoconfig^auto_irq
Disable automatic IRQ detection during autoconfigskip_test
Skip UART test during autoconfiglow_latency
Minimize receive latency at the cost of CPU overhead^low_latency
Disable low latency mode (default)
CAVEATS
Incorrect settings can cause serial ports to malfunction or conflict with other devices. The -W wild interrupt initialization is obsolete on kernels after version 2.1. 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.
