In Linux, what is the difference between /dev/ttyS0
and /dev/ttys0
?
在Linux中,/ dev / ttyS0和/ dev / ttys0之间有什么区别?
I know that the first is a serial port, but what about the second, with the small s
?
我知道第一个是串口,但第二个是什么,小s?
3 个解决方案
#1
1
For a pseudo terminal pair such as ptyp3 and ttyp3, the pty... is the master or controlling terminal and the tty... is the slave. There are only 16 ttyp's: ttyp0-ttypf (f is a hexadecimal digit). To get more pairs, the 3 letters q, r, s may be used instead of p. For example the pair ttys8, ptys8 is a pseudo terminal pair. The master and slave are really the same "port" but the slave is used by the application program and the master is used by a network program (or the like) which supplies (and gets) data to/from the slave port.
对于伪终端对,例如ptyp3和ttyp3,pty ......是主终端或控制终端,而tty ...是从属终端。只有16个ttyp:ttyp0-ttypf(f是十六进制数字)。为了获得更多对,可以使用3个字母q,r,s代替p。例如,对ttys8,ptys8是伪终端对。主设备和从设备实际上是相同的“端口”,但是应用程序使用从设备,并且主设备由向从端口提供(和获取)数据的网络程序(或类似设备)使用。
#2
0
And this: http://lists.opensuse.org/archive/opensuse/2003-12/msg02404.html
这个:http://lists.opensuse.org/archive/opensuse/2003-12/msg02404.html
#3
0
In the Linux devices.txt file in the kernel docs it says:
在内核文档中的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.
and goes on to say
接着说
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.
I don't know how much this helps you, but should get you started in the right direction.
我不知道这对你有多大帮助,但应该让你开始朝着正确的方向前进。
#1
1
For a pseudo terminal pair such as ptyp3 and ttyp3, the pty... is the master or controlling terminal and the tty... is the slave. There are only 16 ttyp's: ttyp0-ttypf (f is a hexadecimal digit). To get more pairs, the 3 letters q, r, s may be used instead of p. For example the pair ttys8, ptys8 is a pseudo terminal pair. The master and slave are really the same "port" but the slave is used by the application program and the master is used by a network program (or the like) which supplies (and gets) data to/from the slave port.
对于伪终端对,例如ptyp3和ttyp3,pty ......是主终端或控制终端,而tty ...是从属终端。只有16个ttyp:ttyp0-ttypf(f是十六进制数字)。为了获得更多对,可以使用3个字母q,r,s代替p。例如,对ttys8,ptys8是伪终端对。主设备和从设备实际上是相同的“端口”,但是应用程序使用从设备,并且主设备由向从端口提供(和获取)数据的网络程序(或类似设备)使用。
#2
0
And this: http://lists.opensuse.org/archive/opensuse/2003-12/msg02404.html
这个:http://lists.opensuse.org/archive/opensuse/2003-12/msg02404.html
#3
0
In the Linux devices.txt file in the kernel docs it says:
在内核文档中的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.
and goes on to say
接着说
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.
I don't know how much this helps you, but should get you started in the right direction.
我不知道这对你有多大帮助,但应该让你开始朝着正确的方向前进。