<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Hi Philipp and Carlos,<br><br>Thanks for the reply.<br><br>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?<br><br>Also,<br>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?<br><br><br>Thanks,<br>Sumesh.<br><br><br><br><div>> Date: Mon, 26 Sep 2011 20:13:24 +0200<br>> Subject: Re: Loading Linux from already running code..<br>> From: p.ittershagen@googlemail.com<br>> To: cmunoz@sablenetworks.com<br>> CC: linuxppc-dev@lists.ozlabs.org; sumeshkkn@hotmail.com<br>> <br>> On Mon, Sep 26, 2011 at 7:26 PM, Carlos Munoz <cmunoz@sablenetworks.com> wrote:<br>> > You could build a tarball containing the root files system, dtb, Linux,<br>> > plus a header indicating where the different pieces need to be loaded.<br>> > Then your initial code loads the different parts at the right memory<br>> > locations, sets up the Linux arguments, and jumps to Linux.<br>> <br>> That is exactly what the firmware-independent simpleImage.initrd.*<br>> targets already do. The resulting elf file include the dtb and initrd<br>> as well as a prompt-like boot arg cli.<br>> I think it will be possible to just place the simpleImage.initrd.*<br>> into you memory and let the existing code jump to the start adress of<br>> the elf image. I managed to start a ppc core using JTAG and the<br>> simpleImage.initrd elf files and I think the procedure is very much<br>> the same but instead of the JTAG debugger setting the PC to the start<br>> address, your startup code has to do it.<br>> <br>> <br>> Philipp<br>> _______________________________________________<br>> Linuxppc-dev mailing list<br>> Linuxppc-dev@lists.ozlabs.org<br>> https://lists.ozlabs.org/listinfo/linuxppc-dev<br></div>                                          </div></body>
</html>