Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2020 21:41:33 +0200
From:      Gordon Bergling <gbergling@googlemail.com>
To:        Oleksandr Tymoshenko <gonzo@bluezbox.com>
Cc:        trasz@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: Building arm64 image for booting in qemu
Message-ID:  <20200521194133.GA70359@lion.0xfce3.net>
In-Reply-To: <20200521022956.GA32686@bluezbox.com>
References:  <20200520165024.GA2695@lion.0xfce3.net> <20200521022956.GA32686@bluezbox.com>

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

thanks for your reply and the very useful shellscript you have provided. I have
used it as base for my scripts and I was finally be able to build a 
bootable image.

@trasz, I took some very valuable ideas from build script that the FreeBSD CI
is using, but I wasn't be able to boot my image without an external DTB.
I'll have some ideas why, but before the coming weekend I won't be able
to try them out.

Once I have my build script ready, I'll make a new entry in the FreeBSD
wiki and post my build and boot scripts there. So, that the outdated
build script may can be replaced.

Cheers,

Gordon

On Wed, May 20, 2020 at 07:29:56PM -0700, Oleksandr Tymoshenko wrote:
> Gordon Bergling via freebsd-hackers (freebsd-hackers@freebsd.org) wrote:
> > I am currently try to setup a crossbuild for arm64 to test some 
> > local changes. I use the following steps to create the image 
> > after crossbuilding arm64 on amd64. These steps were taken from
> > the arm64_build.sh found at the FreeBSD wiki.
> 
> I believe that script is very outdated in several areas. It refers
> to boot1.efifat which is not boot1.efi but a FAT image that contains
> boot1.efi as EFI\BOOT\bootaa64.efi. Also current version of u-boot-qemu
> looks for DTB file which is not provided by the script (probably it was
> built into u-boot before).
> 
> I think the easiest way to run FreeBSD on quemu/arm64 these days is by using
> UEFI. I was able to build bootable image by hacking together your script
> and pieces from release/ directory of the src tree:
> 
> https://people.freebsd.org/~gonzo/build-qemu-aarch4-img.sh
> 
> It's not very clean but it should give you an idea of what's required.
> The start command for qemu I used:
> 
> BIOS=QEMU_EFI.fd
> qemu-system-aarch64 -m 4096M -cpu cortex-a57 -M virt  \
>         -bios $BIOS \
>         -serial mon:stdio -nographic \
>         -drive if=none,file=/src/FreeBSD/tftproot/disk.img,id=hd0 \
>         -device virtio-blk-device,drive=hd0 \
>         -device virtio-net-device,netdev=net0 \
>         -netdev user,id=net0
> 
> QEMU_EFI.fd was downloaded from 
> http://releases.linaro.org/components/kernel/uefi-linaro/16.02/release/qemu64/QEMU_EFI.fd
> 
> -- 
> gonzo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200521194133.GA70359>