On 09/30/14 19:22, Gabriel L. Somlo wrote:
> On Mon, Sep 29, 2014 at 01:45:09PM +0200, Laszlo Ersek wrote:
>>> bin/qemu-system-x86_64 -enable-kvm -m 2048 -cpu core2duo -smp 4,cores=2 \
>>> -machine q35 -device ide-drive,bus=ide.2,drive=CD \
>>> -drive id=CD,if=none,snapshot=on,file=Fedora-Live-Desktop-x86_64-20-1.iso
>>> \
>>> -device isa-applesmc,osk="<apple smc magic string>" \
>>> -netdev user,id=usr0 -device e1000-82545em,netdev=usr0,id=vnet0 \
>>> -usb -device usb-kbd -device usb-mouse \
>>> -monitor stdio \
>>> [ -bios OVMF.fd ]
>>
>> DO NOT USE OVMF WITH -bios.
>>
>> It perpetuates a bad practice that was unavoidable in the beginning, but
>> is entirely unnecessary nowadays. If you're willing to type just one
>> word, type "-pflash". Please.
>
> So, FTR, right now -pflash works with fedora, but with OS X (requires
> all of Reza's patches) I get an apple but no spinning boot circle
> thingie on the screen, and it hangs indefinitely.
Have you installed OS X from scratch, using -pflash? If the installation
sets some non-volatile UEFI variables, then when you installed with
-bios (and rebooted immediately), then those variables got written to
the NvVars file, and now they are not found with -pflash (because your
varstore, embedded in OVMF.fd, is empty).
With -bios, the NvVars file based variable emulation kicks in, which
seems to work most of the time, but in fact it breaks in subtle ways.
With -pflash, things should just work, but you can't switch back & forth
between -bios and -pflash for the same VM.
In addition, for -pflash, when you rebuild OVMF, the unified OVMF.fd
file will again include an empty variable store, which will cause your
VM to lose its variables (assuming you want the VM to run the fresh
binary). For this reason, the build output now provides two files beyond
OVMF.fd, OVMF_CODE.fd and OVMF_VARS.fd. The first is the OVMF binary,
while the second is the empty variable store *template*.
The by-the-book way to run OVMF is then:
(1) create a VM-private copy of the empty varstore template, for the VM:
cp .../OVMF_VARS.fd MyGuestsVarstore.fd
(2) pass the following flags to qemu *instead of* -bios; all the time,
for installation of the VM and all later startups:
-drive if=pflash,format=raw,unit=0,readonly,file=.../OVMF_CODE.fd \
-drive if=pflash,format=raw,unit=1,file=MyGuestsVarstore.fd \
This way you can upgrade (rebuild) OVMF_CODE.fd as frequently as you
want, and the VM's own varstore will remain intact, and (unlike with
-bios / the NvVars file) variables won't break in subtle ways.
This is complex and messy and undocumented (for now), which is why
upstream libvirt (@ commit 3a3c378) & virt-manager (@ commit 3e5b61d)
automate it for you.
> "-bios OVMF.fd" works just fine with both. I still haven't figured out
> how to pass a "-v" to OS X via OVMF, so I can see verbose text-mode boot
> messages scroll by for extra clues. Reza, any idea how I'd be able to
> do that ?
- change PcdDebugPrintErrorLevel to 0x8040004F in the *.DSC files
(enabling EFI_D_VERBOSE messages)
- change MAX_DEBUG_MESSAGE_LENGTH to 0x200 in
"OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c"
- uncomment '%define DEBUG' in "OvmfPkg/QemuVideoDxe/VbeShim.asm", and
re-run "OvmfPkg/QemuVideoDxe/VbeShim.sh"
- rebuild OVMF
- pass the following flags to qemu:
-debugcon file:ovmf.debug.log \
-global isa-debugcon.iobase=0x402
(Some of these are documented in the OvmfPkg/README file.)
Simple, isn't it? :)
Thanks,
Laszlo
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel