From 35720de92852efb1b9d41a3c2fd11d5b4073a29e Mon Sep 17 00:00:00 2001 From: Zejun Zhao Date: Wed, 29 Oct 2025 11:37:22 +0800 Subject: [PATCH] Add sifive_u SCHEME --- Makefile | 10 ++++++---- OSDK.toml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c442562eb..945c2cbd0 100644 --- a/Makefile +++ b/Makefile @@ -114,10 +114,12 @@ BOOT_METHOD = qemu-direct OVMF = off endif -ifeq ($(OSDK_TARGET_ARCH), riscv64) -SCHEME = riscv -else ifeq ($(OSDK_TARGET_ARCH), loongarch64) -SCHEME = loongarch +ifeq ($(SCHEME), "") + ifeq ($(OSDK_TARGET_ARCH), riscv64) + SCHEME = riscv + else ifeq ($(OSDK_TARGET_ARCH), loongarch64) + SCHEME = loongarch + endif endif ifneq ($(SCHEME), "") diff --git a/OSDK.toml b/OSDK.toml index aee072740..d5b7592ff 100644 --- a/OSDK.toml +++ b/OSDK.toml @@ -68,6 +68,23 @@ qemu.args = """\ -device virtconsole,chardev=mux \ """ +[scheme."sifive_u"] +supported_archs = ["riscv64"] +build.features = ["riscv_sv39_mode"] +boot.method = "qemu-direct" +build.strip_elf = false + +qemu.args = """\ + -machine sifive_u \ + -m 8G \ + -no-reboot \ + -nographic \ + -display none \ + -serial chardev:mux \ + -monitor chardev:mux \ + -chardev stdio,id=mux,mux=on,signal=off,logfile=qemu.log +""" + [scheme."loongarch"] boot.method = "qemu-direct" build.strip_elf = false