* Loading Linux from already running code..
@ 2011-09-25 18:47 Sumesh Kaana
2011-09-26 17:26 ` Carlos Munoz
0 siblings, 1 reply; 4+ messages in thread
From: Sumesh Kaana @ 2011-09-25 18:47 UTC (permalink / raw)
To: linuxppc-dev, jwboyer
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
Hi All,
I need some suggestions for booting Linux( >2.6.30 ) with my new project.
Scenario:I've a custom built board with PowerPC 440 + 256 MB RAM. there is NO FLASH on this board.There is a hardware logic which will get an initial piece of code (through hardware network) into the ram and then execute it. This code does mandatory initialization of a proprietary chip and this code MUST execute on power on. any other images (Linux image or ramdisk) can be loaded any specified area in the memory along with this code.
My requirement is to boot Linux at the end of the this initialization.
what is the best way to do it?
1. Will it be possible to transfer control to a simpleImage.initrd.myboard.elf(or .bin ..?!) image from already_existing_code?2. Should I use u-boot and then load uImage, ramdisk and the dts blob? Using u-boot will reduce the effort?3. Is there any other way to approach this??
Regards,Sumesh
[-- Attachment #2: Type: text/html, Size: 1411 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Loading Linux from already running code..
2011-09-25 18:47 Loading Linux from already running code Sumesh Kaana
@ 2011-09-26 17:26 ` Carlos Munoz
2011-09-26 18:13 ` Philipp Ittershagen
0 siblings, 1 reply; 4+ messages in thread
From: Carlos Munoz @ 2011-09-26 17:26 UTC (permalink / raw)
To: Sumesh Kaana; +Cc: linuxppc-dev
You could build a tarball containing the root files system, dtb, Linux,
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, sets up the Linux arguments, and jumps to Linux.
-Carlos
On Sun, 2011-09-25 at 18:47 +0000, Sumesh Kaana wrote:
> Hi All,
>
>
> I need some suggestions for booting Linux( >2.6.30 ) with my new
> project.
>
>
> Scenario:
> I've a custom built board with PowerPC 440 + 256 MB RAM. there is NO
> FLASH on this board.
> There is a hardware logic which will get an initial piece of
> code (through hardware network) into the ram and then execute it. This
> code does mandatory initialization of a proprietary chip and this code
> MUST execute on power on. any other images (Linux image or ramdisk)
> can be loaded any specified area in the memory along with this code.
>
>
> My requirement is to boot Linux at the end of the this initialization.
>
>
> what is the best way to do it?
>
>
> 1. Will it be possible to transfer control to a
> simpleImage.initrd.myboard.elf(or .bin ..?!) image from
> already_existing_code?
> 2. Should I use u-boot and then load uImage, ramdisk and the dts blob?
> Using u-boot will reduce the effort?
> 3. Is there any other way to approach this??
>
>
>
>
>
>
> Regards,
> Sumesh
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists•ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Loading Linux from already running code..
2011-09-26 17:26 ` Carlos Munoz
@ 2011-09-26 18:13 ` Philipp Ittershagen
2011-09-27 6:51 ` Sumesh Kaana
0 siblings, 1 reply; 4+ messages in thread
From: Philipp Ittershagen @ 2011-09-26 18:13 UTC (permalink / raw)
To: Carlos Munoz; +Cc: linuxppc-dev, Sumesh Kaana
On Mon, Sep 26, 2011 at 7:26 PM, Carlos Munoz <cmunoz@sablenetworks•com> wrote:
> You could build a tarball containing the root files system, dtb, Linux,
> 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, sets up the Linux arguments, and jumps to Linux.
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, your startup code has to do it.
Philipp
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Loading Linux from already running code..
2011-09-26 18:13 ` Philipp Ittershagen
@ 2011-09-27 6:51 ` Sumesh Kaana
0 siblings, 0 replies; 4+ messages in thread
From: Sumesh Kaana @ 2011-09-27 6:51 UTC (permalink / raw)
To: p.ittershagen, cmunoz; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]
Hi Philipp and Carlos,
Thanks for the reply.
When simpleImage.elf is loaded by a debugger, the debugger reads the elf image header and places various sections of image into right place in the RAM. But when I do it from already_running_code, I should manually unpack the elf and place the sections in the memory, then jump to the start address, Am I right?
Also,
Is it possible to load a simpleImage.bin file and jump to the start address using a function pointer, Hence I can avoid unpack_elf_image()...? - Will this work?
Thanks,
Sumesh.
> Date: Mon, 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; sumeshkkn@hotmail•com
>
> On Mon, Sep 26, 2011 at 7:26 PM, Carlos Munoz <cmunoz@sablenetworks•com> wrote:
> > You could build a tarball containing the root files system, dtb, Linux,
> > 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, sets up the Linux arguments, and jumps to Linux.
>
> 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, your startup code has to do it.
>
>
> Philipp
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists•ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
[-- Attachment #2: Type: text/html, Size: 2370 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-09-27 6:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-25 18:47 Loading Linux from already running code Sumesh Kaana
2011-09-26 17:26 ` Carlos Munoz
2011-09-26 18:13 ` Philipp Ittershagen
2011-09-27 6:51 ` Sumesh Kaana
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox