The serial ports in Linux
Despite all the preceding serial ports names, in GNU/Linux /dev/ttyXXX, where the XXX string may vary according to the specific serial port implementations. For instance, the historical (and standard) names of the PC's UART serial ports are /dev/ttyS0
, /dev/ttyS1
, and so on, but (as seen in the previous chapters) the USB-to-serial adapters can be named as /dev/ttyUSB0
, /dev/ttyUSB1
or /dev/ttyACM0
, /dev/ttyACM1
, and so on.
The tty
prefix comes from the very old abbreviation of teletypewriter and was originally associated only with the physical connection to a Unix system. Now that name also represents any serial port-style devices, such as serial ports, USB-to-serial converters, tty virtual devices, and so on.
The Linux tty driver core (that is implemented using a char driver) is responsible for controlling both the flow of data across a tty device and the format of the data. This is obtained using a line discipline (LDISC), which is a mid-layer between the upper...