qemu-discuss
[Top][All Lists]
Advanced

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

[QEMU 7.2.0] Emulating custom peripheral designed for qemu 4.0.0


From: Fenix GDH
Subject: [QEMU 7.2.0] Emulating custom peripheral designed for qemu 4.0.0
Date: Thu, 30 Mar 2023 08:50:12 -0300

Hi all!

I am working on emulating some soho router firmwares, but most of them use SoCs not supported by qemu. I found the Firmguide, where the authors implemented some specific devices on QEMU 4.0.0 in order to emulate linux kernel. I'm trying to import these devices to the latest QEMU, but I got several compiling errors. 

This is a example for ar71xx_generic.c file:

In file included from /home/fenix/qemu-7.2.0/include/hw/qdev-core.h:8,
                 from /home/fenix/qemu-7.2.0/include/hw/sysbus.h:6,
                 from ../hw/mips/ar71xx_generic.c:7:
/home/fenix/qemu-7.2.0/include/qom/object.h:1314:56: note: expected ‘const char *’ but argument is of type ‘int’
 1314 | bool object_property_set_bool(Object *obj, const char *name,
      |                                            ~~~~~~~~~~~~^~~~
../hw/mips/ar71xx_generic.c:806:5: warning: implicit declaration of function ‘memory_region_allocate_system_memory’ [-Wimplicit-function-declaration]
  806 |     memory_region_allocate_system_memory(&s->ram, OBJECT(machine), "ram", machine->ram_size);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../hw/mips/ar71xx_generic.c:806:5: warning: nested extern declaration of ‘memory_region_allocate_system_memory’ [-Wnested-externs]
../hw/mips/ar71xx_generic.c:808:88: warning: implicit declaration of function ‘serial_hd’ [-Wimplicit-function-declaration]
  808 |     serial_mm_init(get_system_memory(), 0x18020000, 0x2, s->cpu->env.irq[0x6], 115200, serial_hd(0), DEVICE_BIG_ENDIAN);
      |                                                                                        ^~~~~~~~~
../hw/mips/ar71xx_generic.c:808:88: warning: nested extern declaration of ‘serial_hd’ [-Wnested-externs]
../hw/mips/ar71xx_generic.c:808:88: warning: passing argument 6 of ‘serial_mm_init’ makes pointer from integer without a cast [-Wint-conversion]
  808 |     serial_mm_init(get_system_memory(), 0x18020000, 0x2, s->cpu->env.irq[0x6], 115200, serial_hd(0), DEVICE_BIG_ENDIAN);
      |                                                                                        ^~~~~~~~~~~~
      |                                                                                        |
      |                                                                                        int
In file included from ../hw/mips/ar71xx_generic.c:13:
/home/fenix/qemu-7.2.0/include/hw/char/serial.h:104:11: note: expected ‘Chardev *’ {aka ‘struct Chardev *’} but argument is of type ‘int’
  104 | SerialMM *serial_mm_init(MemoryRegion *address_space,
      |           ^~~~~~~~~~~~~~
../hw/mips/ar71xx_generic.c:851:5: warning: implicit declaration of function ‘mips_load_kernel’ [-Wimplicit-function-declaration]
  851 |     mips_load_kernel(MIPS_CPU(first_cpu), &binfo);
      |     ^~~~~~~~~~~~~~~~
../hw/mips/ar71xx_generic.c:851:5: warning: nested extern declaration of ‘mips_load_kernel’ [-Wnested-externs]
../hw/mips/ar71xx_generic.c:800:34: warning: unused variable ‘binfo’ [-Wunused-variable]
  800 |     static struct mips_boot_info binfo;


I noticed some functions syntax changed from version 4.0.0 to 7.2.0. Now I'm trying to parse it manually, but is there any documentation that can help this migration?


Thanks

reply via email to

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