(revised) test for linux serial ports


Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4345
Posted: 03:24pm 13 Dec 2024      

  robert.rozee said  John: if the machine has no serial present, then there should be no output. although, some machines do seem to have a single serial port present 'on the motherboard', even if it is not accessible to the outside world.

That's what I thought.

user@user-DH61BE:~/shared/Serial Watcher, console, revised$ ./ports
test for revised serial port finder method, 13-dec-2024
ttyS0 is type 16550A UART    /sys/bus/serial-base/drivers/port    (/type)
ttyS4 is type 16550A UART    /sys/bus/serial-base/drivers/port    (/type)
ttyS5 is type 16550A UART    /sys/bus/serial-base/drivers/port    (/type)

That's more like what I expected.

I thought even if not accessible they all had such so am surprised by mine.

dmesg has:
Serial: 8250/16550 driver, 8 ports, IRQ sharing enabled

(and as mentioned I have ttyS0-7)

On an older system, kernel 5.6.14:
test for revised serial port finder method, 13-dec-2024

>>>  4 errors reading /type
>>>  0 errors reading ioctl

so still no apparent serial ports, accessible or not.

dmesg has:
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

John