    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>Linux.com :: Question on booting Linux kernel on Intel-based platform?</title>
        <link>http://www.linux.com/archive/forums/topic/5167</link>
        <description>Everything Linux and Open Source</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Linux.com Admin</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.linux.com" /> 
        <admin:errorReportsTo rdf:resource="mailto:noreply@linux.com" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>



<div class="xarbb-noteswrapper">
</div>

   <div class="xarbb-noteswrapper">
       <div class="xar-sub rightnote">
           <div>
                    <a href="http://www.linux.com/archive/forums/topic/5222">
Previous Topic</a>
|
                    <a href="http://www.linux.com/archive/forums/topic/5147">
Next Topic</a>
</div>

           <div>
                    <a href="http://www.linux.com/archive/forums/printtopic/5167?theme=print">
Print this topic</a> |
You are not subscribed            </div>
        </div>
        <div style="clear: both;"></div>
    </div>

    <h1>
        <a class="xar-title" href="http://www.linux.com/archive/forums/topic/5167">Question on booting Linux kernel on Intel-based platform?</a>
   </h1>


   <div class="xarbb-topiccontrols">
<form action="http://www.linux.com/archive/forums?func=jump" method="post">
   <label for="xarbb_jump_menu">Forum Jump</label>
    <select name="f" id="xarbb_jump_menu" onchange="this.form.submit();">
        <optgroup label="Options">
            <option value="5" selected="selected">
Please select forum            </option>
            <option value="5">--------------------</option>
        </optgroup>
        <optgroup label="Forums">
                <option value="1">New to Linux</option>
                <option value="2">Hardware</option>
                <option value="3">Linux Distributions</option>
                <option value="4">Applications</option>
                <option value="5">Programming and Development</option>
                <option value="6">Miscellaneous Discussion</option>
                <option value="7">Linux.com Writers Forum</option>
                <option value="8">Jobs</option>
        </optgroup>
    </select>
    <input type="submit" class="button" value="Jump" />
</form>
<div style="clear: both;"></div>
   </div>

   <div class="xarbb-topiccontrols">

<span class="xar-sub">
    <a href="http://www.linux.com/archive/forums">
Forum Index    </a>
    <span style="font-size: larger;">&#187;</span>
    <a href="http://www.linux.com/archive/forums/category/4181">
        Forums 
    </a>
    <span style="font-size: larger;">&#187;</span>
    <a href="http://www.linux.com/archive/forums/forum/5">
        Programming and Development   </a>
</span>
<div style="clear: both;"></div>
   </div>

<div class="xarbb-tablewrapper">



   <table>
       <tr>
           <th scope="col">
Author</th>
           <th scope="col">
Message</th>
       </tr>



            <tr>
                <td class="xar-norm author">
                    <div>
                        <a href="http://www.linux.com/archive/roles/421884">eagerboy</a>
                   </div>
                   <div class="xar-sub">
Joined: Apr 16, 2009<br/>Posts: 4                        <br />
                        <a href="http://www.linux.com/archive/forums?by=421884&amp;func=searchtopics">
Other Topics</a>
                   </div>
               </td>

               <td class="xar-norm message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted Apr 16, 2009 at 12:54:40 AM</span>
                       </div>



<div style="float: left;">
                           <strong class="xar-sub">
Subject: Question on booting Linux kernel on Intel-based platform?                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div>
                        Hello Linux gurus,
    I am looking for a way to boot Linux kernel onto my Intel-based embedded platform. The tricky part is that even though it's Intel based (Intel Core 2 Duo - Wolfdale) my system doesn't behave like a regular PC where I can alter BIOS and ask Bios to load Grub stage 1 from MBR and jump to Grub stage 1.5 or stage2. There is no hard drive on my platform and there is no way to alter BIOS boot up (press Del or F2). BIOS will just automatically boot to a home-grown bootloader prompt (written by another group). The requirement is I have to load Linux using this bootloader AS IS. This bootloader only support loading ELF image with an unique header. 
     Previously, I was able to achieve this task on a MIPS based (Cavium CPU) platform using Ram-based U-boot. The way I did it was to package this Ram-based Denx U-boot written by Cavium with the unique header required by our home-grown bootloader then:
