Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jan 1999 11:23:29 -0700
From:      Warner Losh <imp@village.org>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: DEVFS, the time has come... 
Message-ID:  <199901051823.LAA13960@harmony.village.org>
In-Reply-To: Your message of "Tue, 05 Jan 1999 18:20:17 %2B0100." <20480.915556817@critter.freebsd.dk> 
References:  <20480.915556817@critter.freebsd.dk>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20480.915556817@critter.freebsd.dk> Poul-Henning Kamp writes:
> I either case I can't see why the kernel part of devfs should know and
> communicate more than the name and the class.  All the sysctl stuff
> seems superfluous to me.  How will you handle the case of chroot
> with a different policy with a sysctl anyway ?  If anything it would
> have to be (per) mount options, but all I can see it would be is
> a "devd-lite-in-the-kernel" which is not very useful as I see it...

I have two comments on this, and previous messages.

1) Given the design that I posted for what I called devfsd, sysctl is
   superfluous.

2) In an embedded environment, devfsd likely wouldn't be much fat
   compared to other things.  I have a hard time believing that it
   would be much more than 32k-64k given the level of functionality
   that I'd like to place in it.  Maybe this is the 'devd-lite' that
   phk is talking about, as I had no intention of supporting anything
   more than a 1-1 mapping of devices and permissions.  I had no
   intention of supporting run a given shell script when device foo is
   created.  Moving to that level likely would make devfsd something
   that is much larger than would be acceptable in an embedded
   environment.

To recap the design for devfsd and what it requires of devfs:
	(1) devfsd will start by chmod/chown/chgrp the nodes it finds in
		its database.  Otherwise it will exec a default script
		with one arg to get the node to have the right
		permissions.
	(2) devfsd will wakeup when a poll fires.[*]
	(3) devfsd will scan the tree, doing its thing ala startup,
		skipping those nodes that aren't new or changed.

	(1) devfs will honor chown, chgrp, chmod, symbolic links and
		mkdir.
	(2) devfs will cause the poll to fire[*] when one of these events
		happens.

Nothing else.  No sysctls are used.  No device classes are needed (but
could be implemented if someone wanted to do so).

I should have a sample implementation of the above by the weekend,
assuming that all goes well.  The current devfs does (1), but not (2),
so I'll likely "fake" that by some gross method for proof of concept.

Warner

[*] I'm being vague here because there are two ways this could
happen.  Justin talked about having a special poll event when a
directory changed, which would be ideal.  That isn't implemented yet.
The other way is ala the apm stuff like Nate talked about.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901051823.LAA13960>