Currently we support 386, amd64, arm64 and mips (kinda). It is theoretically possible to also do arm32 using qemu's raspi machine emulation but naive attempts have failed.
I was attempting an invocation like so:
qemu-system-arm -machine type=raspi2b -m 1024 -drive file=9front.pi.img,format=raw -serial stdio -kernel 9pi2
So far what I've learned is:
you must pass a -kernel to the VM, it will not load a kernel from the drive image
by attaching gdb to qemu I could see that it appears to start execution at PC 0x00, this is where it puts -kernel (seemingly)
the 9front pi kernels expect to be placed in high memory, the loadaddr set in the bcm mkfile is 0x80008000
it seems to be possible to tell qemu to map the file elsewhere using -device loader
With that said I attempted tinkering with the loadaddr to make it match the default, but there is likely more that is needed then just that. I also attempted to force it to load the kernel where the kernel expects to be placed:
I also tried addr=0x80008000 and that also seemed to fail. When I attached gdb I was unable to access the instructions at that address, so there is something I am not quite understanding here.
Currently we support 386, amd64, arm64 and mips (kinda). It is theoretically possible to also do arm32 using qemu's raspi machine emulation but naive attempts have failed.
I was attempting an invocation like so:
qemu-system-arm -machine type=raspi2b -m 1024 -drive file=9front.pi.img,format=raw -serial stdio -kernel 9pi2
So far what I've learned is:
loadaddr
set in the bcm mkfile is0x80008000
-device loader
With that said I attempted tinkering with the
loadaddr
to make it match the default, but there is likely more that is needed then just that. I also attempted to force it to load the kernel where the kernel expects to be placed:qemu-system-arm -machine type=raspi2b -m 1024 -drive file=9front.pi.img,format=raw -serial stdio -device loader,file=./9pi2,addr=0x80000000,cpu-num=0,force-raw=on
I also tried
addr=0x80008000
and that also seemed to fail. When I attached gdb I was unable to access the instructions at that address, so there is something I am not quite understanding here.