*BSD News Article 5879


Return to BSD News archive

Path: sserve!manuel!munnari.oz.au!uunet!europa.asd.contel.com!darwin.sura.net!spool.mu.edu!agate!doc.ic.ac.uk!uknet!yorkohm!minster!forsyth
From: forsyth@minster.york.ac.uk
Newsgroups: comp.unix.bsd
Subject: configuring special files in /dev
Message-ID: <717850252.7924@minster.york.ac.uk>
Date: 30 Sep 92 10:50:52 GMT
Organization: Department of Computer Science, University of York, England
Lines: 21

try making /dev by mounting a new file system type supplied by the kernel (cf. /proc).
the file system type (VFS) provides file and directories based on
the contents of the kernel device tables.
(the struct dirent entries are generated on-the-fly in response to readdir requests.
lookup needn't generate names: it can simply search for the given names in a device table.)

it works very well.
i do something like this in my own o/s for the sun3 and 386 (not available, sorry), using
a file system interface similar in principle to VFS/Vnode, but simpler.
my file system type doesn't allow new files, directories, or symlinks to be created,
but it could.


configuration scripts can then be run by having /etc/rc (or equiv.) invoke
	/bin/test -c /dev/something && sh /etc/devinit/something
something like this is necessary to chown and chmod devices initially
(if the default settings aren't acceptable), since /dev is no longer persistent
across boots.

this approach does have the advantage that discless booting and operation is trivial.
it certainly avoids the wretched snode/vnode/realvp aliasing hacks in SunOS!