What is the tty subsystem for?

So far, I have spent at least 10 hours trying to plunge into the famous Linus Akesson's blog post, and I'm still struggling. So let me ask my doubts about tty / ptty as a series of short questions.

1) Is tty / ptty in user space or kernel space?

2) What is a tty / ptty connection with devices or drivers or some numbering or something else?

3) tty seems to be associated with something called a process control terminal. What is the relationship and each process associated with the terminal?

4) In general, I still do not understand what is the meaning of this concept of the terminal. The process wants to read something from stdio, but cannot do it from the file of the required device. What exactly is the problem tty intends to address?

5) I read somewhere that there are attempts to move tty from user space to kernel space. Whether tty is simply a historical remnant than a strong design feature.

+4
source share
1 answer

Clarification (which might answer some of your questions): I think you meant pty (not ptty), which is a pseudo-tty / pseudo-terminal.

  • A tty (/ dev / ttyx) - means teletype - these are the original terminals (a linear printer is used for output and a keyboard for input!). A terminal is simply a user interface device that uses text for input and output.

  • Pty (/dev/pty/n) - , , , , "" . telnet/SSH GNOME.

, ssh ls, ls , SSH.

EDIT: , tty pty, usermode. . : /dev/tty 1 . / char, tty_io.c n_tty.c vt.c( ). tty_open , , , , ...

Tty/pty , ( "", ). , ... ( - )

EDIT2: , , ... , tty . - , ​​ "". , , ..

, ....

+5

All Articles