forked from rivosinc/salus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (62 loc) · 2.12 KB
/
Makefile
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
OBJCOPY ?= riscv64-unknown-elf-objcopy
MACH_ARGS ?= -M virt,aia=aplic-imsic,aia-guests=4 -cpu rv64,x-aia=true
NCPU ?= 1
MEM_SIZE ?= 4096
# Sanitize LOCAL_PATH
ifdef LOCAL_PATH
LOCAL_PATH:=${LOCAL_PATH}/
endif
HOST_TRIPLET := $(shell cargo -Vv | grep '^host:' | awk ' { print $$2; } ')
all: salus tellus guestvm
.PHONY: check
check:
cargo test \
--target $(HOST_TRIPLET) \
--workspace \
--exclude test_workloads \
--lib
.PHONY: salus
salus:
cargo build --release --bin salus
.PHONY: salus_debug
salus_debug:
cargo build --bin salus
tellus_bin: tellus
${OBJCOPY} -O binary target/riscv64gc-unknown-none-elf/release/tellus tellus_raw
${OBJCOPY} -O binary target/riscv64gc-unknown-none-elf/release/guestvm guestvm_raw
./create_guest_image.sh tellus_raw guestvm_raw tellus_guestvm
guestvm:
RUSTFLAGS='-Clink-arg=-Tlds/guest.lds' cargo build --package test_workloads --release --bin guestvm
.PHONY: tellus
tellus: guestvm
cargo build --package test_workloads --bin tellus --release
run_tellus_gdb: tellus_bin salus_debug
${LOCAL_PATH}qemu-system-riscv64 \
-s -S \
${MACH_ARGS} -smp ${NCPU} -m ${MEM_SIZE} \
-nographic \
-kernel target/riscv64gc-unknown-none-elf/debug/salus \
-device guest-loader,kernel=tellus_guestvm,addr=0xc0200000
run_tellus: tellus_bin salus
${LOCAL_PATH}qemu-system-riscv64 \
${GDB_ARGS} \
${MACH_ARGS} -smp ${NCPU} -m ${MEM_SIZE} \
-nographic \
-kernel target/riscv64gc-unknown-none-elf/release/salus \
-device guest-loader,kernel=tellus_guestvm,addr=0xc0200000
run_linux: salus
${LOCAL_PATH}qemu-system-riscv64 \
${GDB_ARGS} \
${MACH_ARGS} -smp ${NCPU} -m ${MEM_SIZE} \
-nographic \
-kernel target/riscv64gc-unknown-none-elf/release/salus \
-device guest-loader,kernel=../linux/arch/riscv/boot/Image,addr=0xc0200000 \
-append "console=ttyS0 earlycon=sbi keep_bootcon bootmem_debug"
.PHONY: lint
lint:
cargo clippy -- -D warnings -Wmissing-docs
.PHONY: format
format:
cargo fmt -- --check --config format_code_in_doc_comments=true
.PHONY: ci
ci: salus guestvm tellus lint format check