Home-grown bootloader ---&gt; load Ram-based U-boot ---&gt; load Linux kernel

    I can use similar concept for this Intel-based platform but here are 2 possible choices that I can choose:

1) Use U-boot and load it in RAM just like in the MIPS case. However, there is very little support for Intel (especially Intel Wolfdale CPU) in U-boot. If I take this route, I may end up adding support for this CPU. With no ICE and support from vendor, I may be in for a very rough ride.

2) Use GRUB. The good thing about this choice is GRUB has been primarily used for loading Linux on Intel-based platform. The tricky part is how to make my home-grown bootloader load GRUB.

   One way I can think of is to build GRUB stage 2 and packaged it with our unique ELF header then use our bootloader to boot it. Once GRUB stage 2 took control and print out the menu, we can boot Linux from there. Is it feasible? Is there any better way to do this?

   Currently look like GRUB stage2 is in exec format. How can I convert it to ELF format? Any help is greatly appreciated. I'm stuck.

Thanks,
</div>

                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>
               <td class="xar-alt">

                        <a href="http://www.linux.com/archive/roles/421884">
                            <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                        </a>
                        <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=421884">
                            <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                       </a>
                            <a href="http://">
                                <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                           </a>
</td>
           </tr>





           <tr>
               <td class="xar-norm author">
                   <strong>

                            <a href="http://www.linux.com/archive/roles/386456">
                                Rubberman                           </a>
</strong>

                   <span class="xar-sub">
<br />
Joined Jul 30, 2007<br/>Posts: 944<br />
Location:40 miles west of Chicago<br />
                        <br />
                        <a href="http://www.linux.com/archive/forums?by=386456&amp;func=searchtopics">
Other Topics                        </a>
                    </span>
                </td>

                <td class="xar-accent message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted:
                                Apr 17, 2009 12:22:03 AM                           </span>
                       </div>
                       <div class="rightnote">
</div>
                       <div style="float:left;">
                           <strong class="xar-sub">
Subject:
                                <a name="1212164" href="http://www.linux.com/archive/forums/topic/5167#1212164">
                                    Question on booting Linux kernel on Intel-based platform?                                </a>
                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div style="clear: left;">
                        Can you describe the hardware a bit more thoroughly? Such as, what does it use for persistent storage (ee-prom, flash, battery-backed sram, ...), what does it first boot-strap from, etc. I spent a lot of years working on embedded systems, so I might be able to help, but as indicated, you haven't provided enough data as yet.<p class="hiddensignature">
Sometimes real fast is almost as good as real time.
Remember, Google is your friend!</p>
                    </div>
                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>

               <td class="xar-alt">

                            <a href="http://www.linux.com/archive/roles/386456">
                                <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                            </a>
                            <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=386456">
                                <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                           </a>
                                <a href="http://">
                                    <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                               </a>
                                <a href="aim:goim?screenname=vikrant48&amp;message=Hello+Are+you+there?">
                                    <img src="modules/xarbb/xarimages/new/icon_aim.gif" alt="AOL Instant Messenger" />
                               </a>
</td>
           </tr>

           <tr>
               <td class="xar-norm author">
                   <strong>

                            <a href="http://www.linux.com/archive/roles/421884">
                                eagerboy                           </a>
</strong>

                   <span class="xar-sub">
<br />
Joined Apr 16, 2009<br/>Posts: 4<br />
                        <br />
                        <a href="http://www.linux.com/archive/forums?by=421884&amp;func=searchtopics">
Other Topics                        </a>
                    </span>
                </td>

                <td class="xar-norm message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted:
                                Apr 22, 2009 10:19:44 PM                           </span>
                       </div>
                       <div class="rightnote">
</div>
                       <div style="float:left;">
                           <strong class="xar-sub">
