Messages in this thread | | | Date | Thu, 19 Mar 1998 14:31:34 -0500 (EST) | From | Greg Alexander <> | Subject | dynamic pty driver... |
| |
I'm working on a dynamic pty driver. The purpose being to allow the creation of ptys by normal users (no more suid root screen!) and to allow the creation of an almost unlimited number of ptys without wasting a bunch of RAM for huge arrays on small systems or trying to switch to 16-bit minors or anything like that. The ptys would not have associated files/devices and they'd be made using a syscall similar to pipe() (should I make a new syscall or just an ioctl()?). Another possibility would be to add another filetype for mknod(), S_IFPTY that normal users could create, but this doesn't seem reasonable to me and I am unlikely to bother to implement it. It would be trivial to modify rxvt, screen, etc. to use these instead of /dev/pty* and /dev/tty[p-za-e]?.
It looks like the best way to do this is to make a different tty_driver struct for every pty. I'm not sure what major/minor to give them...I was thinking I could probably just make all of them 5,0 (/dev/tty), but this would cause ps to see 5,0 as the tty device in /proc/<pid>/stat so it would list all processes on dptys as being run on /dev/tty...not the most useful solution. I was also considering possibly not adding the tty_driver structs to the actual tty_driver linked list. All the tables would be dynamically allocated with the tty_driver struct and would be created with only one entry.
I was just wondering if anyone had any comments, suggestions, etc., before I go implementing (I haven't done much deep kernel hacking in the past and the whole tty layout is just now beginning to somewhat make a little sense).
FYI, this idea is not my own but was suggested to me by Alan Cox (I think...it's been a while).
Greg Alexander - also <gralexan@indiana.edu> - http://sietch.home.ml.org/ ---- "People are very flexible and learn to adjust to strange surroundings -- they can become accustomed to read Lisp and Fortran programs, for example." -- Leon Sterling and Ehud Shapiro, Art of Prolog, MIT Press
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |