查看串口驱动
cat /proc/tty/driver/serial
查看串口设备
dmesg | grep ttyS*
[root@localhost driver]# cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:0 rx:0
1: uart:16550A port:000002F8 irq:3 tx:0 rx:0 CTS|DSR|CD
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
[root@localhost driver]# dmesg | grep ttyS*
[ 0.142050] printk: console [tty0] enabled
[ 1.626611] 00:06: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 1.627147] 00:07: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A
[ 7.372444] systemd[1]: Created slice Slice /system/getty.
docker映射:
容器访问到虚拟机的串口?
直接支持,在linux系统中,串口使用–device=/dev/ttyS1:/dev/ttyS2参数运行,即可直接在容器中访问串口1。
devices:
- "/dev/ttyS1:/dev/ttyS1"
- "/dev/ttyS0:/dev/ttyS0"
- "/dev/ttyUSB0:/dev/ttyUSB0"
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"