-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (48 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
53 lines (48 loc) · 1.51 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
48
49
50
51
52
53
GDBSERVER = localhost:1234
GDB = gdb-multiarch
GDBt = /home/ustc/qemu/gdb-14.2/build-riscv64/bin/riscv64-unknown-elf-gdb
all:
cp -rT os/cargotemp os/.cargo
$(MAKE) -C os kernel MODE=release
cp os/target/riscv64gc-unknown-none-elf/release/os ./kernel-rv
touch kernel-la
run:
qemu-system-riscv64 \
-machine virt \
-kernel kernel-rv \
-m 1024M \
-nographic \
-smp 1 \
-drive file=os/sdcard-rv.img,if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 \
-no-reboot \
-device virtio-net-device,netdev=net \
-drive file=disk-rv.img,if=none,format=raw,id=x1 -device virtio-blk-device,drive=x1,bus=virtio-mmio-bus.1\
-netdev user,id=net \
-rtc base=utc
gdbserver:
qemu-system-riscv64 \
-machine virt \
-kernel kernel-rv \
-m 1024M \
-nographic \
-smp 1 \
-bios default \
-drive file=os/sdcard-rv.img,if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 \
-no-reboot \
-device virtio-net-device,netdev=net \
-netdev user,id=net \
-drive file=disk-rv.img,if=none,format=raw,id=x1 -device virtio-blk-device,drive=x1,bus=virtio-mmio-bus.1\
-rtc base=utc \
-s -S
all-debug:
cp -rT os/cargotemp os/.cargo
$(MAKE) -C os kernel
cp os/target/riscv64gc-unknown-none-elf/debug/os ./kernel-rv
touch kernel-la
gdb:
$(GDB) $(KERNEL) -ex "target remote $(GDBSERVER)" -ex "set arch riscv:rv64"
gdb2:
$(GDBt) $(KERNEL) -ex "target remote $(GDBSERVER)" -ex "set arch riscv:rv64"
.PHONY: all run gdbserver gdb