SIO(4)
πΈ NAME β SIO(4), aka sio πΈ
okay so bestie, gather round, because sio is the fast interrupt driven asynchronous serial communications interface. That's it, that's the whole vibe: serial ports, interrupts, speed. She's been holding down serial comms since forever and she is not slowing down. π
β¨ SYNOPSIS β¨
The setup totally depends on what hardware you've got, so pick your fighter π and copy the block that matches.
π For standard ISA ports
device sio
In /boot/device.hints:
hint.sio.0.at="isa"
hint.sio.0.port="0x3f8"
hint.sio.0.flags="0x10"
hint.sio.0.irq="4"
hint.sio.1.at="isa"
hint.sio.1.port="0x2f8"
hint.sio.1.flags="0x0"
hint.sio.1.irq="3"
π For AST compatible multiport cards with 4 ports
options COM_MULTIPORT
device sio
In /boot/device.hints:
hint.sio.4.at="isa"
hint.sio.4.port="0x2a0"
hint.sio.4.flags="0x701"
hint.sio.5.at="isa"
hint.sio.5.port="0x2a8"
hint.sio.5.flags="0x701"
hint.sio.6.at="isa"
hint.sio.6.port="0x2b0"
hint.sio.6.flags="0x701"
hint.sio.7.at="isa"
hint.sio.7.port="0x2b8"
hint.sio.7.flags="0x701"
hint.sio.7.irq="12"
π For Boca Board compatible multiport cards with 8 ports
options COM_MULTIPORT
device sio
In /boot/device.hints:
hint.sio.4.at="isa"
hint.sio.4.port="0x100"
hint.sio.4.flags="0xb05"
...
hint.sio.11.at="isa"
hint.sio.11.port="0x138"
hint.sio.11.flags="0xb05"
hint.sio.11.irq="12"
π For Netmos Nm9845 multiport cards with 6 ports
options COM_MULTIPORT
device sio
In /boot/device.hints:
hint.sio.4.at="isa"
hint.sio.4.port="0xb000"
hint.sio.4.flags="0x901"
hint.sio.5.at="isa"
hint.sio.5.port="0xb400"
hint.sio.5.flags="0x901"
hint.sio.6.at="isa"
hint.sio.6.port="0xb800"
hint.sio.6.flags="0x901"
hint.sio.7.at="isa"
hint.sio.7.port="0xbc00"
hint.sio.7.flags="0x901"
hint.sio.8.at="isa"
hint.sio.8.port="0xc000"
hint.sio.8.flags="0x901"
hint.sio.9.at="isa"
hint.sio.9.port="0xac00"
hint.sio.9.flags="0x901"
hint.sio.9.irq="12"
π For Hayes ESP cards
options COM_ESP
device sio
...
π For single port PCI and PCCARD cards
device sio
No lines are required in /boot/device.hints for these cards. She just knows. π«
π For dual port PCI cards that share an interrupt
device sio
options COM_MULTIPORT
In /boot/device.hints:
hint.sio.2.flags="0x201"
hint.sio.3.flags="0x201"
π Meaning of flags
0x00001β shared IRQs0x00002β disable FIFO0x00004β no AST/4 compatible IRQ control register0x00008β recover sooner from lost output interrupts0x00010β device is potential system console0x00020β device is forced to become system console0x00040β device is reserved for low-level IO (e.g. for remote kernel debugging)0x00080β use this port for remote kernel debugging0x0??00β minor number of master port0x10000β PPS timestamping on CTS instead of DCD0x20000β device is assumed to use a 16650A-type (extended FIFO) chip
π DESCRIPTION π
The sio driver provides support for NS8250-, NS16450-, NS16550 and NS16550A-based EIA RS-232C (CCITT V.24) communications interfaces. So like β the NS8250 and the NS16450 have single character buffers, while the NS16550A is the bougie one with 16 character FIFO input and output buffers. Buffers, she has them. π«Ά
Input and output for each line may set to one of following baud rates; 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 28800, 38400, 57600, or 115200. Just know that your hardware may limit your baud rate choices β it's not the driver being difficult, it's the silicon. π
The driver supports multiport cards. Multiport cards are those that have one or more groups of ports that share an Interrupt Request (IRQ) line per group. Shared IRQs on different cards are not supported. Frequently 4 ports share 1 IRQ; some 8 port cards have 2 groups of 4 ports, thus using 2 IRQs. Some cards allow the first 2 serial ports to have separate IRQs per port (as per DOS PC standard).
Some cards have an IRQ control register for each group. Some cards require special initialization related to such registers. Only AST/4 compatible IRQ control registers are supported. Some cards have an IRQ status register for each group. The driver does not require or use such registers yet. To work, the control and status registers for a group, if any, must be mapped to the scratch register (register 7) of a port in the group. Such a port is called a master port. π
The driver supports controller based PCI modems. The 3Com FaxModem PCI and the Advantec 56k Voice Messaging PCI FaxModem are the only cards supported. WinModems, softmodems, hfc modems and any other modems that are not controller based are not supported. Not me having to be the bearer of bad news. π
The flags keyword may be used on each device sio line in the kernel configuration file to disable the FIFO on 16550A UARTs (see the synopsis). Disabling the FIFO should rarely be necessary.
The flags keyword must be used for all ports that are part of an IRQ sharing group. One bit specifies IRQ sharing; another bit specifies whether the port does not require AST/4 compatible initialization. The minor number of the device corresponding a master port for the group is encoded as a bitfield in the high byte. The same master port must be specified for all ports in a group.
The irq specification must be given for master ports and for ports that are not part of an IRQ sharing group, and not for other ports.
In the synopsis, flags 0x701 means that the 8th port (sio7) is the master port, and that the port is on a multiport card with shared IRQs and an AST/4 compatible IRQ control register.
flags 0xb05 means that the 12th port (sio11) is the master port, and that the port is on a multiport card with shared IRQs and no special IRQ control register.
Which port is the master port depends on the card type. Consult the hardware documentation of your card. Since IRQ status registers are never used, and IRQ control registers are only used for AST/4 compatible cards, and some cards map the control/status registers to all ports in a group, any port in a group will sometimes do for the master port. Choose a port containing an IRQ status register for forwards compatibility, and the highest possible port for consistency.
Serial ports controlled by the sio driver can be used for both callin and callout. For each port there is a callin device and a callout device. The minor number of the callout device is 128 higher than that of the corresponding callin port. The callin device is general purpose. Processes opening it normally wait for carrier and for the callout device to become inactive. The callout device is used to steal the port from processes waiting for carrier on the callin device. Processes opening it do not wait for carrier and put any processes waiting for carrier on the callin device into a deeper sleep so that they do not conflict with the callout session. The callout device is abused for handling programs that are supposed to work on general ports and need to open the port without waiting but are too stupid to do so. π not "too stupid to do so" being in the official docs, they really said it.
The sio driver also supports an initial-state and a lock-state control device for each of the callin and the callout "data" devices. The termios settings of a data device are copied from those of the corresponding initial-state device on first opens and are not inherited from previous opens. Use stty(1) in the normal way on the initial-state devices to program initial termios states suitable for your setup.
The lock termios state acts as flags to disable changing the termios state. E.g., to lock a flag variable such as CRTSCTS, use stty crtscts on the lock-state device. Speeds and special characters may be locked by setting the corresponding value in the lock-state device to any nonzero value. E.g., to lock a speed to 115200, use βstty 115200β on the initial-state device and βstty 1β on the lock-state device.
Correct programs talking to correctly wired external devices work with almost arbitrary initial states and almost no locking, but other setups may benefit from changing some of the default initial state and locking the state. In particular, the initial states for non (POSIX) standard flags should be set to suit the devices attached and may need to be locked to prevent buggy programs from changing them. E.g., CRTSCTS should be locked on for devices that support RTS/CTS handshaking at all times and off for devices that do not support it at all. CLOCAL should be locked on for devices that do not support carrier. HUPCL may be locked off if you do not want to hang up for some reason. In general, very bad things happen if something is locked to the wrong state, and things should not be locked for devices that support more than one setting. The CLOCAL flag on callin ports should be locked off for logins to avoid certain security holes, but this needs to be done by getty if the callin port is used for anything else.
π¨ real talk: locking the wrong thing = chaos. Locked states are forever, bestie. Choose wisely. π
π¦ FILES π¦
/dev/ttyd?β for callin ports/dev/ttyd?.init/dev/ttyd?.lockβ corresponding callin initial-state and lock-state devices
<br>
/dev/cuad?β for callout ports/dev/cuad?.init/dev/cuad?.lockβ corresponding callout initial-state and lock-state devices
<br>
/etc/rc.d/serialβ examples of setting the initial-state and lock-state devices
The device numbers are made from the set [0-9a-v] so that more than 10 ports can be supported. (That's why it goes letters, she planned ahead. π)
π DIAGNOSTICS π
sio%d: silo overflow.β Problem in the interrupt handler.sio%d: interrupt-level buffer overflow.β Problem in the bottom half of the driver.sio%d: tty-level buffer overflow.β Problem in the application. Input has arrived faster than the given module could process it and some has been lost.
π SEE ALSO π
stty(1), termios(4), tty(4), comcontrol(8)
π HISTORY π
The sio driver is derived from the HP9000/300 dca(4) driver and is currently under development.
π BUGS π
okay bestie, sit down, we gotta talk about the β¨rough edgesβ¨ because this driver is iconic but it is NOT perfect and I would simply be a bad friend if I didn't tell you.
- Data loss can happen π at very high baud rates on slow systems, or with too many ports on any system, or on heavily loaded systems when
crtsctscannot be used. The fix? The use ofNS16550A's reduces system load and helps to avoid data loss. so like, get you a chip that multitasks π - Stay AWAY from plain
NS16550's. not me being dramatic, this is real. These are early implementations of the chip with non-functional FIFO hardware. they're giving "beta test era" and not in a cute way π« - The constants which define the locations of the various serial ports are holdovers from DOS. as shown, hex addresses can be and for clarity probably should be used instead. yes bestie, DOS ghosts are haunting our config files, it's giving nostalgia nobody asked for π§
- π Note that on the
AST/4the card's dipswitches should not be set to use interrupt sharing.AST/4-like interrupt sharing is only used when multipleAST/4cards are installed in the same system. And fr fr: thesiodriver does not support more than 1AST/4on one IRQ. one. that's the whole limit. periodt π - The examples in the synopsis are too vendor-specific. yeah they're a vibe but they're not universal, don't @ me π
π«Ά friendly reminder that none of this is me being mean, this is just the manpage being honest with you before you get hurt. read the warnings, love yourself π
and that's a wrap on SIO(4), bestie!! this page comes to you from Debian, dated August 30, 2006, and it's filed under SIO(4). mwah, go forth and configure your serial ports responsibly πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1990, 1991 The Regents of the University of California
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms