On Wed, Mar 7, 2012 at 6:32 PM, Avi Kivity <a...@redhat.com> wrote: > On 03/07/2012 03:59 PM, Dmitry Zamaruev wrote: >> Hi, >> >> I'm trying to emulate BIOS Flash chip (something Intel FWH compatible) >> on PC target (i386-softmmu) and to verify possibility of such >> emulation I first tried to use pflash_cfi02 example from PPC platform. > > So is Jordan (copied). > >> Trying to use if following way: >> in hw/pc.c in pc_memory_init() after bios.bin is loaded and mapped to ISA >> space: >> >> cpu_register_physical_memory(0x100000 - isa_bios_size, >> isa_bios_size, >> (bios_offset + bios_size - >> isa_bios_size) | IO_MEM_ROM); >> >> option_rom_offset = qemu_ram_alloc(NULL, "pc.rom", PC_ROM_SIZE); >> cpu_register_physical_memory(PC_ROM_MIN_VGA, PC_ROM_SIZE, >> option_rom_offset); >> >> /* map all the bios at the top of memory */ >> // cpu_register_physical_memory((uint32_t)(-bios_size), >> // bios_size, bios_offset | IO_MEM_ROM); >> >> Instead of mapping all the bios at the top of memory I'm using >> following piece of code to init pflash device and load bios into it: >> >> dinfo = drive_get(IF_PFLASH, 0, 0); >> if (dinfo) { >> bios_size = bdrv_getlength(dinfo->bdrv); >> bios_offset = qemu_ram_alloc(NULL, "fwh.bios", bios_size); > > You're using a really old version of qemu. Please use qemu.git instead, > the APIs have changed.
I'm using Q35 "version" from Isaku Yamahata, the only available version is 0.14.50. So I cannot use HEAD because Q35 support not in mainstream yet. But I will try this particular problem with HEAD to see if this approach works there. Thanks. wbr, Dmitry.