Subject: Re: @booted_kernel magic symlink?
To: Chapman Flack <nblists@anastigmatix.net>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 04/24/2006 15:29:39
Yech.  I discourage having this -- because, quite frankly, a number of
platforms don't actually necessarily have the kernel in the root
filesystem.  For example, evbmips kernels use yamon to TFTP their
kernel, and have the root filesystem in NFS.

Those kernel grovelers that try to use /netbsd break right now.

I'd rather not make any friendlier interface for kernel memory grovelers
-- instead they should feel the pressure to move away from this and use
sysctl, or some other more portable interface, to get at what they need.

    -- Garrett

Chapman Flack wrote:
> Would there be any objections to an additional magic symlink
> pattern @booted_kernel, replaced from the corresponding
> CTL_MACHDEP sysctl node if the platform supplies it?
>
> It would be handy for those few remaining userland utilities
> that try to open the kernel by a fixed name for groveling,
> when you have a few built kernels in various stages of
> debugging.
>
> If there's no objection, what's the best way to do it?
> vfs_lookup.c doesn't include <machine/cpu.h> - if it did,
> it could contain an #ifdef on the CPU_BOOTED_KERNEL sysctl
> key and provide the additional magic only if it is defined.
> But is that considered an unacceptable machine dependency
> in vfs_lookup?  Would it be preferable to have some machdep
> helper interface that is implemented somewhere else? If so,
> where?
>
> -Chap


-- 
Garrett D'Amore, Principal Software Engineer
Tadpole Computer / Computing Technologies Division,
General Dynamics C4 Systems
http://www.tadpolecomputer.com/
Phone: 951 325-2134  Fax: 951 325-2191