Subject: Re: testing presence of a device (was sun-lamp CVS commits)
To: Tom Pavel <>
From: John F. Woods <>
List: current-users
Date: 10/07/1995 18:40:57
> > > Regarding checking for devices, would it be possible to make the
> > > device tree information available to sysctl?
> > the big problem is, if sysctl doesn't take char *'s as args, then you
> > need to query the kernel to see what the appropriate name->number
> > mappings are, etc., and then convert them a possibly-endless string of
> > ints.
> I had been thinking about an interface for getting device info also,
> but within the context of KERNFS.  Now, I know that kernfs is
> currently something of a toy and that sysctl() has the advantage that
> it's there in all kernels regardless of config options.  But, on the
> other hand, kernfs is rather cheap (it only adds 4k of code to my
> i386 kernel when I compile it in or not), and one could certainly
> arrange to compile it into the INSTALL kernel.

An interesting note:  DG/UX has a gimmick much like this; /dev is a mounted
filesystem that the kernel invents from whole cloth at boot time (apparently
by creating an in-memory filesystem and doing mknods, so that you can then
add your own names at runtime).