Re: [edk2] Xen OVMF early discussions

Subject: Re: [edk2] Xen OVMF early discussions

From: Bei Guan <gbtju85@gmail.com>

To: Andrei Warkentin <andreiw@motorola.com>

Date: 2011-05-28 23:20:59



2011/5/28 Andrei Warkentin <andreiw@motorola.com>
Hi Bei,

On Fri, May 27, 2011 at 2:09 PM, Andrei Warkentin <andreiw@motorola.com> wrote:
> On Fri, May 27, 2011 at 9:58 AM, Bei Guan <gbtju85@gmail.com> wrote:
>>
>>
>> 2011/5/27 Bei Guan <gbtju85@gmail.com>
>>>
>>>
>>> 2011/5/26 Andrei Warkentin <andreiw@motorola.com>
>>>>
>>>> On Thu, May 26, 2011 at 8:45 AM, Sun, Rui <rui.sun@intel.com> wrote:
>>>> > Hi, Bei,
>>>> >
>>>> >
>>>> >
>>>> > It seems that the PCI bus driver does not create a PCI device handle
>>>> > for the
>>>> > IDE controller because it failed to allocated IO resources for the
>>>> > controller. Does the PlatformPeim for OVMF on XEN reports the IO
>>>> > resource
>>>> > like what is done in the PlatformPeim for OVMF on QEMU?
>>>> >
>>>> >
>>>> >
>>>> > //
>>>> >
>>>> > // Add PCI IO Port space available for PCI resource allocations.
>>>> >
>>>> > //
>>>> >
>>>> > BuildResourceDescriptorHob (
>>>> >
>>>> > EFI_RESOURCE_IO,
>>>> >
>>>> > EFI_RESOURCE_ATTRIBUTE_PRESENT |
>>>> >
>>>> > EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
>>>> >
>>>> > 0x1000,
>>>> >
>>>> > 0xF000
>>>> >
>>>> > );
>>>> >
>>>>
>>>> Yes, but the range is smaller - [0xC000, 0x10000). That should still
>>>> be sufficient, since these numbers came out of Xen BIOS setup code.
>>>
>>> Hi Andrei,
>>> I have changed the BuildResourceDescriptorHob on Xen to
>>> BuildResourceDescriptorHob (
>>> EFI_RESOURCE_IO,
>>> EFI_RESOURCE_ATTRIBUTE_PRESENT |
>>> EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
>>> 0xC000,
>>> 0x3000
>>> );
>>
>> I have tried several other values to replace 0x3000, such as 0x0100, 0x1000,
>> 0x1C00, 0x2000 and 0x2C00.
>> It seems thatOVMF on Xen can work well,when the value of "ResourceLength"
>> is between 0x1000 and 0x3000. So, I really want to know what is this value
>> dependent on?
>>
>
> Ah, how embarrassing for me. When I wrote the code to create the
> Xen-specific code to build the resource descriptor hob, I put down
> 0xC000, 0x10000 because I thought it was a range. Since the third
> value is a length, it should be 0x4000.
>
> Can you try -
>
> BuildResourceDescriptorHob (
> EFI_RESOURCE_IO,
> EFI_RESOURCE_ATTRIBUTE_PRESENT |
> EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
> 0xC000,
> 0x4000
> );
>
> The I/O address space is 16-bit. Everything below 0xC000 on Xen is
> used by assigned devices, and everything above can be assigned to PCI
> devices.
>
> A
>

Glad to see that you got IDE is working. Can you attach a disk with a
FAT partition to Xen and see if you can read files? Can you read
floppy images?
I am not sure whether Xen has this kind of options that can attach a FAT partion or a floppy image. I think I need to make an investigation. Have you ever used this kind of options in hvm config file before?

For OVMF on QEMU, how to attach a floppy images? I use "-fda /root/floppy.img", but it seems doesn't work. When I try to access to the floppy in EFI shell, there is an error like this

Shell:\> blk0:
blk0:\> ls
ls/dir: Cannot open current directory - Not Found


Thanks,
Bei Guan



A