`/dev/ttyS0` 和 `/dev/ttys0` 之间的区别?
-
09-06-2019 - |
题
在Linux中,有什么区别 /dev/ttyS0
和 /dev/ttys0
?
我知道第一个是串口,但是第二个呢,有小 s
?
解决方案
对于伪终端对,例如ptyp3和ttyp3,pty ...是主人或控制终端和TTY ...是奴隶。只有16个TTYP:TTYP0-TTYPF(F是十六进制数字)。 要获得更多对,可以使用3个字母Q,r,s代替P. 。例如,对TTYS8,PTYS8是伪端对。主体和从属实际上是相同的“端口”,但是从应用程序使用了从属程序,并且主机由网络程序(或类似)使用,该网络程序(或类似)将数据(并获取)数据送到从属端口。
其他提示
在内核文档的 Linux 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.
我不知道这对你有多大帮助,但应该让你朝着正确的方向开始。
不隶属于 StackOverflow