Subject: Re: /kern/kernel
To: Alan Barrett <>
From: Chris G. Demetriou <>
List: current-users
Date: 09/10/1998 10:49:54
Alan Barrett <> writes:
> > the only change was the kernel name, and you're absolutely sure
> > (e.g. from the kernel boot messages) that the correct kernel was being
> > booted in each case?
> Wouldn't it be nice if we didn't have dependencies on the kernel name.
> For example, what about a file in kernfs calles /kern/kernel that was
> always magically identical to the actual running kernel?

If you want something like this:

(1) in current reality, it should be a sysctl, and it should be the
filename of the booted kernel.

(2) you might look at the alpha port for a sample implementation.  It
exports the 'machdep.booted_kernel' sysctl for this purpose.

It looks like at some point after the alpha code was written, other
ports (including i386 and at least some m68k ports) have also picked
this code up.  "good!"

It doesn't help with the issue of what you do when the booted kernel
doesn't exist on /, or is somehow differently named, or moving the
kernel after you've booted, or (worse) all you can easily communicate
is kernel name and the kernel on / with that name is _different_ than
the one that you booted.

But it's better than nothing.  That's why I implemented it (back in
December, 1996) for the alpha port, and presumably why others copied
the idea.

At one point, I proposed the thought of having all ports do it, then
use it for various things like the kvm_mkdb at startup.  That was shot
down real quick.  (I seem to recall that I brought it up in discussion
with a couple of developers, and a core member said "no.")

Chris Demetriou - -
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.
Plug: Get your official NetBSD-1.3.2 CDROM set today!