linux-mips
[Top] [All Lists]

Re: RFC: Sentosa boot fix

To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Subject: Re: RFC: Sentosa boot fix
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Tue, 30 Jan 2007 17:56:19 +0000 (GMT)
Cc: vagabon.xyz@gmail.com, dan@debian.org, linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <20070131.014133.75185230.anemo@mba.ocn.ne.jp>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.64N.0701291527130.26916@blysk.ds.pg.gda.pl> <20070130.011442.21365159.anemo@mba.ocn.ne.jp> <cda58cb80701290827i1892e74dlb60651847982f77f@mail.gmail.com> <20070131.014133.75185230.anemo@mba.ocn.ne.jp>
Sender: linux-mips-bounce@linux-mips.org
On Wed, 31 Jan 2007, Atsushi Nemoto wrote:

> I compiled ip27 kernel and really confused...
> 
> head.S:
>       PTR_LA          t0, __bss_start         # clear .bss
>       LONG_S          zero, (t0)
> 
> System.map:
> a8000000003b6000 A __bss_start
> 
> vmlinux:
> a800000000385058:     3c0c003b        lui     t0,0x3b
> a80000000038505c:     658c6000        daddiu  t0,t0,24576
> a800000000385060:     fd800000        sd      zero,0(t0)
> 
> vmlinux.32:
> 80385058:     3c0c003b        lui     t4,0x3b
> 8038505c:     658c6000        daddiu  t4,t4,24576
> 80385060:     fd800000        sd      zero,0(t4)
> 
> How does this code work?  Isn't address 0x3b6000 in user space?

 Well, the default config for this machine specifies -msym32 with the load 
address of 0xa80000000001c000.  No wonder it does not work.

 I suppose the setup for this platform should be more or less like this:

ifdef CONFIG_BUILD_ELF64
ifdef CONFIG_MAPPED_KERNEL
load-$(CONFIG_SGI_IP27)         += 0xc00000004001c000
dataoffset-$(CONFIG_SGI_IP27)   += 0x01000000
else
load-$(CONFIG_SGI_IP27)         += 0xa80000000001c000
endif
else
ifdef CONFIG_MAPPED_KERNEL
load-$(CONFIG_SGI_IP27)         += 0xffffffffc001c000
OBJCOPYFLAGS                    := --change-addresses=0xc000000080000000
dataoffset-$(CONFIG_SGI_IP27)   += 0x01000000
else
load-$(CONFIG_SGI_IP27)         += 0xffffffff8001c000
OBJCOPYFLAGS                    := --change-addresses=0xa800000080000000
endif
endif

 I can cook a patch if some SGI expert steps in and comments whether this 
makes sense from the platform point of view or not.

  Maciej

<Prev in Thread] Current Thread [Next in Thread>