-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.sh
More file actions
26 lines (21 loc) · 736 Bytes
/
Copy pathrun.sh
File metadata and controls
26 lines (21 loc) · 736 Bytes
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
#!/bin/sh
set -ev
$(brew --prefix llvm)/bin/clang \
-Wall -Wextra --target=riscv64-unknown-elf -ffreestanding -nostdlib \
-Wl,-eguest_boot -Wl,-Ttext=0x100000 -Wl,-Map=guest.map \
guest.S -o guest.elf
$(brew --prefix llvm)/bin/llvm-objcopy -O binary guest.elf guest.bin
RUSTFLAGS="-C link-arg=-Thypervisor.ld -C linker=rust-lld" \
cargo build --bin hypervisor --target riscv64gc-unknown-none-elf
cp target/riscv64gc-unknown-none-elf/debug/hypervisor hypervisor.elf
qemu-system-riscv64 \
-machine virt \
-cpu rv64,h=true \
-bios default \
-smp 1 \
-m 128M \
-nographic \
-d cpu_reset,unimp,guest_errors,int -D qemu.log \
-serial mon:stdio \
--no-reboot \
-kernel hypervisor.elf