From owner-freebsd-riscv@freebsd.org Sat Nov 16 19:56:04 2019 Return-Path: Delivered-To: freebsd-riscv@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 7DFA61ACE3D for ; Sat, 16 Nov 2019 19:56:04 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47FmDh2Y3Bz4Ckn for ; Sat, 16 Nov 2019 19:56:04 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 1792015B92 for ; Sat, 16 Nov 2019 19:56:04 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-oi1-f177.google.com with SMTP id e9so11736349oif.8 for ; Sat, 16 Nov 2019 11:56:04 -0800 (PST) X-Gm-Message-State: APjAAAWElka6kYxUrduXg7pnhvlEkUs7nX/NnRg+wG+2yvQGwXAM2r7Y fGIvC/TWzSzHlwpX19CqgCSU8Fd1I8sRgamb8wY= X-Google-Smtp-Source: APXvYqwoNyiHKEbYb9fRZVhA5DjefjEg/RTC3SxY0KqIK3lZWHD/wvGY+hGwcQo8C1i45tSB3h70KRZb//lrdLbLOLI= X-Received: by 2002:aca:f514:: with SMTP id t20mr13228125oih.24.1573934163219; Sat, 16 Nov 2019 11:56:03 -0800 (PST) MIME-Version: 1.0 From: Mitchell Horne Date: Sat, 16 Nov 2019 14:55:52 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Support for OpenSBI added To: freebsd-riscv Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Nov 2019 19:56:04 -0000 Hi all, After some recent work, support has been added for booting FreeBSD using OpenSBI. OpenSBI is a RISC-V bootloader and the successor to BBL (Berkeley Boot Loader). It has a larger feature set, and is more actively maintained. For more details on supported features and platforms see its repository[1]. I have documented the steps required to boot FreeBSD using OpenSBI on the RISC-V wiki page[2]. The steps are simpler than booting with BBL, since the OpenSBI binaries don't need to be rebuilt each time the payload changes. In short, the requirements to boot the FreeBSD kernel are: 1. FreeBSD r354722 or newer. 2. The sysutils/opensbi port/package. 3. QEMU 4.1 or greater, either from emulators/qemu-devel or built from source. To run the test payload: qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic \ -bios /usr/local/share/opensbi/platform/qemu/virt/firmware/fw_payload.elf To run the FreeBSD kernel: objcopy -S -O binary /path/to/riscv/kernel kernel.bin qemu-system-riscv64 -machine virt -m 2048M -smp 2 -nographic \ -kernel kernel.bin \ -bios /usr/local/share/opensbi/platform/qemu/virt/firmware/fw_jump.elf Please let me know of any issues you encounter, either through mail or IRC (#freebsd-riscv on freenode). [1] https://github.com/riscv/opensbi [2] https://wiki.freebsd.org/riscv