tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Devices.



On Sat, May 29, 2021 at 04:17:13PM -0700, John Nemeth wrote:
 >      We should really get with the times and create a devfs.  I
 > know that there are people that disagree with this (likely including
 > you), but the archaic device node system causes a lot of headaches
 > and it's time that we joined the 21st century.  Anything done with
 > devices should be done with idea of a devfs in mind.  Yes, devfs
 > like things have caused a lot of problems on other operating systems,
 > but I think we have enough brain power and enough real world examples
 > to be able to not repeat the mistakes of the past.

The problem with the devfs everyone wants is that it's an automounter,
not a file system, which means that (a) everybody who tries to
implement it as a file system discovers that the abstractions don't
match up and ends up in varying degrees of trouble as a result, and
(b) automounters seem to be inherently awful and devfs implementations
thus are too.

The stuff I'm proposing doesn't affect those issues, and is likely to
make any implementation easier/simpler: it reduces the amount of work
a fs with device special files on it needs to do, and it also provides
the means to look up and "start" any given device or device instance
as its own interface disentangled from the filesystem code.

IMO the only significant problem that devfs solves is storing magic
numbers (device major numbers) on disk, and I think that's readily
(and better) solved by storing driver names instead of major numbers.
Otherwise it's mostly a matter of not cluttering /dev with entries for
hardware you don't have (nice but not a big deal) and not needing to
run MAKEDEV in various circumstances (definitely useful, but not
exactly critical)... all of which would be all very well if a clean
implementation existed, but given that this does not seem to be the
case it doesn't seem to me to be worthwhile.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index