From owner-freebsd-arch Tue Jul 25 14: 7:33 2000 Delivered-To: freebsd-arch@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id 393CB37BA0A for ; Tue, 25 Jul 2000 14:07:27 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.3) with ESMTP id XAA14393; Tue, 25 Jul 2000 23:07:17 +0200 (CEST) (envelope-from 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? In-reply-to: Your message of "Tue, 25 Jul 2000 13:52:39 PDT." Date: Tue, 25 Jul 2000 23:07:17 +0200 Message-ID: <14391.964559237@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message , 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