Subject: Re: Using Etherboot ELF/FreeBSD loader to netboot ELF/NetBSD
To: None <wojtek@tensor.3miasto.net>
From: Ben Harris <bjh21@netbsd.org>
List: tech-kern
Date: 02/28/2003 18:48:24
In article <Pine.NEB.4.51.0302281924280.15814@chylonia.3miasto.net> you write:
>> > c) agree about adding some standard mark to NetBSD kernels so it can be
>> > detected if it's NetBSD or FreeBSD. then i can add support for etherboot.
>> >
>> > i will be happy with C - so NetBSD will be bootable with etherboot "out of
>> > the box"
>>
>> Yes, c) is the best, and it will help all architectires.
>
>so - i'm waiting for any decision about how it will be marked and they
>will finally send a patch to etherboot maintainer.
A few thoughts on how this should be done: The point of the new PT_NOTE (as
it will presumably be) is to indicate how the kernel should be loaded. This
means that it needs to indicate not just "this is a NetBSD kernel", but
"this is a NetBSD/hp300 kernel expecting this particular boot interface".
Thus, the note needs to contain the MACHINE name (since a single ELF
architecture can cover many MACHINEs) and something to indicate the
interface version. For the latter, I think I'd go for __NetBSD_Version__,
the same as we now use for user binaries, since that allows the file which
generates the note to be MI.
Thus, we could have something like this (formatted as for
<http://www.netbsd.org/Documentation/kernel/elf-notes.html>):
Name Size: 7
Desc Size: variable
Type: 4-byte integer containing the value <<<TBA>>>
Name: "NetBSD\0" (padded to 8 bytes)
Desc: 4-byte integer containing __NetBSD_Version__,
followed by
NUL-terminated string naming the
MACHINE on which the kernel should run
(padded to the next 4-byte boundary)
--
Ben Harris <bjh21@netbsd.org>
Portmaster, NetBSD/acorn26 <URL:http://www.netbsd.org/Ports/acorn26/>