3 ms·
Your "system as a whole" is the linux TTY... so exactly not the system as a whole. Furthermore, Alan Cox stepping down 2 years ago does not mean the linux tty
by burgerbrain 15y ago
Your "system as a whole" is the linux TTY... so exactly not the system as a whole. Furthermore, Alan Cox stepping down 2 years ago does not mean the linux tty system is unmaintained. It is in fact.
The reasons ttys and ptys are in kernel space are numerous. As one example, it needs to be there because different line disciplines are necessary and relying on a userspace program to implement them will not do. Ever notice how su/sudo/passwd/etc don't echo your password? Yeah, that sort of important. Furthermore, ttys in modern systems are tied to job control rather deeply. Implementing correct signal sending, sessions with controlling terminals, forground/background processes, etc in userspace? Have fun.
I could write a book on this subject, but this is easier: "Write a fully functional pty in userspace. If you ever manage to get that far, then compare your work with traditional implementations and defend it."
PS: ptys are not "emulating" anything in any meaningful sense of the word.
- justincormack 15y agoUserspace can not echo a password too, its not exactly difficult. And do we really need the job control model as is? If you started from scratch would you design it anything like this at all? And signals, it is all the least successful parts of the unix design...
- burgerbrain 15y agoIf you are implementing all of your line disciplines in userspace 1) userspace where? 2) How do you handle other modes, besides just noecho? 3) How do you do that while minimizing responsibilities of user generated code? "And do we really need the job control model as is?" Yes.