Subject: Re: ELF, a.out & libsa loadfile()
To: None <port-mac68k@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: port-mac68k
Date: 05/22/2001 16:45:07
In article <20010522060712.11630.qmail@quoll.ind.tansu.com.au>,
 <nigel@ind.tansu.com.au> wrote:
>
>	Still trying to get the Booter loading kernels using libsa's
>loadfile code. Can anyone enlighten me about the following (seeming)
>contradiction:
>
>* An a.out format kernel usually has a non-zero entry point.
>  (e.g. exec.a_entry = 0x2A00)
>
>* The old Booter kernel loading code loads the text segment at
>  address 0 of the supplied buffer, which means that the Booter
>  jumps to an entry point a_entry bytes into both the buffer,
>  and the text segment
>
>* The loadfile code loads the text segment at address MARK_START
>  plus a_entry:
>
>    u_long entry = x->a_entry
>    ...
>    paddr_t offset = marks[MARK_START];
>    ...
>    min = maxp = ALIGNENTRY(entry)
>    ...
>        if (READ(fd, maxp, x->a_text - sub) != x->a_text - sub) {
>
>  which means that the Booter jumps into an entry point a_entry
>  bytes into the buffer, but 0 bytes into the text segment
>
>
>	Looking at the kernel sources, none of the other bootloaders
>seem to do anything special - they just jump to marks[MARK_ENTRY].

What does your loadfile_machdep.h contain?
Is your a.out file NMAGIC, OMAGIC, or ZMAGIC?

christos