[Top][All Lists]

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

Re: how to add a new machine?

From: Peter Maydell
Subject: Re: how to add a new machine?
Date: Wed, 17 Feb 2021 11:12:01 +0000

On Wed, 17 Feb 2021 at 09:39, <ckim@etri.re.kr> wrote:
> Hello, very clever qemu developers,
> For our SoC development, I decided to make our new machine to play with. 
> (It’ll be a long term job)
> Let’s call the new machine ababa here.
> I thought just copying a machine will be easy, so I added these files below.
> l  hw/arm/ababa.c
> l  include/hw/arm/ababa.h
> l  hw/arm/ababa-acpi-build.c

This suggests that you're modifying the 'virt' board. That is not
a good template to use for a model of an SoC, because the virt board
is purely virtual, and has no SoC at all, and also has a lot of
complicated stuff related to ACPI, to dtb generation, and to
versioned machine types, which a simple "model of real hardware"
does not require. The aspeed boards are probably a good example
of a recently-implemented well-maintained SoC based set of boards.

> and modified these files to add that machine ababa during the build.
> l  default-configs/arm-softmmu.mak,

> l  hw/arm/Kconfig

> l  hw/arm/Makefile.objs

This suggests that you're modifying an old version of QEMU.
If you're trying to do development like adding a new board
model, you should usually be working with the head-of-QEMU-git.

> So at least it compiles ok. But when I tried running an example kernel (which 
> boots ok on ‘virt’) on the ‘ababa’ machine,
> “Qemu gave me this error message. “qemu-system-aarch64 -M ababa : unsupported 
> machine type.”

This means that either (a) you failed to correctly modify
the build system to actually build your ababa.c file, or
(b) your ababa.c file didn't actually register a machine type
with the right name. The -M option simply looks for every
registered subclass of TYPE_MACHINE, so you don't need to
explicitly add your new machine to any list.

-- PMM

reply via email to

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