Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2016 11:25:03 -0800
From:      Oleksandr Tymoshenko <gonzo@bluezbox.com>
To:        Jason Harmening <jason.harmening@gmail.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: loading 'VIRT' kernel in qemu
Message-ID:  <BA5B89E5-9187-4BD3-A036-554F3CF6F671@bluezbox.com>
In-Reply-To: <CAM=8qa=pSRphmsbvy1L7fgPFDDK4xhozfrr3tj5fojd8w7fFjg@mail.gmail.com>
References:  <CAM=8qa=pSRphmsbvy1L7fgPFDDK4xhozfrr3tj5fojd8w7fFjg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Dec 27, 2016, at 1:48 PM, Jason Harmening =
<jason.harmening@gmail.com> wrote:
>=20
> Hi everyone,
>=20
> I'm making some tweaks to the armv6 pmap to mirror some recent i386
> changes.  I don't have arm hardware readily available, so I thought =
I'd
> give qemu a whirl instead of asking other people to test my changes =
for
> me.  Since I need SMP but don't need any specific peripheral hw, the =
'VIRT'
> kernel seems like my best bet.
>=20
> I've successfully booted mips[64] under qemu, so naively starting out =
w/
> the same steps I use for mips:
>=20
> 1). build armv6 world and VIRT kernel, install world to temp directory
> 2). use makefs(8) to build a 4GB (little endian) fs image from temp =
dir
> 3). Run qemu:
> qemu-system-arm -M virt -kernel <VIRT kernel binary> -hda <fs image>
> -nographic -m 1024
>=20
> ...fails immediately:
> qemu: fatal: Trying to execute code outside RAM or ROM at 0xc1000100
>=20
> R00=3D00000000 R01=3D00000000 R02=3D00000000 R03=3D00000000
> R04=3D00000000 R05=3D00000000 R06=3D00000000 R07=3D00000000
> R08=3D00000000 R09=3D00000000 R10=3D00000000 R11=3D00000000
> R12=3D00000000 R13=3D00000000 R14=3D00000000 R15=3Dc1000100
>=20
> hmm, looks pretty close to KERNVIRTADDR.
>=20
> Most online docs for qemu-system-arm seem to assume a prebuilt linux =
kernel
> and initrd, the rest are...fragmented-to-nonexistent.  I've seen a few
> hints that I might need to wrap the kernel image up along w/ u-boot, =
but
> the u-boot images seem to be very SoC-specific.
>=20
> Any help would be much appreciated, sorry for the n00b question.

Hi Jason,

It looks like for VIRT kernel is supposed to be used with UEFI. At least
this part of NanoBSD sources hints at it:
=
http://sources.freebsd.org/HEAD/src/tools/tools/nanobsd/embedded/qemu-armv=
7.cfg =
<http://sources.freebsd.org/HEAD/src/tools/tools/nanobsd/embedded/qemu-arm=
v7.cfg>
You can probably use NanoBSD-generated image for your experiments

VERSATILEPB kernel used to work with QEMU but I=E2=80=99ve just tried to =
boot
it and it doesn=E2=80=99t seem to work. Will need some time to track =
down what=E2=80=99s wrong
with it. VERSATILEPB kernel needs a wrapper to make it act as a ROM
image. Wrapper and command to run it you can find here:
=
https://github.com/freebsd/crochet/blob/master/board/VersatilePB/setup.sh =
<https://github.com/freebsd/crochet/blob/master/board/VersatilePB/setup.sh=
>

=20=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BA5B89E5-9187-4BD3-A036-554F3CF6F671>