-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·47 lines (40 loc) · 1.12 KB
/
run.sh
File metadata and controls
executable file
·47 lines (40 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/zsh
FLAGS=(
-machine virt
-cpu rv64
-smp 4
-nographic # No GUI
-serial stdio # Serial output on stdio
-monitor none # Disable combined monitor mode
# -serial mon:stdio # Combine monitor and serial output on stdio (replaced)
-m 512M
-bios none
-drive format=raw,file=hdd.dsk,id=dr0,if=none
-device virtio-blk-device,drive=dr0
-global virtio-mmio.force-legacy=false
-device virtio-gpu
)
# FLAGS=(
# -machine virt
# -cpu rv64
# -smp 4
# -serial mon:stdio
# -nographic
# -m 128M
# -bios none
# -drive format=raw,file=hdd.dsk,id=dr0,if=none
# -device virtio-blk-device,drive=dr0
# # -device virtio-gpu-device
# -global virtio-mmio.force-legacy=false
# )
FILE=hdd.dsk
# Check if kernel file was provided
if [ -z "$1" ]; then
echo "Error: No kernel file specified"
echo "Usage: ./run.sh path/to/kernel.elf"
exit 1
fi
# Add trap to ensure clean shutdown on Ctrl+C
trap 'echo "Shutting down QEMU..."; exit' INT TERM
# Use qemu with modified flags to properly handle Ctrl+C
qemu-system-riscv64 ${FLAGS[@]} -kernel $1