qemu-discuss
[Top][All Lists]
Advanced

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

Re: How to run different firmware in a machine with 2 cpu?


From: Huang Canming
Subject: Re: How to run different firmware in a machine with 2 cpu?
Date: Sat, 8 Apr 2023 00:05:29 +0800

Sorry for the wrong cmd. It'a typo after I edit the sample command.
my command is: ./qemu-system-arm -M mymachine -smp cpus=2 -kernel test1.elf -bios test2.elf -serial stdio -serial tcp::5678,server=on,wait=off
which use 'kernel' and "bios" to load different firmwares to the 2 cpus.

You should only call armv7m_load_kernel() once, even if there
is more than one CPU in the system.
So I need to use  generic loader to load file into cpu and then do cpu reset by myself(which was done in armv7m_load_kernel).
Thank you. I will try it.

I have a few further question:
in such cases, do I need a second sysbus? or can the 2 cpus use the same sysbus?
and why the armv7m_load_kernel can only be called once? 

Thank you for your time.

Peter Maydell <peter.maydell@linaro.org> 于2023年4月7日周五 23:22写道:
On Fri, 7 Apr 2023 at 11:41, Huang Canming <huangcmzzk@gmail.com> wrote:
>
> hi, members.
>
> I'm trying to model a custom machine which has 2 cpus. Each cpu has its own ram/rom.
>
> for now, I have create a different MemoryRegion for the 2 cpu.
>
> I want that the 2 cpu could run differnt firmware, so I use
>
> armv7m_load_kernel(ARM_CPU(cpu1),machine->firmware,0,0x10000)
> armv7m_load_kernel(ARM_CPU(cpu2),machine->kernel_filename,0,0x10000)

You should only call armv7m_load_kernel() once, even if there
is more than one CPU in the system.

If you want to do something more complex than "just load
one file", then look at the "generic loader", which will
allow you to specifically say "load this ELF file into
the address space as seen by this particular CPU".
https://www.qemu.org/docs/master/system/generic-loader.html

> ./qemu-system-arm -M mymachine -smp cpus=2 -kernel test1.elf -test2.elf -serial stdio -serial tcp::5678,server=on,wait=off

This command line doesn't make sense and I'm surprised it
didn't generate an error, because "-test2.elf" isn't a valid option.

thanks
-- PMM

reply via email to

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