Subject:
                                <a name="1212336" href="http://www.linux.com/archive/forums/topic/5167#1212336">
                                    Question on booting Linux kernel on Intel-based platform?                                </a>
                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div style="clear: left;">
                           Thanks for offering to help. My platform is a router. It has Intel CPU Core 2 Duo, MCH north bridge connects with 4GB of memory and GE ports; 16MB of flash memory for boot up code (which I'm not allowed to change), ICH9 connects to PCIe, USB devices and compact flash. There is no hard drive on the system.
   Upon boot up, BIOS will run to initialize the CPU and memory, then it will transfer control to a home-grown bootloader developed by another team. Once it boots to this bootloader prompt, I come in and load Linux kernel. At this point, network is available, memory and compact flash has been initialized. USB will be initialized at this stage as well but not at this moment yet.
  This bootloader can only load ELF image and nothing else. I can either convert Grub Makefile to compile Grub stage 2 to ELF format and load that or compile it natively and use a tool to convert it to ELF. Any good suggestion you may have?                    </div>
                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>

               <td class="xar-alt">

                            <a href="http://www.linux.com/archive/roles/421884">
                                <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                            </a>
                            <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=421884">
                                <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                           </a>
                                <a href="http://">
                                    <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                               </a>
</td>
           </tr>

           <tr>
               <td class="xar-norm author">
                   <strong>

                            <a href="http://www.linux.com/archive/roles/421884">
                                eagerboy                           </a>
</strong>

                   <span class="xar-sub">
<br />
Joined Apr 16, 2009<br/>Posts: 4<br />
                        <br />
                        <a href="http://www.linux.com/archive/forums?by=421884&amp;func=searchtopics">
Other Topics                        </a>
                    </span>
                </td>

                <td class="xar-accent message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted:
                                Apr 22, 2009 10:26:10 PM                           </span>
                       </div>
                       <div class="rightnote">
</div>
                       <div style="float:left;">
                           <strong class="xar-sub">
Subject:
                                <a name="1212337" href="http://www.linux.com/archive/forums/topic/5167#1212337">
                                    Question on booting Linux kernel on Intel-based platform?                                </a>
                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div style="clear: left;">
                        I forgot to add that the home-grown bootloader code resides in the 16MB flash along with BIOS. Linux kernel that I need to load resides on the network space. The home-grown booloader made sure network is up and alive at its prompt.                    </div>
                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>

               <td class="xar-alt">

                            <a href="http://www.linux.com/archive/roles/421884">
                                <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                            </a>
                            <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=421884">
                                <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                           </a>
                                <a href="http://">
                                    <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                               </a>
</td>
           </tr>

           <tr>
               <td class="xar-norm author">
                   <strong>

                            <a href="http://www.linux.com/archive/roles/386456">
                                Rubberman                           </a>
</strong>

                   <span class="xar-sub">
<br />
Joined Jul 30, 2007<br/>Posts: 944<br />
Location:40 miles west of Chicago<br />
                        <br />
                        <a href="http://www.linux.com/archive/forums?by=386456&amp;func=searchtopics">
Other Topics                        </a>
                    </span>
                </td>

                <td class="xar-norm message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted:
                                Apr 23, 2009 6:41:39 AM                           </span>
                       </div>
                       <div class="rightnote">
</div>
                       <div style="float:left;">
                           <strong class="xar-sub">
Subject:
                                <a name="1212347" href="http://www.linux.com/archive/forums/topic/5167#1212347">
                                    Question on booting Linux kernel on Intel-based platform?                                </a>
                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div style="clear: left;">
                        What about writing a custom boot loader? I've done that in the past (deep, dark, long ago as in the mid-80's) - it really isn't too difficult. You just need to know where on the system the actual kernel is located to load it. Check out the grub source code and documentation for information how to do this in the Linux environment.<p class="hiddensignature">
Sometimes real fast is almost as good as real time.
Remember, Google is your friend!</p>
                    </div>
                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>

               <td class="xar-alt">

                            <a href="http://www.linux.com/archive/roles/386456">
                                <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                            </a>
                            <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=386456">
                                <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                           </a>
                                <a href="http://">
                                    <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                               </a>
                                <a href="aim:goim?screenname=vikrant48&amp;message=Hello+Are+you+there?">
                                    <img src="modules/xarbb/xarimages/new/icon_aim.gif" alt="AOL Instant Messenger" />
                               </a>
</td>
           </tr>

           <tr>
               <td class="xar-norm author">
                   <strong>

                            <a href="http://www.linux.com/archive/roles/421884">
                                eagerboy                           </a>
