SETSERIAL(8)

NAME
setserial - get/set Linux serial port information

SYNOPSIS
/etc/setserial [ -g ] serial-device [ opt1 [ arg ] ] [ opt2 [ arg ] ] ...

DESCRIPTION
Without any options, setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A), the hardware I/O port, the hardware IRQ line, the "baud base," and the "flags." The device parameter will usually have the following form: /dev/ttys[0-3]. The "standard MS-DOS" port associations are given below:
    /dev/ttys0 (COM1), port 0x3f8, irq 4
    /dev/ttys1 (COM2), port 0x2f8, irq 3
    /dev/ttys2 (COM3), port 0x3e8, irq 4
    /dev/ttys3 (COM4), port 0x2e8, irq 3
Note, however, that Linux is not able to have a single IRQ line shared between multiple devices (special serial port hardware, such as the AST FourPort, can be used to overcome this limitation). Alternatively, some serial port cards (such as the Accent Async and the Twincom ACI/550) allow the selection of alternative I/O port addresses and IRQ lines. For example, the Linux 0.99.1 kernel is set up to check the following configurations if the CONFIG_ACCENT_ASYNC option is selected when building the kernel (/dev/ttys4 through /dev/ttys11 are reserved for the AST FourPort):
    /dev/ttys12, port 0x330, irq 4
    /dev/ttys13, port 0x338, irq 4
If the kernel's auto-detection of I/O port addresses and/or IRQ lines does not work reliably on your system, the setserial program can be called from your /etc/rc.local to adjust the configuration at boot time. The selection of an alternative IRQ line is difficult, since most of them are already used. The following table lists the "standard MS-DOS" assignments of available IRQ lines:
    IRQ 3: COM2
    IRQ 4: COM1
    IRQ 5: LPT2
    IRQ 7: LPT1
Most people find that IRQ 5 is a good choice, assuming that there is only one parallel port active in the computer. The only other available IRQ lines are 3, 4, and 7, and these are probably used by the other serial and parallel ports. (If your serial card has a 16bit card edge connector, and supports higher interrupt numbers, then IRQ 10, 11, 12, and 15 are also available.) On AT class machines, IRQ 2 is seen as IRQ 9, and Linux will interpret it in this manner. IRQ's other than 2 (9), 3, 4, 5, 7, 10, 11, 12, and 15, should not be used, since they are assigned to other hardware and cannot, in general, be changed. Here are the "standard" assignments:
    IRQ  0      Timer channel 0
    IRQ  1      Keyboard
    IRQ  2      Cascade for controller 2
    IRQ  3      Serial port 2
    IRQ  4      Serial port 1
    IRQ  5      Parallel port 2 (Reserved in PS/2)
    IRQ  6      Floppy diskette
    IRQ  7      Parallel port 1
    IRQ  8      Real-time clock
    IRQ  9      Redirected to IRQ2
    IRQ 10      Reserved
    IRQ 11      Reserved
    IRQ 12      Reserved (Auxillary device in PS/2)
    IRQ 13      Math coprocessor
    IRQ 14      Hard disk controller
    IRQ 15      Reserved

OPTIONS
All argument values are assumed to be in decimal unless preceeded by "0x". If the -g option is given, a list of devices can be specified, and the characteristics of those devices will be printed. Without the -g option, the characteristics of single device can be printed, a list is not allowed.

port port_number
    The port option sets the I/O port, as described above.

irq irq_number
    The irq option sets the hardware IRQ, as described above.

uart uart_type
    This option is used to set the UART type. The permitted types are none, 8250, 16450, 16550, and 16550A. Since the 8250's and 16450's do not have FIFO's, and since some 16550's have bugs which make the FIFO's unusable, the FIFO will only be used on 16550A chips. Setting the UART type to 8250, 16450, or 16550 will enable the serial port without trying to use the FIFO. Using UART type none will disable the port.

baud_base baud_base
    This option sets the base baud rate, which is the clock frequency divided by 16.

divisor divisor
    This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application.

sak Set the break key at the Secure Attention Key

-sak
    disable the Secure Attention Key

spd_hi
    Use 57.6kb when the application requests 38.4kb.

spd_vhi
    Use 115kb when the application requests 38.4kb.

spd_cust
    Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor.

spd_normal
    Use 38.4kb when the application requests 38.4kb.

CAUTION
CAUTION: Using an invalid port can lock up your machine.

BUGS
The "flags" information which setserial prints seems to be incorrect on some systems.

FILES
/etc/rc.local

SEE ALSO
tty(4), ttys(4), kernel/chr_drv/serial.c

AUTHOR
Rick Sladkey (jrs@world.std.com)
High speed modifications by: Michael K. Johnson (johnsonm@stolaf.edu)
Re-written by: Theodore Ts'o (tytso@mit.edu), 1/1/93