Matthew Jacob wrote:
> > Also, in "src/sys/boot/common/boot.c" we still have this:
> >
> >     static const char *default_bootfiles = "kernel.ko";
> >
> > which isn't right any more.
> Absolutely wrong, yes.
> Look at kern_mib.c:
> char kernelname[MAXPATHLEN] = "/kernel";        /* XXX bloat */
>     kernelname, sizeof kernelname, "Name of kernel file booted");
> This is also wrong now.

In loader(8), the environment variable "bootfile" contains a list of
file names that will be tried for the kernel name. The environment
variable "kernelname" is set to the full path name to the kernel (or so
I believe :) when the kernel is loaded. This is done in
common/load_elf.c and common/load_aout.c. The function elf_loadfile(),
for instance, receives the name of the module/kernel to be loaded, and
set kernelname to that if it is a kernel and the load is succesful.

Since that function uses open(filename, ...), it is garanteed that it
needs to receive the full path.

Of course, none of this works with the device/slice[/partition] that has
the kernel isn't mounted later as root. :-)

Afterwards, I don't know how this information gets passed to the kernel.
On i386, this happens:

    kernelname = getenv("kernelname");
    i386_getdev(NULL, kernelname, &kernelpath);
    bi.bi_kernelname = VTOP(kernelpath);

Though the alpha code (alpha/libalpha/bootinfo.c) also fill in a lot of
stuff in bi, it has no reference at all to "kernelname". Did it ever
work? :-)

Daniel C. Sobral                        (8-DCS)

                He has been convicted of criminal possession of a clue with intent to

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to