Re: [Etherboot-developers] NetBSD ELF/a.out support
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Doug A. <amb...@am...> - 2003-02-27 20:59:18
|
Wojciech Puchar writes:
| i just managed to boot NetBSD with etherboot's FreeBSD loader.
|
| the only problem is
|
| a) NetBSD has different boot parameters than FreeBSD. i hardwired
| REALBASEMEM and REALEXTMEM to kernel so it's able to get memory and runs
| well, except it doesn't know what was boot device and boot file name
| (no bootinfo at all)
|
| b) I am able to write NetBSD support to etherboot except there's no method
| of detecting if kernel is NetBSD or FreeBSD (at least i don't know) other
| than scanning memory for "The NetBSD Foundation, Inc. All rights
| reserved." which seems quite stupid.
There seems to be some info in to find a FreeBSD header via:
#ifdef ELFCORE
size_t prpsoffsets32[] = {
8, /* FreeBSD */
28, /* Linux 2.0.36 */
32, /* Linux (I forget which kernel version) */
84, /* SunOS 5.x */
};
and then I see this comment
/*
* Look through the program headers of an executable image, searching
* for a PT_NOTE section of type NT_PRPSINFO, with a name "CORE" or
* "FreeBSD"; if one is found, try looking in various places in its
* contents for a 16-character string containing only printable
* characters - if found, that string should be the name of the program
* that dropped core. Note: right after that 16-character string is,
* at least in SunOS 5.x (and possibly other SVR4-flavored systems) and
* Linux, a longer string (80 characters, in 5.x, probably other
* SVR4-flavored systems, and Linux) containing the start of the
* command line for that program.
So I'd use that type of scheme. It in the common source for "file" from
Christos Zoulas.
I can try out any patches you have and verify it doesn't break FreeBSD
or put a sample FreeBSD kernel on my web-site for you to test.
Doug A.
|