public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: Marc Koschewski <marc@osknowledge.org>, Greg KH <greg@kroah.com>,
	lkml <linux-kernel@vger.kernel.org>,
	rmk+lkml@arm.linux.org.uk
Subject: Re: Christmas list for the kernel
Date: Wed, 23 Nov 2005 18:15:23 +0100	[thread overview]
Message-ID: <20051123171523.GA3528@ucw.cz> (raw)
In-Reply-To: <9e4733910511230859y3879e65fp927a7aa4d71d8fee@mail.gmail.com>

On Wed, Nov 23, 2005 at 11:59:27AM -0500, Jon Smirl wrote:
> On 11/23/05, Vojtech Pavlik <vojtech@suse.cz> wrote:
> > On Wed, Nov 23, 2005 at 11:37:23AM -0500, Jon Smirl wrote:
> >
> > > Before everyone gets excited, I realize that all of this has
> > > historical implications. But that doesn't mean we can't discuss
> > > possible future alternative solutions.
> > >
> > > Thinking about this for a while it seems to me that the problem is
> > > that the various apps (init, syslog) etc should not have a tty name as
> > > part of their command line parameters. Instead these apps could use
> > > ptys instead. Ptys would solve all of the race problems too.
> > >
> > > Is there any good reason (other than history) for using a device node
> > > name (tty0, etc) instead of some other naming scheme if names are
> > > needed at all?
> > >
> > > If init, syslog, etc can be converted to ptys, do we need ttys? Xterms
> > > use ptys I don't notice that they aren't connect to a fix tty name.
> > > The virtual consoles would still be 0,1,2 but do they have to be
> > > hooked to tty0, 1, 2 instead of a pty?
> >
> > The basic difference between a pty and tty is that a pty connects to a
> > program (that created it by opening the ptmx node, for example xterm or
> > ssh) on the other end, while a tty connects to the kernel doing all the
> > character drawing in the framebuffer.
> >
> > You can't easily use one instead of the other, they're very different
> > beasts.
> >
> > Of course, a way to use a pty would be to have the console
> > implementation in userspace.
> >
> > The fact that no program is on the other end of a tty is also the reason
> > why they cannot be created dynamically like ptys, there is noone to open
> > a "ttmx" to create the ttys.
> >
> > Hence, the device nodes are pre-created by the kernel, while the real
> > devices are only created on open.
> 
> I forgot about the kernel vs user space termination issue.
> 
> One solution would be to not create the tty nodes and instead modify
> init, syslog to mknod the node before using it.

You'd have to add special treatment to quite a number of programs (all
the different *getty programs, for example), for what benefit? A
slightly cleaner /dev?

> Another would be to have a little user space daemon that listened to
> the pty creation, and then mknod the tty nodes as need and pipe the
> data through.

While we in theory could have hotplug events for pty creation, this is
not a working approach, since it tries to work from the wrong side.

A pty is created when ptmx is opened (by libc). You need to pass a
tty/pty device node to syslog/getty/whatever, and not ptmx.

The daemon would be in the same situation the kernel is now - it would
have to divine when an application will be trying to open a non-existent
device node and create it juste before that.

> That would be a first step to moving to a user space
> console implementation.

No. You don't need all that for a user space console. Xterm works today.
Just specify in a config file for the userspace console which pty VT's
should it create and which programs to pass them to.

> I see now that the 64 tty devices really are there and are provided by
> the kernel. It's just that hardly anyone uses all of them and they
> clutter up /dev.
 
