[coreboot] Coreboot+FILO on qemu

Ravishankar cyberax82 at gmail.com
Sat Apr 11 07:59:40 CEST 2009


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.

-Ravi
Forwarded conversation
Subject: Coreboot+FILO on qemu
------------------------

From: *Ravishankar* <cyberax82 at gmail.com>
Date: Fri, Apr 10, 2009 at 6:28 PM
To: coreboot at coreboot.org


Hello,

I was trying to run a linux kernel from FILO but got some errors.The
following explains best what i did.

1.Downloaded FILO and built libpayload and FILO
2. Downloaded and built Coreboot with filo.elf as the image
3.Created a hard disk image in /home/ravi/  and formatted it

    *$ qemu-img create -f raw disk.img 200M
    $ mkfs.ext2 -F disk.img*
4.As root, mounted the disk
    * $mkdir /mnt/rootfs
     $mount -o loop disk.img /mnt/rootfs*
5.And copied vmlinuz and initrd from the /boot/ folder(openSuse11.1).
  *$ mkdir /mnt/rootfs/boot
  $ cp /boot/vmlinuz /mnt/rootfs/boot/vmlinuz
  $ cp /boot/initrd /mnt/rootfs/boot/initrd*
6.Unmounted /dev/rootfs
7.Started qemu:*qemu -L ~ -hda disk.img  -nographic*
(i had to copy vgabios-cirrus.bin from /usr/share/qemu to my home directory
beacuse it qemu complained that it was missing)
8.All is well, i get FILO prompt.Now according to
http://www.coreboot.org/QEMU_Build_Tutorial, i try:
*filo>hda:/boot/vmlinuz root=/dev/hda initrd=/boot/initrd console=ttyS0
Error 27: Unrecognized command
filo>*
9.So i try:
*filo>kernel /boot/vmlinuz root=/dev/hda initrd-/boot/initrd console=ttyS0
filo>boot
Booting '/boot/vmlinuz root=/dev/hda initrd-/boot/initrd console=ttyS0'
read_sector: device not open
File not found.
filo>*

What am i doing wrong ?

Thanks,
Ravi





----------
From: *ron minnich* <rminnich at gmail.com>
Date: Fri, Apr 10, 2009 at 8:27 PM
To: Ravishankar <cyberax82 at gmail.com>
Cc: coreboot at coreboot.org


I don't know why this did not work, I guess the default is the new
command syntax from grub.
OK, do this first:

file> root (hd0)

Then:
It should then work. It works for me.

ron

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Fri, Apr 10, 2009 at 10:08 PM
To: ron minnich <rminnich at gmail.com>


Hello Ron,
I am still getting the file not found message:

*filo> root [hd0]Unknown device type

Error 15: File not found
filo>
*
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?

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

-Ravi
-- 

George Burns <http://www.brainyquote.com/quotes/authors/g/george_burns.html>
- "I spent a year in that town, one Sunday."
----------
From: *ron minnich* <rminnich at gmail.com>
Date: Fri, Apr 10, 2009 at 10:26 PM
To: Ravishankar <cyberax82 at gmail.com>


keep it simple.

First, it is NOT root [hd0] it is root(hd0)

Next, put vmlinuz in / of your hda image.

Then just try
boot /vmlinuz

one simple step at a time.

ron

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Fri, Apr 10, 2009 at 10:45 PM
To: ron minnich <rminnich at gmail.com>


*ravionlinux:/home/ravi # *mount -o loop disk.img  /mnt/rootfs/*
ravionlinux:/home/ravi *# ls /mnt/rootfs/
vmlinuz
*ravionlinux:/home/ravi *#* *umount /mnt/rootfs/
*ravionlinux:/home/ravi # *exit
exit
*ravi at ravionlinux:~>* qemu -L ~ -hda disk.img  -nographic
*
*blah blah blah......
*
*
*filo> *root(hd0)*
Error 27: Unrecognized command

filo>* root (hd0)
*filo> *boot /vmlimuz
No kernel.
*filo>*

Thanks,
Ravi
-- 

Vince Lombardi<http://www.brainyquote.com/quotes/authors/v/vince_lombardi.html>
- "Show me a good loser, and I'll show you a loser."
----------
From: *ron minnich* <rminnich at gmail.com>
Date: Fri, Apr 10, 2009 at 10:47 PM
To: Ravishankar <cyberax82 at gmail.com>


mount -o loop hda.img /mnt
ls /mnt /mnt/boot

send me output.

ron

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Fri, Apr 10, 2009 at 10:56 PM
To: ron minnich <rminnich at gmail.com>



