[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Booting efi and bios with one binary.

On 2/26/15, 1:40 AM, "Ian Campbell" <ian.campbell@xxxxxxxxxx> wrote:

>On Wed, 2015-02-25 at 15:21 -0800, Chris Takemura wrote:
>> Hi everyone,
>> My scenario involves virtualizing a variety of Windows machines, some
>> of which have been installed with pure EFI bootloaders, some of which
>> use BIOS.  I'm on Xen 4.4.1 with upstream QEMU 2.1.0, using xl.  I can
>> boot EFI by setting "bios='ovmf'" or BIOS by setting "bios='seabios'",
>> but not both.  I'd really like to be able to use OVMF with the seabios
>> CSM to automatically boot whichever is appropriate.
>> Here's the approach I've tried, based on instructions that I've found
>> from the internet:
>>  * build normally (modify Config.mk, configure --enable-ovmf, make
>> dist)
>>  * build seabios csm in tools/firmware/seabios-dir
>>  * copy bios.bin into ovmf-dir/OvmfPkg/Csm/Csm16/Csm16.bin.
>Have you seen http://www.seabios.org/Build_overview? It seems to suggest
>that the output of the Seabios build in CSM mode is out/Csm16.bin, not

Sorry, I forgot to mention that, with the version of the tree that I have,
the output is bios.bin.  There's a later commit that changes that.  I
hadn't really been adventurous enough to change the seabios upstream tag.
I've since tried that, and the results haven't changed.  (Although I am
now using out/Csm16.bin)

>>  * clean seabios-dir; reconfigure for xen/qemu directly.
>>  * rebuild seabios
>>  * modify ovmf-dir/Makefile to include -D ENABLE_CSM
>>  * build ovmf
>>  * build hvmloader
>> I *think* that hvmloader includes the ovmf and seabios images within
>> it.  Is that correct?  Is there any way I can check that the seabios
>> csm is included?  Is it getting used?
>I've no idea how this CSM stuff works, but would it not be expected that
>Csm16.bin would be baked into the ovmf image somehow, and then that ovmf
>image baked into hvmloader? (that wiki page seems to suggest that).
>I'd be very surprised if ovmf was able to use the separate seabios baked
>into hvmloader, it just has no way of even knowing it is there.
>hvmloader just copies the appropriate blob (per BIOS selection) into the
>right place in RAM and then jumps to it, so any other blob is
>effectively lost at that point.

Great.  That's my understanding also.  I would definitely expect that an
hvmloader with functional CSM wouldn't need the seabios blob.  What I'm
really wondering is if there's any way to check that the CSM module exists
in the OVMF output -- the doc refers to tools to extract the blob, but has
no indication of what they are.

>Other than the above filename thing, perhaps as an experiment try
>putting a seabios CSM image into the ESP (EFI System Partition) of a
>guest and loading it as an EFI application from the EFI shell (or adding
>it to boot manager)? Once you have that aspect working then figure out
>separately how to embed the CSM (if that's even possible, maybe ESP is
>the right answer?).

Hmm.  I've tried that now, and the firmware doesn't acknowledge the CSM
file as executable. ("Error reported: Unsupported" when I try.) It does
load a grub efi binary successfully.  Is the CSM blob actually supposed to
be an EFI executable?  That would make sense, but I don't know anything
about it.

>If you do figure this out then it would be very appreciated if you could
>document it at http://wiki.xen.org/wiki/OVMF [0]. Eventually I'd really
>like to embed this stuff into the regular build (and perhaps make OVMF
>w/ SeaBIOS CSM available the default BIOS, and perhaps deprecate bare
>SeaBIOS with time). If you fancy doing some xen.git Makefile hacking let
>me know ;-)

If I figure this out, I'll be as surprised as anyone.

>[0] Due to a sustained spam attack wiki editor rights need to be
>manually granted, once you've created a wiki account either drop me a
>line or fill in the form at [1] and we'll set the bit on your account.
>>   Do I need a different source tree entirely?  (I'm just using the
>> default git repos that the xen 4.4.1 makefile refers to.)  Is my
>> understanding of how CSM is supposed to work incorrect?
>> Thanks,
>> -- 
>> chris
>> _______________________________________________
>> Xen-users mailing list
>> Xen-users@xxxxxxxxxxxxx
>> http://lists.xen.org/xen-users

Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.