qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 1/6] Use IO port for qemu<->guest BIOS commun


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH v3 1/6] Use IO port for qemu<->guest BIOS communication.
Date: Sat, 30 Aug 2008 22:57:34 +0300

On 8/29/08, Gleb Natapov <address@hidden> wrote:
> On Thu, Aug 28, 2008 at 09:04:11PM +0300, Blue Swirl wrote:
>  > On 8/28/08, Gleb Natapov <address@hidden> wrote:
>  > >  +    fw_cfg_add(fw_cfg, FW_CFG_ID, (uint8_t *)&bios_cfg_id,
>  > >  +               sizeof(bios_cfg_id));
>  >
>  > On second thought, this is in host byte order, which is not a good idea.
>  >
>
> Is there some function to convert from host byte order to target byte
>  order?

I made an updated version of the patch 1/6, with explicit little
endian conversions. I'm not very happy with that. Another way would be
to add functions just to put different size numbers into device and
they would hide the conversion.

The second patch (after 6/6) adds keys for ram size, nographic flag,
number of CPUs and machine ID. I noticed that the other fields like
preloaded kernel location, initrd and command line should not be in
read-only storage so that BIOS can clear them and they will not be
valid after next reset. We could add a writable part to the
configuration device or a way to delete some entries but I think NVRAM
variables could be used instead.

Then I made a patch that takes the new device into use on
OpenBIOS/Sparc64. I found some bugs in the implementation, save and
load were wrong and FWCfgEntry.data should be const. The prototypes
with target_phys_addr_t cause compile failure on OpenBIOS, so
protecting them with something else than __ASSEMBLY__ should be added.
Maybe a PCI bridge or something between CPU and the device should do
byte swapping for outw.

But all in all, it seems to work. Sparc64 boots, UUID gets printed
correctly and added to OF tree:

OpenBIOS for Sparc64
Initializing PCI devices...
ide0: [io ports 0x1f0-0x1f7,0x3f6]
ide1: [io ports 0x170-0x177,0x376]
    drive0 [ATAPI cdrom]: QEMU DVD-ROM
floppy_init
FDC is a S82078B
floppy_reset
floppy_motor_off
SENSEI 20 00
status = 80, reply_buffer= 20 0
fdc_specify
FD_SPECIFY(c1, 11)
set_drive status = 80, new_dor = 10
floppy_recalibrate
fdc_state.version = 0062
Configuration device id QEMU version 1
kernel addr 404000 size 0
CPUs: 1 x SUNW,UltraSPARC-II
UUID: 10000000-2000-3000-4000-500000000000

No disk found.
Welcome to OpenBIOS v1.0RC1 built on Aug 30 2008 15:58
  Type 'help' for detailed information

[sparc64] Booting file 'disk' with parameters ''

0 > cd /  ok
0 > .properties
name                      "OpenBiosTeam,OpenBIOS"
#address-cells            2
#size-cells               2
compatible                "sun4u"
uuid                      -- 10 : 10 0 0 0 20 0 30 0 40 0 50 0 0 0 0 0
idprom                    -- 20 : 1 80 52 54 0 12 34 56 0 0 0 0 0 0 0
f7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
clock-frequency           1dcd6500
 ok

Attachment: new_fw_abi.diff
Description: plain/text

Attachment: fw_cfg_add_common_keys.diff
Description: plain/text

Attachment: openbios_new_fw_abi.diff
Description: plain/text


reply via email to

[Prev in Thread] Current Thread [Next in Thread]