Subject: Re: /kern/kernel
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 09/14/1998 08:08:05
> Here's a thought:  The running kernel wouldn't need to know its own
> name.  Just have it load the symbols into core at load time,

Whoa!  Hold it right there.  This requires support from other pieces of
the boot sequence - in particular, the booted-from kernel (which may
not be in any filesystem NetBSD understands) has to have symbols in it,
and the bootloader has to understand them and know how to load them.

This is probably possible to arrange on all ports, but I'm pretty sure
it's not currently the case on all ports - or at least so I was told a
while ago.

If we could count on the kernel having symbols in-core at load time,
any of these paradigms (/kern/kernel, /kern/kernelsymbols, etc)
becomes a SMOP.

> # savestab -v /kern.syms
> /kern.syms: Read-only filesystem
> No symbols saved; table remaining resident
> # mount -u /
> # savestab -v /kern.syms
> Saving symbol table...4826 symbols saved to /kern.syms
> Symbol table flushed from core
> # 

> And I think it WOULD require a special system call to facilitate
> this.

Well...not necessarily; it _could_ be done as simply as

# cat `which savestab`
#! /bin/sh
cp /kern/symbols $1 && rm /kern/symbols

(yes, yes, there's more error checking, and making kernfs implement
VOP_UNLINK...and depending on kernfs, though I have no qualms about
saying "if you don't use kernfs, you will just have to live with nlist
on /netbsd").

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B