Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 1997 10:10:56 -0800 (PST)
From:      Julian Elischer <julian@whistle.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        dk+@ua.net, proff@iq.org, freebsd-hackers@freebsd.org
Subject:   Re: detecting devfs from userland?
Message-ID:  <Pine.BSF.3.95.971128095410.5521E-100000@current1.whistle.com>
In-Reply-To: <199711272308.QAA14601@usr07.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Thu, 27 Nov 1997, Terry Lambert wrote:

> > I think that having devfs creating its own device would be nice thing
> > for this purpose... i.e., just stat "/dev/devfs" to check if devfs 
> > is running.  As an added bonus, devfs operations can be added by 
> > reading, writing, or ioctl'ing this device.
> > 
> > this can work if you need to check whether devfs is running _now_, 
> > as opposed to knowing whether it is compiled into the kernel.
> 
> You can do the same thing by doing a stat of /dev and looking
> for an st_ino of 2.

actually no, as the root ino in devfs is not 2, and the ino for ..
IS 2 regardless of what FS it is..

lsvfs shows the devfs, if it is compiled, and 'mount|grep devfs'
will show you if it's presently active on /dev.
I'm not sure that much more is needed.

> 
> The devices themselves, especially in the new SLICE stuff that
> he's done, should be self-referrential.  I'm still trying to
> talk him into putting them in a hierarchy (with little success...
> you SVR4 device name traditionalists can rest easy: you still get
> you have your long cryptic device names for now...).

A hierarchy is good but has the following problems

1/ violates "Principle of least surprise" (POLS) 
2/ if you have /dev/disk/sd0/slice1/partA, then how do you access
	/dev/disk/sd0? because htat is a directory.

you need to either:
(A) make devfs allow devices to respond to directory operations..
and therefore confuse everybody..
"hey if /dev/disk/sd0 is a device, how can /dev/disk/sd0/slice1 exist?"

OR
(B) define the hierachy as:
/dev/disk
/dev/disk/sd0
/dev/disk/sd0/all
/dev/disk/sd0/slice1
/dev/disk/sd0/slice1/all     <--device
/dev/disk/sd0/slice1/part1     <--directory
/dev/disk/sd0/slice1/part1/all <--device

"all" might be 'device', but you get the picture
it's messy and confusing, (though not AS confusing as option (B)).

If objection 1 violates POLS, then solution (A) REALLY violates it,
though if we were designing a new OS that's what I would do.
(it's easy to do)
 julian

> 
> 					Terry Lambert
> 					terry@lambert.org
> ---
> Any opinions in this posting are my own and not those of my present
> or previous employers.
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.971128095410.5521E-100000>