My image does not have any subdirectories. All i did to create it was:

# mkdir /mnt/rootfsSo the command *ls /mnt /mnt/boot* is invalid for me


----------
From: *ron minnich* <rminnich at gmail.com>
Date: Fri, Apr 10, 2009 at 10:58 PM
To: Ravishankar <cyberax82 at gmail.com>


of course. no problem. Now try booting that disk.

ron

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Fri, Apr 10, 2009 at 11:05 PM
To: ron minnich <rminnich at gmail.com>


boot  lost+found
ravionlinux:/home/ravi # ls /mnt/rootfs/boot/
vmlinuz*
filo> root (hd0)
filo> boot /vmlinuz
No kernel.
filo>
-- 

Norman Mailer<http://www.brainyquote.com/quotes/authors/n/norman_mailer.html>
- "Writing books is the closest men ever come to childbearing."
----------
From: *ron minnich* <rminnich at gmail.com>
Date: Fri, Apr 10, 2009 at 11:15 PM
To: Ravishankar <cyberax82 at gmail.com>


the parser is really, really stupid.

root (hd0)
kernel /vmlinuz
boot

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Fri, Apr 10, 2009 at 11:19 PM
To: ron minnich <rminnich at gmail.com>


I'm back to square one (see my orignal post [?])
*filo> root (hd0)
filo> kernel /vmlinuz
File not found.*
-- 

Andy Warhol <http://www.brainyquote.com/quotes/authors/a/andy_warhol.html>
- "I am a deeply superficial person."
----------
From: *ron minnich* <rminnich at gmail.com>
Date: Sat, Apr 11, 2009 at 12:20 AM
To: Ravishankar <cyberax82 at gmail.com>


You put it in boot. Try kernel /boot/vmlinuz
Ron
--
Sent from my mobile device
----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Sat, Apr 11, 2009 at 10:20 AM
To: ron minnich <rminnich at gmail.com>


That finally worked Ron! Thanks a lot for your patience :)

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....

Thanks once again.
-Ravi

----------
From: *ron minnich* <rminnich at gmail.com>
Date: Sat, Apr 11, 2009 at 10:43 AM
To: Ravishankar <cyberax82 at gmail.com>





Where did you use root=/dev/hda?

ron

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Sat, Apr 11, 2009 at 10:54 AM
To: ron minnich <rminnich at gmail.com>


As given in these <http://www.coreboot.org/FILO>
tutorials<http://www.coreboot.org/QEMU_Build_Tutorial>
;

1)filo: hda:/boot/vmlinuz root=/dev/hda initrd=/boot/initrd console=ttyS0
2)filo> kernel hdc:/GEEXBOX/boot/vmlinuz root=/dev/ram0 rw
init=linuxrc boot=cdrom installator

i had tried *filo>kernel /boot/vmlinuz root=/dev/hda initrd=/boot/initrd
console=ttyS0*

----------
From: *ron minnich* <rminnich at gmail.com>
Date: Sat, Apr 11, 2009 at 10:56 AM
To: Ravishankar <cyberax82 at gmail.com>


I'm sort of pushing you here :-)

so, think about this: you said root=/dev/hda. What program or piece of
software would look at that parameter? FILO? Or something else?

ron

----------
From: *Ravishankar* <cyberax82 at gmail.com>
Date: Sat, Apr 11, 2009 at 11:03 AM
To: ron minnich <rminnich at gmail.com>


I thougt the payload/bootloader(FILO) is the one that parses the parameters.

----------
From: *ron minnich* <rminnich at gmail.com>
Date: Sat, Apr 11, 2009 at 11:08 AM
To: Ravishankar <cyberax82 at gmail.com>


I had begun to realize that :-)

But consider this: what if FILO was parsing those parameters, and
linux changed in the future in some way? FILO would no longer be able
to parse those boot parameters correctly; still worse, it might change
them in some way that Linux could not comprehend.

Hence, it is essential that FILO not parse those parameters! They must
be passed uninterpreted to Linux.

Plus, while we might have to tell FILO one location about where to get
the kernel image, we might have to tell the kernel a different
location  about where to get the root file system. So it would be a
mistake for FILO to use the root=/dev/hda parameter to locate the
kernel file.

That is why the root parameter to filo and the root parameter to linux
are seperate, and also why FILO must not parse the boot parameters
that are there for Linux.

Thanks

ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090411/7a204edd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 325.png
Type: image/png
Size: 592 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090411/7a204edd/attachment.png>


More information about the coreboot mailing list