Skip to contentSkip to conversation

getting grub booting in qemu..

DISCUSSION Simon Kitching 2 participants 2 messages May 2, 2010

lore
Share & tools
lore
#0 lore raw

I'm trying to set up a qemu image for testing grub; see attached script. When I start qemu with the resulting image file, via "qemu raw.img" I get:

Booting from Hard Disk....
Welcome to Grub!

error: no such disk.
Entering rescue mode...
grub rescue> _

If I type
$root
I get back
Unknown command `hd0,1'

So it would seem that the MBR and embedded core.img are working well, but that core.img cannot find /boot/grub.

Any ideas why, given that $root appears to be correct? I've tried explicitly defining the disk in grub-mkimage with "--prefix=(hd0,1)/boot/grub", and confirmed with gdb that this is indeed being recognised, but it had no effect.

I have been trying to debug this by putting some print-statements in disk/i386/pc/biosdisk.c to show what disk is being accessed, but this code doesn't appear to be run.

How exactly is "kernel.img" built anyway? I've looked in the makefiles and can't see what source files kernel.img is made from. File genmk.rb perhaps has something to do with it, but I just don't understand..

And I see that in grub-mkimage there is something to do with qemu:
#elif defined(GRUB_MACHINE_QEMU)
....
Is this relevant or not?

Any ideas how I might debug this further?

Thanks,
Simon

#1 lore raw
Quoted 1 line

I'm trying to set up a qemu image for testing grub; see attached script=

=2E

Quoted 4 lines

When I start qemu with the resulting image file, via "qemu raw.img" I get:

=20

This is not a tech support list. But ok, you forgot to include either biosdisk or ata module

Quoted 12 lines

Booting from Hard Disk....
Welcome to Grub!

error: no such disk.
Entering rescue mode...
grub rescue> _

If I type
$root
I get back
Unknown command `hd0,1'

Quoted 6 lines

So it would seem that the MBR and embedded core.img are working well, but that core.img cannot find /boot/grub.

Any ideas why, given that $root appears to be correct? I've tried explicitly defining the disk in grub-mkimage with "--prefix=3D(hd0,1)/boot/grub", and confirmed with gdb that this is ind=

eed

Quoted 15 lines

being recognised, but it had no effect.

I have been trying to debug this by putting some print-statements in disk/i386/pc/biosdisk.c to show what disk is being accessed, but this code doesn't appear to be run.

How exactly is "kernel.img" built anyway? I've looked in the makefiles and can't see what source files kernel.img is made from. File genmk.rb perhaps has something to do with it, but I just don't understand..

And I see that in grub-mkimage there is something to do with qemu:

   #elif defined(GRUB_MACHINE_QEMU)
   ....

Is this relevant or not?

Quoted 7 lines

Any ideas how I might debug this further?

Thanks,
Simon

=20
-----------------------------------------------------------------------=

-

Quoted 6 lines

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
=20

--=20
Regards
Vladimir '=CF=86-coder/phcoder' Serbinenko