How to use our stock armv7-RPI2 images with QEMU?

Warner Losh imp at bsdimp.com
Tue Dec 19 21:36:20 UTC 2017


On Dec 19, 2017 9:58 AM, "Sylvain Garrigues" <sylgar at gmail.com> wrote:

Hello,

> Le 18 déc. 2017 à 22:59, Warner Losh <imp at bsdimp.com> a écrit :
>
>> On Sat, Dec 16, 2017 at 8:32 AM, Alexey Dokuchaev <danfe at nsu.ru> wrote:
>>
>> Hi there,
>>
>> I've noticed (per qemu-system-arm -machine help) that it claims to
support
>> Raspberry Pi 2 (raspi2), so I wanted to boot one of our stock armv7-RPI2
>> images, but did not find recipe at https://wiki.freebsd.org/QemuRecipes,
>> and my FreeBSD/arm knowledge is lacking.
>>
>> Basically I look for a fast way to setup arm6/7 VM to do some ports work.
>>
>> Could someone give me a hand here, and possibly update that wiki page?
>> (It covers arm64, but not arm).  Thanks,
>>
>
> OK. The answer is "It's complicated" and I'm not sure anybody has actually
> done it recently.

The trick that make it work for me is to recompile qemu with one
modification: change KERNEL_LOAD_ADDR to 0x100000 instead of 0x10000 in
hw/arm/boot.c

Then you can boot the GENERIC kernel with the -kernel kernel.bin option and
you may attach the RPI2 snapshot to the VM with the -sd command.

You may have to type the boot root fs to mount it at the end of the kernel
initialization. Just list the available partitions and adjust.

It works pretty well, you even have the RPI framebuffer working.


Any chance the uboot image could be used for the kernel?

Warner


More information about the freebsd-arm mailing list