- 论坛徽章:
- 1
|
请问/dev/ttyS1 和 ttys1各是什么设备
請先用 file 命令:
- $ file /dev/ttys1
- /dev/ttys1: character special (3/49)
- $ file /dev/ttyS1
- /dev/ttyS1: character special (4/65)
复制代码
你可在 /usr/src/linux/Documentation/devices.txt 找到如下說明:
- 3 char Pseudo-TTY slaves
- 0 = /dev/ttyp0 First PTY slave
- 1 = /dev/ttyp1 Second PTY slave
- ...
- 255 = /dev/ttyef 256th PTY slave
- These are the old-style (BSD) PTY devices; Unix98
- devices are on major 136 and above.
- 4 char TTY devices
- 0 = /dev/tty0 Current virtual console
- 1 = /dev/tty1 First virtual console
- ...
- 63 = /dev/tty63 63rd virtual console
- 64 = /dev/ttyS0 First UART serial port
- ...
- 255 = /dev/ttyS191 192nd UART serial port
- UART serial ports refer to 8250/16450/16550 series devices.
- Older versions of the Linux kernel used this major
- number for BSD PTY devices. As of Linux 2.1.115, this
- is no longer supported. Use major numbers 2 and 3.
复制代码
從說明中,我們可推斷出:
* character special (3/49) 就是第 50th PTY slave
* character special (4/65) 就是第二個(second) UART serial port |
|