Subject: Re: passing in the booted kernel name...?
To: None <>
From: David Brownlee <>
List: tech-kern
Date: 01/08/1999 16:37:05
	We should really make machdep.booted_kernel a MI variable -
	all ports would benefit (or at the worst not fail), from this
	facility. At the moment if you boot '/netbsd.test' everything
	will run against /netbsd, which is just... lame.

	For netbooted or similar environments where you cannot access
	the original kernel you could at least check for the same filename
	in the root filesystem. It might be wrong, but it will be right
	much more often than the current situation...


                  -=- Why _do_ we crucify ourselves?  -=-

On Sat, 9 Jan 1999 wrote:

> said:
> > I was thinking of some more general way of accomplishing what
> > machdep.booted_kernel does, i.e. mostly where to point kvm_mkdb at. 
> What's wrong with some startup script like:
> mykernel = /`sysctl machdep.booted_kernel`
> if [a version check($mykernel) passes]; do
> 	kvm_mkdb $mykernel
> else
> 	[print warning or so]
> done
> > so perhaps
> > simply checking all of /netbsd* for a version string matching
> > the running kernel's would be better than trying to improve
> > booted_kernel. 
> One can try to improve `sysctl machdep.booted_kernel`, but it can
> never be perfect unless you restrict the ways the system can
> be booted. As it looks now, this variable reflects the name
> of the booted file, not more, and in particular not whether
> or how this file is accessible in the final filesystem.
> Only a system administrator can know this, so only he can make
> sure that kvm_mkdb etc. get a path to the active kernel.
> A standard setup should assume "/`machdep.booted_kernel`" to be
> the kernel file, and who has a more exotic setup is on his own.
> Of course it would make things safer if the symbol table would
> be loaded with the kernel image and accessed via a system call,
> but in most cases this as a waste of memory. I'd think that
> people loading the kernel from an other place than their own
> filesystem's root should be clever enough to set up a startup
> script which gets the kernel symbols right.
> best regards
> Matthias