Subject: Getting the running kernel file (Re: enabling IIci cache card)
To: None <briggs@puma.macbsd.com>
From: None <kenn@eden.rutgers.edu>
List: port-mac68k
Date: 10/19/1996 08:39:20
>> I think there ought to be some kind of a system call for the user land
>> programs to get to the running kernel file without explicitly specifying
>> its file name (something to the effect of argv[0] for the kernel itself?).
>
>That's a good idea for most cases, I think, if we can get that information
>without too much difficulty (the booter could pass it in in the mac68k
>case, but I don't know about other ports).

That's true...

>It does fail if you've loaded the kernel off an alternate location
>(MacOS, bootp/tftp/bootparam server, tape, etc).

In that case, the programs in question can know that there isn't any file
for the running kernel so that they can also know that they can't be
bothered to dig up a bogus symbol table out of a wrong kernel file, can't
they?  I mean, if that system call returns a value to indicate a failure
(such as NULL).

If you really know there is in fact a kernel file somewhere accessible even
though you booted off from MacOS/bootp/tftp/bootparam/tape/whatever,
there's always the option to explicitly specify a kernel file (-f).

I don't think this is such an unreasonable way, but I haven't thought about
all potential problems, either.

ken