qemu and grub2 rescue floppy don't get along

Reported by Cole Robinson on 2013-02-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Undecided
Unassigned

Bug Description

With qemu.git as of Feb 11 2013:

# grub2-mkrescue -o test.img
# ./x86_64-softmmu/qemu-system-x86_64 -fda test.img -curses

SeaBIOS (version ?-20130206_051134-ccnode4)

iPXE v1.0.0-591-g7aee315
iPXE (http://ipxe.org) 00:03.0 C900 PCI2.10 PnP PMM+07FC7EC0+07F87EC0 C900

Booting from Hard Disk...
Boot failed: could not read the boot disk

Booting from Floppy...
GRUB loading....
Welcome to GRUB!

error: attempt to read or write outside of disk `fd0'.
Entering rescue mode...
grub rescue>

Expected results: grub header and a normal usable grub prompt like 'grub>'

This was originally reported against qemu 0.15 in Fedora 16 at:

https://bugzilla.redhat.com/show_bug.cgi?id=784537

Some more info from that bug:

0) The images that grub2-mkrescue creates are odd mixtures of ISO images and disk images:
    file -r -k test.img
    test.img: # ISO 9660 CD-ROM filesystem data 'ISOIMAGE ' (bootable)
    - x86 boot sector; partition 1: ID=0xcd, active, starthead 0, startsector 1, 4455 sectors, code offset 0x63 DOS executable (COM), boot code

1) The test image I use has a 2281472 byte size. If I append that with zeroes to 2880 KB (2949120 bytes) then I get the expected results. So there's a workaround. But I don't think it's an obvious workaround.

2) It's debatable whether this is a bug. If it's considered a bug, I'm not sure whether qemu and/or grub2 is to blame. Should qemu (silently) handle (floppy) disk image between 1440 KB and 2880 KB as if they actually were 2880 KB in size? Or should grub2, if possible, zero pad the images it creates to (in this case) a 2880 KB size?

3) Please note that there seems to be little one can do to leave "grub rescue" mode. Ie, "insmod normal" will fail too:
    grub rescue> insmod normal
    error: attempt to read or write outside of disk `fd0'.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers