|
|
|
@ -14,6 +14,11 @@ SBI ?= rustsbi
|
|
|
|
|
BOOTLOADER := ../bootloader/$(SBI)-$(BOARD).bin
|
|
|
|
|
K210_BOOTLOADER_SIZE := 131072
|
|
|
|
|
|
|
|
|
|
# Building mode argument
|
|
|
|
|
ifeq ($(MODE), release)
|
|
|
|
|
MODE_ARG := --release
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# KERNEL ENTRY
|
|
|
|
|
ifeq ($(BOARD), qemu)
|
|
|
|
|
KERNEL_ENTRY_PA := 0x80200000
|
|
|
|
@ -106,4 +111,11 @@ debug: build
|
|
|
|
|
tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \
|
|
|
|
|
tmux -2 attach-session -d
|
|
|
|
|
|
|
|
|
|
.PHONY: build env kernel clean disasm disasm-vim run-inner switch-check fs-img
|
|
|
|
|
|
|
|
|
|
gdbserver: build
|
|
|
|
|
@qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S
|
|
|
|
|
|
|
|
|
|
gdbclient:
|
|
|
|
|
@riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'
|
|
|
|
|
|
|
|
|
|
.PHONY: build env kernel clean disasm disasm-vim run-inner switch-check fs-img gdbserver gdbclient
|
|
|
|
|