浏览代码

RustSBI on qemu

luojia65 4 年之前
父节点
当前提交
e34436b65e
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      soc/qemu/justfile

+ 12 - 0
soc/qemu/justfile

@@ -6,8 +6,20 @@ m-bin-file := build-path + "rustsbi-qemu.bin"
 
 objcopy := "rust-objcopy --binary-architecture=riscv64"
 
+threads := "1"
+
 build: firmware
     @{{objcopy}} {{m-firmware-file}} --strip-all -O binary {{m-bin-file}}
 
 firmware:
     @cargo build --target={{target}}
+
+qemu: build
+    @qemu-system-riscv64 \
+            -machine virt \
+            -nographic \
+            -bios none \
+            -device loader,file={{m-bin-file}},addr=0x80000000 \
+            -smp threads={{threads}}
+
+run: build qemu