Subject: Re: @booted_kernel magic symlink?
To: None <tech-kern@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 04/27/2006 04:02:47
> In the case of a kernfs node, how is it supplied?  Or are you
> intending the kernfs node to simply /be/ the kernel file node,

It wasn't my idea, but that's how I read it.

> which eliminates any need for the client to know the name?

Exactly.  Just as /kern/rootdev eliminates any need to know the root
device's name.

> That could be handy, but what will the underlying mechanism be when
> the kernel was booted over TFTP, say, and the kernel file isn't
> otherwise available?

Probably the same as when the kernel is anywhere else: a copy of the
kernel is saved in RAM, and that's what backs /kern/kernel.  (This
would have to be disableable for low-RAM machines, of course, where the
RAM occupied by a copy of the kernel is enough to matter.)

Unfortunately fairly little of the kernel can be shared with the
running kernel image.  The headers would be easy to synthesize (in a MD
way, of course, since not all machines use kernels in the same format
as their executables), but the data segment would have to be saved in
its original form - and the text as well, at least on some arches,
those which can patch kernel text at boot time (I've seen such code in
sparc kernels, at least).

Perhaps the RAM copy of the kernel could be compressed....

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B