</strong>

                   <span class="xar-sub">
<br />
Joined Apr 16, 2009<br/>Posts: 4<br />
                        <br />
                        <a href="http://www.linux.com/archive/forums?by=421884&amp;func=searchtopics">
Other Topics                        </a>
                    </span>
                </td>

                <td class="xar-accent message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted:
                                Apr 23, 2009 7:35:00 PM                           </span>
                       </div>
                       <div class="rightnote">
</div>
                       <div style="float:left;">
                           <strong class="xar-sub">
Subject:
                                <a name="1212361" href="http://www.linux.com/archive/forums/topic/5167#1212361">
                                    Question on booting Linux kernel on Intel-based platform?                                </a>
                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div style="clear: left;">
                        I already checked out Grub 0.97 source code. I'm currently trying to change Grub Makefile to compile stage 2 to an ELF image. Do you know of a utility to package the original stage 2 (binary exec format) to ELF?                    </div>
                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>

               <td class="xar-alt">

                            <a href="http://www.linux.com/archive/roles/421884">
                                <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                            </a>
                            <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=421884">
                                <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                           </a>
                                <a href="http://">
                                    <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                               </a>
</td>
           </tr>

           <tr>
               <td class="xar-norm author">
                   <strong>

                            <a href="http://www.linux.com/archive/roles/386456">
                                Rubberman                           </a>
</strong>

                   <span class="xar-sub">
<br />
Joined Jul 30, 2007<br/>Posts: 944<br />
Location:40 miles west of Chicago<br />
                        <br />
                        <a href="http://www.linux.com/archive/forums?by=386456&amp;func=searchtopics">
Other Topics                        </a>
                    </span>
                </td>

                <td class="xar-norm message">
                   <div class="xarbb-messagecontrols">
                       <div class="leftnote">
                           <span class="xar-sub">
Posted:
                                Apr 24, 2009 4:46:59 PM                           </span>
                       </div>
                       <div class="rightnote">
</div>
                       <div style="float:left;">
                           <strong class="xar-sub">
Subject:
                                <a name="1212382" href="http://www.linux.com/archive/forums/topic/5167#1212382">
                                    Question on booting Linux kernel on Intel-based platform?                                </a>
                            </strong>
                        </div>
                        <div style="clear: both;"></div>
                    </div>

                    <div style="clear: left;">
                        The gcc compilers automatically generate ELF intermediaries. Just verify that you are using the correct compiler/linker options.<p class="hiddensignature">
Sometimes real fast is almost as good as real time.
Remember, Google is your friend!</p>
                    </div>
                </td>
            </tr>

            <tr>
                <td class="xar-norm author">
                    <a href="http://www.linux.com/archive/forums/topic/5167#top">
Back to top</a>
</td>

               <td class="xar-alt">

                            <a href="http://www.linux.com/archive/roles/386456">
                                <img src="modules/xarbb/xarimages/new/icon_profile.gif" alt="Profile" />
                            </a>
                            <a href="http://www.linux.com/archive/?module=roles&amp;func=email&amp;uid=386456">
                                <img src="modules/xarbb/xarimages/new/icon_email.gif" alt="Email" />
                           </a>
                                <a href="http://">
                                    <img src="modules/xarbb/xarimages/new/icon_www.gif" alt="Website" />
                               </a>
                                <a href="aim:goim?screenname=vikrant48&amp;message=Hello+Are+you+there?">
                                    <img src="modules/xarbb/xarimages/new/icon_aim.gif" alt="AOL Instant Messenger" />
                               </a>
</td>
           </tr>
</table>
</div>

<div class="xarbb-topiccontrols">

<span class="xar-sub">
    <a href="http://www.linux.com/archive/forums">
Forum Index    </a>
    <span style="font-size: larger;">&#187;</span>
    <a href="http://www.linux.com/archive/forums/category/4181">
        Forums 
    </a>
    <span style="font-size: larger;">&#187;</span>
    <a href="http://www.linux.com/archive/forums/forum/5">
        Programming and Development   </a>
</span>

</div>



            </channel>
</rss>
