Serial device names and types

Serial device names and types


The device names used for serial port devices vary quite widely between
systems. Some examples from different systems are:






  • `/dev/tty[0-9][a-z]' for direct access devices, and
    `/dev/tty[0-9][A-Z]' for modem control devices (e.g. SCO Unix)



  • `/dev/cua[0-9]p[0-9]' for direct access devices,
    `/dev/cul[0-9]p[0-9]' for dial-out devices and
    `/dev/ttyd[0-9]p[0-9]' for dial-in devices
    (e.g. HP-UX)



  • `/dev/cua[a-z][0-9]' for dial-out devices and
    `/dev/tty[a-z][0-9]' for dial-in devices (e.g. FreeBSD)



The precise interaction between the device name used, and the effect on
any hardware handshake lines is system-, configuration- and
hardware-dependant, but will usually follow approximately these rules
(assuming that the hardware is RS-232 DTE):






  • A successful open of any device should assert DTR and RTS



  • A blocking open of a modem-control or dial-in device will wait for
    DCD (and possibly also DSR and/or CTS) to be raised, usually after
    asserting DTR/RTS.



  • An open of a dial-out device while an open call to the corresponding
    dial-in device is blocked waiting for carrier may or may not
    cause the open of the dial-in port to complete. Some systems implement a
    simple sharing scheme for dial-in and dial-out ports whereby the dial-in
    port is effectively "put to sleep" while the dial-out port is in use;
    other systems do not do this, and sharing the port between dial-in and
    dial-out on such systems requires external cooperation (e.g. use of UUCP
    lockfiles) to avoid contention problems.






Home FAQ