Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jul 2000 23:07:17 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        mjacob@feral.com
Cc:        freebsd-arch@FreeBSD.ORG
Subject:   Re: How much do we need the all-singing, all-dancing devfs? 
Message-ID:  <14391.964559237@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 25 Jul 2000 13:52:39 PDT." <Pine.BSF.4.05.10007251350111.16927-100000@semuta.feral.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.05.10007251350111.16927-100000@semuta.feral.com>, Matthe
w Jacob writes:
>
>> Ie:
>> 
>> 	My /dev/ad0 could have the following "aliases":
>> 
>> 		/dev/ad0
>> 		"IBM SOMETHING Serial# 4958393453" (found in ATA pages)
>> 		"Scratch disk 1" (found in bsd disklabel)
>> 		"/mnt/scratch" (found in UFS "last mount point")
>> 
>> and I could use any one of these in my /etc/fstab
>
>Yes. That's the ticket- although with that model you may stub your toe with a
>programmer's metonymy (mistaking the container for the thing contained).
>
>Were you thinking it could be that freeform? That is, not have any selectors
>to qualify as to how the name might be decoded? So  you'd just look it up in a
>database? This raises the question as to whether this database is dynamic and
>who maintains it. 

Yes, I think it should be just "ascii string" and the various sources
of these strings prefix themselves with a suitable identifier, so
the above would probably be:

    "/dev/ad0"
	"canonical device names" are prefixed with a slash
    "HW:IBM SOMETHING Serial# 4958393453"
    "BSD:Scratch disk 1" 
    "MNT:/mnt/scratch"

or something in that spirit.

I'm not sure allowing spaces is a good idea, so maybe they should
just silently be turned into underscore.

>This does fit more with a real devfs tho....

Right, it sure does.

I don't know if you followed some of the recent discussions about
DEVFS, but one of my ideas is that cloning be implemented so that
if the DEVFS doesn't find the name somebody tries to namei(), it
will poll a list of driver functions (registered by the drivers)
and if any of the drivers can instatiate the requested name they
do so and the lookup succeeds from there.

Doing it that way with a devfs means that you could actually
open /dev/HW:BLABLA and if the cam driver recognized this as
it's cue to examine the SCSI serial numbers it would do so
and if it found one matching it would instantiate the device
and your open would succeed.

The advantage to that scheme is that we don't clutter /dev
with 7 different names for each disk, only the names people
try to open are present.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


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?14391.964559237>