On Fri, 7 Apr 2023 at 11:41, Huang Canming <huangcm...@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