Subject: Re: kernel & libkvm [was IIci success]
To: None <Chris_G_Demetriou@NIAGARA.NECTAR.CS.CMU.EDU>
From: Bill Studenmund <skippy@macro.stanford.edu>
List: current-users
Date: 01/11/1996 18:45:56
On Thu, 11 Jan 1996 Chris_G_Demetriou@NIAGARA.NECTAR.CS.CMU.EDU wrote:

> > But this is unlikely to ever be the case with the suggestion that
> > started all this, which was to put something in kernfs which was the
> > kernel as it appeared on-disk before boot.  I somehow doubt this would
> > ever go into sysctl.

Having started this thread, I feel like chiming in. The desire was not 
specifically to have the EXACT before-boot kernel, just enough of it (its 
symbol table) so that libkvm would be happy.

The origonal problem is that if /netbsd is not the running kernel, lots 
of stuff breaks. Like useless programs like savecore & ps. :-) If /netbsd 
was a mount point for an fs which made libkvm happy, or more cleanly, if 
/netbsd was a symlink to something in the kernfs, then libkvm would do 
the right thing regardless of which kernel gets run.

Before the holy war gets too far along, this idea is for an 
optional-yet-useful functionality. If your kernel is stable through time, 
by all means keep it as /netbsd & forget this bit. But I, and I think 
others, change kernels often while debugging things. As someone else 
said, we'd like tracking the -current kernel to not require recompiling 
userland stuff (libkvm & staticly-linked kids).

> And, i doubt that it would ever go into kernfs (and hope not, as
> well).
> 
> Think about what it would require to do this.
> 
> You'd do it one of two ways:
> 	(1) keep some type of pointer (symlink, vnode reference,
> 	    whatever) around to the kernel,
> 	(2) keep a virgin copy of the whole kernel in core.
> 
> Think about the completely nasty hacks that would be required to do
> _either_, and also realize that you can't even _do_ the former
> reliably (because the kernel may not exist on any disk you have access
> to!).

The hope really is to, somehow, give the kernel enough brains to be able 
to use libkvm on itself w/o having to look at its disk image. As (AFAIK) 
a number of programs look at a file (/netbsd) to facilitate looking at 
dead kernel dumps, some sort of file interface is appropriate. We don't 
need a virgin copy of the kernel, do we? We just need to make libkvm 
happy.

Couldn't we do something to make the amount of ugly hacks less, either by 
keeping stuff around, or by making libkvm more agreable?

Take care,

Bill