Subject: Re: kernel & libkvm [was IIci success]
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 01/11/1996 18:54:30
> There is something kernfs lets you do that groveling the kernel
> doesn't -- it lets you get information out without the kernel symbol
> table being available.

sysctl allows that too.  Currently at least, everything in kernfs is
also in sysctl.  (Um...I'm not sure...does sysctl let you at the
equivalent of /kern/rootdev?  I don't see it in sysctl -a output.)

> Maybe what we need is a system call that lets you ask the kernel
> "where is the start of the foobar structure", so we don't always need
> to have the kernel symbol table around to do such stuff.

Um, doing that is equivalent to having the kernel symbol table around.
You'll have to either have the kernel grovel through its own symbol
table, or else restrict the structures you can ask for to a compiled-in
list (which is equivalent to having the kernel know a (probably tiny)
fraction of its own symbol table).

> sysctl() is the wrong solution because it won't work on kernel core
> dumps, whereas a small library routine could wrap both a system call
> version of "where is the X structure" and a
> grovel-the-dead-kernel's-image version thereof.

A small library routine could wrap both a sysctl() call and a
grovel-dead-kernel analog; citing this reason for avoiding sysctl is

Not that I'm a great fan of sysctl, mind you, but I do want to be fair.

					der Mouse