From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from blu0-omc3-s20.blu0.hotmail.com (blu0-omc3-s20.blu0.hotmail.com [65.55.116.95]) by ozlabs.org (Postfix) with ESMTP id B533AB6F83 for ; Tue, 27 Sep 2011 16:51:34 +1000 (EST) Message-ID: Content-Type: multipart/alternative; boundary="_21713310-484d-4c88-9dd6-5ae7e0731e76_" From: Sumesh Kaana To: , Subject: RE: Loading Linux from already running code.. Date: Tue, 27 Sep 2011 06:51:30 +0000 In-Reply-To: References: , <1317058016.1650.50.camel@pug>, MIME-Version: 1.0 Cc: linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --_21713310-484d-4c88-9dd6-5ae7e0731e76_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Philipp and Carlos=2C Thanks for the reply. When simpleImage.elf is loaded by a debugger=2C the debugger reads the elf = image header and places various sections of image into right place in the R= AM. But when I do it from already_running_code=2C I should manually unpack = the elf and place the sections in the memory=2C then jump to the start addr= ess=2C Am I right? Also=2C Is it possible to load a simpleImage.bin file and jump to the start address= using a function pointer=2C Hence I can avoid unpack_elf_image()...? - Wil= l this work? Thanks=2C Sumesh. > Date: Mon=2C 26 Sep 2011 20:13:24 +0200 > Subject: Re: Loading Linux from already running code.. > From: p.ittershagen@googlemail.com > To: cmunoz@sablenetworks.com > CC: linuxppc-dev@lists.ozlabs.org=3B sumeshkkn@hotmail.com >=20 > On Mon=2C Sep 26=2C 2011 at 7:26 PM=2C Carlos Munoz wrote: > > You could build a tarball containing the root files system=2C dtb=2C Li= nux=2C > > plus a header indicating where the different pieces need to be loaded. > > Then your initial code loads the different parts at the right memory > > locations=2C sets up the Linux arguments=2C and jumps to Linux. >=20 > That is exactly what the firmware-independent simpleImage.initrd.* > targets already do. The resulting elf file include the dtb and initrd > as well as a prompt-like boot arg cli. > I think it will be possible to just place the simpleImage.initrd.* > into you memory and let the existing code jump to the start adress of > the elf image. I managed to start a ppc core using JTAG and the > simpleImage.initrd elf files and I think the procedure is very much > the same but instead of the JTAG debugger setting the PC to the start > address=2C your startup code has to do it. >=20 >=20 > Philipp > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev = --_21713310-484d-4c88-9dd6-5ae7e0731e76_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi Philipp and Carlos=2C

Thanks for the reply.

When simpleIma= ge.elf is loaded by a debugger=2C the debugger reads the elf image header a= nd places various sections of image into right place in the RAM. But when I= do it from already_running_code=2C I should manually unpack the elf and pl= ace the sections in the memory=2C then jump to the start address=2C Am I ri= ght?

Also=2C
Is it possible to load a simpleImage.bin file and ju= mp to the start address using a function pointer=2C Hence I can avoid unpac= k_elf_image()...? - Will this work?


Thanks=2C
Sumesh.

=

>=3B Date: Mon=2C 26 Sep 2011 20:13:24 +0200
>=3B Subje= ct: Re: Loading Linux from already running code..
>=3B From: p.ittersh= agen@googlemail.com
>=3B To: cmunoz@sablenetworks.com
>=3B CC: li= nuxppc-dev@lists.ozlabs.org=3B sumeshkkn@hotmail.com
>=3B
>=3B O= n Mon=2C Sep 26=2C 2011 at 7:26 PM=2C Carlos Munoz <=3Bcmunoz@sablenetwor= ks.com>=3B wrote:
>=3B >=3B You could build a tarball containing t= he root files system=2C dtb=2C Linux=2C
>=3B >=3B plus a header indi= cating where the different pieces need to be loaded.
>=3B >=3B Then = your initial code loads the different parts at the right memory
>=3B &= gt=3B locations=2C sets up the Linux arguments=2C and jumps to Linux.
&g= t=3B
>=3B That is exactly what the firmware-independent simpleImage.i= nitrd.*
>=3B targets already do. The resulting elf file include the dt= b and initrd
>=3B as well as a prompt-like boot arg cli.
>=3B I t= hink it will be possible to just place the simpleImage.initrd.*
>=3B i= nto you memory and let the existing code jump to the start adress of
>= =3B the elf image. I managed to start a ppc core using JTAG and the
>= =3B simpleImage.initrd elf files and I think the procedure is very much
= >=3B the same but instead of the JTAG debugger setting the PC to the star= t
>=3B address=2C your startup code has to do it.
>=3B
>=3B=
>=3B Philipp
>=3B _____________________________________________= __
>=3B Linuxppc-dev mailing list
>=3B Linuxppc-dev@lists.ozlabs.= org
>=3B https://lists.ozlabs.org/listinfo/linuxppc-dev
=
= --_21713310-484d-4c88-9dd6-5ae7e0731e76_--