Using the Configuration Utilities
Now let’s spend some time looking at the two most useful serial device configuration utilities: setserial and stty.
The setserial Command
The kernel will make its best effort to correctly determine how your serial hardware is configured, but the variations on serial device configuration makes this determination difficult to achieve 100 percent reliably in practice. A good example of where this is a problem is the internal modems we talked about earlier. The UART they use has a 16-byte FIFO buffer, but it looks like a 16450 UART to the kernel device driver: unless we specifically tell the driver that this port is a 16550 device, the kernel will not make use of the extended buffer. Yet another example is that of the dumb 4-port cards that allow sharing of a single IRQ among a number of serial devices. We may have to specifically tell the kernel which IRQ port it’s supposed to use, and that IRQs may be shared.
setserial was created to configure the serial driver
at runtime. The setserial command is most commonly
executed at boot time from a script called 0setserial
on some distributions, and rc.serial on others. This
script is charged with the responsibility of initializing the serial driver
to accommodate any nonstandard or unusual serial hardware in the machine.
The general syntax for the setserial command is:
setserialdevice[parameters]
in which the device is one of the serial devices, such as ttyS0.
The setserial command has a large number of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access