Subject: Re: i386 stand/lib/loadfile.c on pmax problems
To: Simon Burge <simonb@netbsd.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 03/24/1999 10:51:39
On Wed, 24 Mar 1999 14:04:37 +1100
Simon Burge <simonb@netbsd.org> wrote:
> On the pmax, entry is 0x80030000, and both "start" and "_kernel_text"
> are the same value. If LOAD_HDR is set (I'm passing LOAD_ALL to
> loadfile()), then the a.out header is saved at 0x80030000, and the
> kernel text (and hence "start") 0x20 bytes (sizeof(struct aout)) higher.
> Then we jump to 0x80030000, and of course things don't work very well at
> all ;)
>
> On the i386, "start" is 0x20 bytes higher than "_kernel_text", and
> everything is hunky dory. Without knowing much about the i386, I'm not
> sure why the two are different. nm -n of a "normal" binary shows "start"
> at 0x1020, maybe the 0x20 offset is ``magic'' on the i386.
That's because the i386 a.out kernels are ZMAGIC, i.e. a.out header
is part of the text segment.
-- Jason R. Thorpe <thorpej@nas.nasa.gov>