why do I have 32 ttyS

I seem to have ttyS0 all the way to ttyS31, the only real (well virtual but at least they do someting) serialports on my machine are ttyACM0 and rfcomm0, what are all these ttyS's for?


Solution 1:

That maximum possible number of serial ttys is hard-coded to be 32 via the kernel config setting CONFIG_SERIAL_8250_RUNTIME_UARTS

The /dev/ttyS* char devices will only be functional when the 8250 UART driver finds the serial UARTs on the machine.

The kernel is configured with such a high value because some machines support that many UARTs.

Solution 2:

I suppose you are looking into /dev. The ttyS* devices are always available, even when not usable. In fact, if you try to write to them you'll get EIO:

# echo > /dev/ttyS12
-bash: echo: write error: Input/output error