I am forwarding this for the benefit of any newbies out there like me...A big thanks to Ron Minnich for patiently helping me out.<br><br>-Ravi<br><div class="gmail_quote"><span style="font-size: large; font-weight: bold;">Forwarded conversation</span><br>

Subject: <b class="gmail_sendername">Coreboot+FILO on qemu</b><br>------------------------<br><br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>

Date: Fri, Apr 10, 2009 at 6:28 PM<br>To: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br></font><br></span><br>Hello,<br><br>I was trying to run a linux kernel from FILO but got some errors.The following explains best what i did.<br>

<br>1.Downloaded FILO and built libpayload and FILO<br>2. Downloaded and built Coreboot with filo.elf as the image<br>
3.Created a hard disk image in /home/ravi/  and formatted it                    <br>    <b>$ qemu-img create -f raw disk.img 200M<br>    $ mkfs.ext2 -F disk.img</b><br>4.As root, mounted the disk<br>    <b> $mkdir /mnt/rootfs<br>


     $mount -o loop disk.img /mnt/rootfs</b><br>5.And copied vmlinuz and initrd from the /boot/ folder(openSuse11.1).<br>  <b>$ mkdir /mnt/rootfs/boot<br>  $ cp /boot/vmlinuz /mnt/rootfs/boot/vmlinuz<br>  $ cp /boot/initrd /mnt/rootfs/boot/initrd</b><br>


6.Unmounted /dev/rootfs<br>7.Started qemu:<b>qemu -L ~ -hda disk.img  -nographic</b><br>(i had to copy vgabios-cirrus.bin from /usr/share/qemu to my home directory beacuse it qemu complained that it was missing)<br>8.All is well, i get FILO prompt.Now according to <a href="http://www.coreboot.org/QEMU_Build_Tutorial" target="_blank">http://www.coreboot.org/QEMU_Build_Tutorial</a>, i try:<br>


<b>filo>hda:/boot/vmlinuz root=/dev/hda initrd=/boot/initrd console=ttyS0<br>Error 27: Unrecognized command<br>filo></b><br>9.So i try:<br><b>filo>kernel /boot/vmlinuz root=/dev/hda initrd-/boot/initrd console=ttyS0<br>


filo>boot<br>Booting '/boot/vmlinuz root=/dev/hda initrd-/boot/initrd console=ttyS0'<br>read_sector: device not open<br>File not found.<br>filo></b><br><br>What am i doing wrong ?<br><br>Thanks,<br>Ravi<br>

  <br>
<br><br><br>
<br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 8:27 PM<br>

To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br>Cc: <a href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br></font><br></span><br>I don't know why this did not work, I guess the default is the new<br>


command syntax from grub.<br>
OK, do this first:<br>
<br>
file> root (hd0)<br>
<br>
Then:<br>
It should then work. It works for me.<br>
<font color="#888888"><br>
ron<br>
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 10:08 PM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br>Hello Ron,<br>I am still getting the file not found message:<br><br><b>filo> root [hd0]Unknown device type<br>

<br>Error 15: File not found<br>
filo><br></b><br>My doubt is whether i am correct in copying the initrd and vminuz from my OS's /boot folder into disk.img.May be i should compile the kernel from scratch and then copy the resulting files to the disk.img? Should i aslo copy the entire root file system?<br>


<br>The probe command returns that no drive exists.<br><b>filo> probe<br>Drive 1 does not exist<br>IDE time out<br>reset failed, but slave may exist<br>hdc: ATAPI: QEMU DVD-ROM<br>Media detection failed<br>Drive 3 does not exist<br>


IDE channel 2 not found<br>IDE channel 2 not found<br>IDE channel 3 not found<br>IDE channel 3 not found<br>filo></b><br><br>-Ravi<div><div></div></div><font color="#888888">-- <br><br><a href="http://www.brainyquote.com/quotes/authors/g/george_burns.html" target="_blank">George Burns</a>  - "I spent a year in that town, one Sunday."
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 10:26 PM<br>

To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>keep it simple.<br>
<br>
First, it is NOT root [hd0] it is root(hd0)<br>
<br>
Next, put vmlinuz in / of your hda image.<br>
<br>
Then just try<br>
boot /vmlinuz<br>
<br>
one simple step at a time.<br>
<font color="#888888"><br>
ron<br>
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 10:45 PM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br><b>ravionlinux:/home/ravi # </b>mount -o loop disk.img  /mnt/rootfs/<b><br>ravionlinux:/home/ravi </b># ls /mnt/rootfs/<br>

vmlinuz<br><b>ravionlinux:/home/ravi </b>#<b> </b>umount /mnt/rootfs/<br><b>ravionlinux:/home/ravi # </b>exit<br>
exit<br><b>ravi@ravionlinux:~></b> qemu -L ~ -hda disk.img  -nographic<br>*<br>*blah blah blah......<br>*<br>*<br><b>filo> </b>root(hd0)<b><br>Error 27: Unrecognized command<br><br>filo></b> root (hd0)<br><b>filo> </b>boot /vmlimuz<br>


No kernel.<br><b>filo></b><br><br>Thanks,<br>Ravi<div><div></div></div><font color="#888888">-- <br><br><a href="http://www.brainyquote.com/quotes/authors/v/vince_lombardi.html" target="_blank">Vince Lombardi</a>  - "Show me a good loser, and I'll show you a loser."
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 10:47 PM<br>