True. It's a tradeoff.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  parent reply	other threads:[~2005-11-23 17:15 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 18:31 Christmas list for the kernel Jon Smirl
2005-11-22 18:39 ` Alistair John Strachan
2005-11-22 19:10   ` Jon Smirl
2005-11-23  0:43     ` Andrew Morton
2005-11-23  1:09       ` Jon Smirl
2005-11-23  1:37         ` Josh Boyer
2005-11-23  2:00         ` Andrew Morton
2005-11-23  5:18           ` Jon Smirl
2005-11-23  5:45             ` Andrew Morton
2005-11-23 16:12       ` Bill Davidsen
2005-11-23 19:27         ` Andrew Morton
2005-11-22 19:31 ` Christoph Hellwig
2005-11-22 19:57   ` Jon Smirl
2005-11-23 22:16     ` Pavel Machek
2005-11-23 22:12   ` Pavel Machek
2005-11-22 20:49 ` Greg KH
2005-11-22 21:13   ` Jon Smirl
2005-11-22 21:28     ` Kasper Sandberg
2005-11-22 21:41       ` Jon Smirl
2005-11-22 21:56         ` David Lang
2005-11-22 22:00         ` Anton Altaparmakov
2005-11-22 23:36         ` Alan Cox
2005-11-22 23:56           ` Jon Smirl
2005-11-23  9:09             ` Russell King
2005-11-23 16:07           ` Bill Davidsen
2005-11-23  8:47         ` Denis Vlasenko
2005-11-23 14:44         ` Vojtech Pavlik
2005-11-23 17:21           ` Gene Heskett
2005-11-23 17:30             ` Russell King
2005-11-23 19:28               ` Bill Davidsen
2005-11-22 23:35     ` Alan Cox
2005-11-22 23:58       ` Jon Smirl
2005-11-23  0:37         ` Alistair John Strachan
2005-11-23 11:19         ` Alan Cox
2005-11-23 12:17     ` Vojtech Pavlik
2005-11-23 14:43       ` Jon Smirl
2005-11-23 15:03         ` Russell King
2005-11-23 15:12           ` Jon Smirl
2005-11-23 15:56             ` Marc Koschewski
2005-11-23 16:05               ` Russell King
2005-11-23 16:37                 ` Jon Smirl
2005-11-23 16:49                   ` Vojtech Pavlik
2005-11-23 16:59                     ` Jon Smirl
2005-11-23 17:05                       ` Marc Koschewski
2005-11-23 17:13                         ` Jon Smirl
2005-11-23 17:16                           ` Vojtech Pavlik
2005-11-23 17:24                           ` Marc Koschewski
2005-11-23 17:15                       ` Vojtech Pavlik [this message]
2005-11-23 19:32                     ` Bill Davidsen
2005-11-23 15:19           ` Jon Smirl
2005-11-23 15:25             ` Russell King
2005-11-23 15:31               ` Jon Smirl
2005-11-23 15:36                 ` Russell King
2005-11-23 16:02             ` Marc Koschewski
2005-11-23 16:16               ` Russell King
2005-11-23 16:23                 ` Marc Koschewski
2005-11-23 16:23                 ` Vojtech Pavlik
2005-11-23 16:27                   ` Russell King
2005-11-23 16:31                     ` Dmitry Torokhov
2005-11-23 16:34                       ` Vojtech Pavlik
2005-11-23 16:33                     ` Vojtech Pavlik
2005-11-23 15:20           ` Pierre Ossman
2005-11-23 15:29             ` Russell King
2005-11-23 15:39               ` Pierre Ossman
2005-11-23 15:51                 ` Russell King
2005-11-23 15:49               ` Jon Smirl
2005-11-23 15:56                 ` Russell King
2005-11-23 16:32           ` Bill Davidsen
2005-11-23 16:50             ` Jon Smirl
2005-11-23 15:49         ` John Stoffel
2005-11-23 15:27       ` Martin Mares
2005-11-22 21:28   ` Dmitry Torokhov
2005-11-22 23:33   ` Alan Cox
2005-11-23  7:10   ` Early boot issues (WAS: Christmas list for the kernel) Benjamin Herrenschmidt
2005-11-23 19:47     ` Andi Kleen
2005-11-22 22:11 ` Christmas list for the kernel Bill Davidsen
2005-11-24  4:17   ` Rob Landley
2005-11-23 22:23 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051123171523.GA3528@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=greg@kroah.com \
    --cc=jonsmirl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc@osknowledge.org \
    --cc=rmk+lkml@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox