Subject: Re: 'nother idea: /kern/unix virtual file
To: Luke Mewburn <>
From: Chris G. Demetriou <cgd@postgres.Berkeley.EDU>
List: current-users
Date: 02/10/1994 21:45:17
> How difficult would it be to implement another file in /kern: /kern/unix?

To put it most brusquely:


> Why would I like this functionality? Cause if I boot of another kernel
> (such as /onetbsd which happens to be up to date, ps and swapinfo and
> the like will actually _work_)
> Comments? Volunteers for the kernfs hack?

to do that, you'd have to:
	(1) pass the kernel name to the kernel on boot
		(i.e. modify the boot block and locore for every
		system that NetBSD runs on)
	(2) do a lookup on that pathname when the system starts up,
		and DTRT with it.

Then, god forbid you should "mv / /netbsd" after
the system starts up...

you should not be booting a kernel other than "/netbsd" to recover
your system.  if you are, then you're doing something wrong.

> PS: I don't know enough about the way vnodes and stuff work to be able
> to successfully hack this. I've had a look at the code and get the general
> gist, but I think that if I stuff something up badly, say `Bye Bye' to my
> filesystem.

no vnode is held open for the kernel, and it's not feasible to do it,
in my opinion.

Kernfs, and procfs, mfs, the portal fs, etc., etc., etc.,
are *NICE* and occasionally even useful.  NONE OF THEM SHOULD BE
MANDATORY, and *i* will not do anything to help them become
mandatory, especially if it includes making a fair amount of work
(much of it hacking assembly language) for the various people
working on ports of NetBSD.

As for suggestions to move things like all of the proc information
into kernfs: if you want proc information to be accessible via
the file system, use procfs.  If you want to hack the debuggger
to use procfs if it's compiled into the kernel, feel free.
But don't send me those hacks.

NECESSARY.  to make kernfs "mostly-standard" in 0.9 was a *mistake*,
and it was completely unnecessary.  Hell, the FFS should be
optional, as should be *all* of the "real networking protocol" code.
unfortunately, right now they're not.

I don't want the minimum-sized kernel to grow any more than necessary,
even though on the i386 we can run any size kernel we want.  There are
people who've run the i386 kernel on 2M machines.  That should remain