Subject: Re: ksyms patches.
To: None <>
From: Jason Thorpe <>
List: tech-kern
Date: 04/21/2003 08:57:54
On Monday, April 21, 2003, at 08:32  AM, <> wrote:

> Yep, so I thought it would be cleaner solution if it could be loaded
> after the kernel starts, by for example "cat /netbsd > /dev/ksyms" to
> get the master table.  That would replace SYMTAB_SPACE.

That's not always possible, nor desirable.

Consider the following scenarios:

	1. Debugging the kernel.  Userland isn't working.  I'd like to
	   be able to use DDB in order to figure out why.

	2. Embedded system.  Kernel starts directly out of flash, has
	   a ramdisk without an extra copy of the kernel in it.  Kernel
	   in flash is a flat binary image, possibly compressed and wrapped
	   in something else that decompresses it into RAM.

For both of these cases (which I happen to encounter frequently :-), 
SYMTAB_SPACE is extremely valuable.  For this reason, I'd like to keep 
it around.

> The problem is that for modules then the symbol table and the string
> table would need to be on (at least) two extra pages for each module,
> which would require a large amount of extra memory if there are say,
> 50 modules.  Maybe it's not a big problem on newer machines, but older
> would loose much of their memory.

Fair enough -- that's why I asked :-)

> That would be doable, yes.  Another way is to make nlist use the
> ioctl's that are currently disabled that do the lookup in-kernel.
> That would be as fast.

Yah, I was going to suggest that, but then wondered if adding the 
ioctls was a good idea, but then I noticed you'd added them already :-)

         -- Jason R. Thorpe <>