Adding John Snow (IDE maintainer in QEMU)

On 11/10/15 17:55, Mark Rutland wrote:
> I've been trying to test an EFI application on x86_64 using Ubuntu 14.04's 
> QEMU
> 2.0.0. I have a directory 'foo' containing the application, and I get QEMU to
> create a virtual FAT device:
> 
> $ qemu-system-x86_64 -nographic \
>       -bios src/edk2/Build/OvmfX64/RELEASE_GCC48/FV/OVMF.fd \
>       -hda fat:foo
> 
> However, I'm unable to access the root filesystem:
> 
> UEFI Interactive Shell v2.1
> EDK II
> UEFI v2.50 (EDK II, 0x00010000)
> Mapping table
>       FS0: Alias(s):HD7a1:;BLK3:
>           PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0)/HD(1,MBR,0xBE1AFDFA,0x3F,0xFBFC1)
>      BLK2: Alias(s):
>           PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0)
>      BLK4: Alias(s):
>           PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0)
>      BLK0: Alias(s):
>           PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0)
>      BLK1: Alias(s):
>           PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1)
> Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
> Shell> fs0:
> FS0:\> dir
> ls: File Not Found - 'FS0:\'
> 
> With git, I bisected this down to the commit "OvmfPkg: enable SATA 
> controller".
> 
> Any ideas as to what the problem could be?
> 
> I don't have a newer qemu-system-x86_64 lying around, so I haven't been able 
> to
> test with that.

I just tested the above, with upstream QEMU at git ce278618, and OVMF at
edk2 git 07c70785. It works for me.

Can you please retest with upstream QEMU? As far as I understand, many
IDE emulation fixes have gone into QEMU since 2.0.0. Some of those were
directly related to the SATA enablement in OVMF.

I'm not sure if you are used to building QEMU; one set of commands that
works for me (although building in a separate build directory is
recommended, officially), is:

  git clone git://git.qemu.org/qemu.git
  cd qemu
  ./configure --target-list=x86_64-softmmu --prefix=$PREFIX
  nice make -j $N
  make install

  $PREFIX/bin/qemu-system-x86_64 ...

In general I'd recommend using virtio-blk over IDE for such testing
anyway. If you'd like to stick with the Ubuntu-shipped binary, please
try to replace the "-hda ..." shorthand with the following shorthand:

  -drive if=virtio,file=fat:blargh

For completeness, let me reformat your command line the way I'd write it:

  cp .../OVMF_VARS.fd my-vars.fd

  $PREFIX/bin/qemu-system-x86_64 \
    -machine pc,accel=kvm \
    -net none \
    -nographic \
    \
    -drive if=pflash,readonly,file=.../OVMF_CODE.fd,format=raw \
    -drive if=pflash,file=my-vars.fd,format=raw \
    \
    -drive if=none,file=fat:foo,id=drive0,format=raw \
    -device virtio-blk-pci,drive=drive0 \
    \
    -debugcon file:ovmf.log \
    -global isa-debugcon.iobase=0x402

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to