Skip to content

Commit a6a5efe

Browse files
committedOct 18, 2025
RISC-V64 QEMU VM script
1 parent 5c0086c commit a6a5efe

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
 

‎tools/qemu-riscv.bat‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@echo off
2+
cd /d %~dp0
3+
color 0A
4+
setlocal enableDelayedExpansion
5+
cls
6+
7+
:: Try R: first and then C:
8+
9+
set DRIVE=R
10+
set WAY=\Tea\greenteaos-uefi64.iso
11+
set ISO=%DRIVE%:%WAY%
12+
13+
if not exist "%ISO%" (
14+
echo Trying alternative path...
15+
set DRIVE=C
16+
set ISO=!DRIVE!:!WAY!
17+
echo !ISO!
18+
)
19+
20+
set QEMU="C:\Program Files\qemu\qemu-system-riscv64.exe"
21+
set OVMF="C:\Program Files\qemu\share\opensbi-riscv64-generic-fw_dynamic.bin"
22+
set DEVICETREE="C:\Program Files\qemu\share\petalogix-s3adsp1800.dtb"
23+
24+
%QEMU% -accel tcg -bios %OVMF% -m 2048 ^
25+
-device virtio-gpu-device -machine virt ^
26+
-cpu sifive-u54 ^
27+
-serial file:!DRIVE!:\Tea\qemu-riscv64.log ^
28+
-smp 1 ^
29+
-cdrom !ISO! ^
30+
-dtb %DEVICETREE% ^
31+
-name "Greentea QEMU" -monitor stdio
32+
:: -drive format=raw,file=fat:rw:%DRIVE%:\Tea\spin-off ^
33+
::
34+
pause
35+
36+
:: -cpu sifive-u54
37+
38+
::qemu-system-riscv64 ^
39+
:: -machine virt ^
40+
:: -m 1024 ^
41+
:: -bios none ^
42+
:: -drive if=pflash,format=raw,readonly=on,file=edk2-riscv64-code.fd ^
43+
:: -drive if=pflash,format=raw,file=edk2-riscv64-vars.fd ^
44+
:: -drive file=fat:rw:ESP,format=raw ^
45+
:: -serial stdio

0 commit comments

Comments
 (0)
Please sign in to comment.