From owner-freebsd-hackers@freebsd.org Thu May 21 02:30:05 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23CF52FD786 for ; Thu, 21 May 2020 02:30:05 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49SD9S0yJsz4BtJ for ; Thu, 21 May 2020 02:30:03 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92 (FreeBSD)) (envelope-from ) id 1jbay4-0008kx-Sm; Wed, 20 May 2020 19:29:57 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id 04L2Tu02033662; Wed, 20 May 2020 19:29:56 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Wed, 20 May 2020 19:29:56 -0700 From: Oleksandr Tymoshenko To: Gordon Bergling Cc: freebsd-hackers@freebsd.org Subject: Re: Building arm64 image for booting in qemu Message-ID: <20200521022956.GA32686@bluezbox.com> References: <20200520165024.GA2695@lion.0xfce3.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200520165024.GA2695@lion.0xfce3.net> X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) User-Agent: Mutt/1.12.1 (2019-06-15) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Gordon Bergling via freebsd-hackers (freebsd-hackers@freebsd.org) wrote: > Greetings, > > I am currently try to setup a crossbuild for arm64 to test some > local changes. I use the following steps to [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 49SD9S0yJsz4BtJ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [-2.03 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.67)[-0.666]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-0.80)[-0.796]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.27)[-0.267]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[googlemail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 02:30:05 -0000 Gordon Bergling via freebsd-hackers (freebsd-hackers@freebsd.org) wrote: > Greetings, > > 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. Hi Gordon, 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