Subject: Re: Using Etherboot ELF/FreeBSD loader to netboot ELF/NetBSD
To: None <>
From: Ben Harris <>
List: tech-kern
Date: 02/28/2003 18:48:24
In article <> 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

    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                                                   <>
Portmaster, NetBSD/acorn26           <URL:>