To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>mount -o loop hda.img /mnt<br>
ls /mnt /mnt/boot<br>
<br>
send me output.<br>
<font color="#888888"><br>
ron<br>
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 10:56 PM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br><br>My image does not have any subdirectories. All i did to create it was:<br><pre># mkdir /mnt/rootfsSo the command <b>ls /mnt /mnt/boot</b> is invalid for me</pre>

<div><div></div></div><div><div></div></div><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>

Date: Fri, Apr 10, 2009 at 10:58 PM<br>To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>of course. no problem. Now try booting that disk.<br>
<font color="#888888"><br>
ron<br>
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 11:05 PM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br>boot  lost+found<br>ravionlinux:/home/ravi # ls /mnt/rootfs/boot/<br>vmlinuz*<br>filo> root (hd0)<br>filo> boot /vmlinuz<br>

No kernel.<br>filo><div><div></div></div><font color="#888888">-- <br><br><a href="http://www.brainyquote.com/quotes/authors/n/norman_mailer.html" target="_blank">Norman Mailer</a>  - "Writing books is the closest men ever come to childbearing."
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 11:15 PM<br>

To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>the parser is really, really stupid.<br>
<br>
root (hd0)<br>
kernel /vmlinuz<br>
boot<br>
<br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Fri, Apr 10, 2009 at 11:19 PM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br>I'm back to square one (see my orignal post <img goomoji="gtalk.325" style="margin: 0pt 0.2ex; vertical-align: middle;" src="cid:gtalk.325@goomoji.gmail">)<br>

<b>filo> root (hd0)<br>filo> kernel /vmlinuz<br>File not found.</b><div><div></div></div><font color="#888888">-- <br><br><a href="http://www.brainyquote.com/quotes/authors/a/andy_warhol.html" target="_blank">Andy Warhol</a>  - "I am a deeply superficial person."
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>Date: Sat, Apr 11, 2009 at 12:20 AM<br>

To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>You put it in boot. Try kernel /boot/vmlinuz<br>
Ron<div><div></div></div><font color="#888888">
--<br>
Sent from my mobile device
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Sat, Apr 11, 2009 at 10:20 AM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br>That finally worked Ron! Thanks a lot for your patience :)<br><br>But why does root=/dev/hda not work? Qemu was invoked with hda as the image right?I think it is beacuse FILO follows the GRUB convention for idenifying partitons....<br>


<br>Thanks once again.<br>-Ravi<div><div></div></div><div><div></div></div><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>

Date: Sat, Apr 11, 2009 at 10:43 AM<br>To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br><br><br><div class="gmail_quote"><div><br>Where did you use root=/dev/hda?<br>

<br>ron <br></div></div>
<br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Sat, Apr 11, 2009 at 10:54 AM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br>As given in<a href="http://www.coreboot.org/FILO" target="_blank"> these</a> t<a href="http://www.coreboot.org/QEMU_Build_Tutorial" target="_blank">utorials</a>;<br>

<pre>1)filo: hda:/boot/vmlinuz root=/dev/hda initrd=/boot/initrd console=ttyS0<br>2)filo> kernel hdc:/GEEXBOX/boot/vmlinuz root=/dev/ram0 rw init=linuxrc boot=cdrom installator<br>
</pre>i had tried <b>filo>kernel /boot/vmlinuz root=/dev/hda initrd=/boot/initrd console=ttyS0</b><div><div></div></div><div><div></div></div><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>

Date: Sat, Apr 11, 2009 at 10:56 AM<br>To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>I'm sort of pushing you here :-)<br>
<br>
so, think about this: you said root=/dev/hda. What program or piece of<br>
software would look at that parameter? FILO? Or something else?<br>
<font color="#888888"><br>
ron<br>
</font><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">Ravishankar</b> <span dir="ltr"><<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>></span><br>Date: Sat, Apr 11, 2009 at 11:03 AM<br>

To: ron minnich <<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>><br></font><br></span><br>I thougt the payload/bootloader(FILO) is the one that parses the parameters.<div><div></div></div><div><div></div>

</div><br>----------<br><span class="undefined"><font color="#000000">From: <b class="undefined">ron minnich</b> <span dir="ltr"><<a href="mailto:rminnich@gmail.com">rminnich@gmail.com</a>></span><br>Date: Sat, Apr 11, 2009 at 11:08 AM<br>

To: Ravishankar <<a href="mailto:cyberax82@gmail.com">cyberax82@gmail.com</a>><br></font><br></span><br>I had begun to realize that :-)<br>
<br>
But consider this: what if FILO was parsing those parameters, and<br>
linux changed in the future in some way? FILO would no longer be able<br>
to parse those boot parameters correctly; still worse, it might change<br>
them in some way that Linux could not comprehend.<br>
<br>
Hence, it is essential that FILO not parse those parameters! They must<br>
be passed uninterpreted to Linux.<br>
<br>
Plus, while we might have to tell FILO one location about where to get<br>
the kernel image, we might have to tell the kernel a different<br>
location  about where to get the root file system. So it would be a<br>
mistake for FILO to use the root=/dev/hda parameter to locate the<br>
kernel file.<br>
<br>
That is why the root parameter to filo and the root parameter to linux<br>
are seperate, and also why FILO must not parse the boot parameters<br>
that are there for Linux.<br>
<br>
Thanks<br>
<font color="#888888"><br>
ron<br>
</font><br></div>