|
|
|
@ -12,8 +12,9 @@
|
|
|
|
|
# d = int | in_asm | ... QEMU debug info
|
|
|
|
|
# mode = debug | release
|
|
|
|
|
# LOG = off | error | warn | info | debug | trace
|
|
|
|
|
# SFSIMG = SFS image path of user programs
|
|
|
|
|
# SFSIMG = <sfsimg> SFS image path of user programs
|
|
|
|
|
# smp = 1 | 2 | ... SMP core number
|
|
|
|
|
# graphic = on | off enable/disable qemu graphical output
|
|
|
|
|
# board = fpga Only available on riscv32, build without bbl, run on board
|
|
|
|
|
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
|
|
|
|
|
# m_mode Only available on riscv32, build for M-Mode, without MMU
|
|
|
|
@ -40,10 +41,15 @@ user_obj := build/$(arch)/user.o
|
|
|
|
|
export ARCH = $(arch)
|
|
|
|
|
export SFSIMG = $(user_dir)/build/user-$(arch).img
|
|
|
|
|
|
|
|
|
|
ifeq ($(arch), aarch64)
|
|
|
|
|
graphic ?= on
|
|
|
|
|
else
|
|
|
|
|
graphic ?= off
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
### qemu options ###
|
|
|
|
|
qemu_opts := \
|
|
|
|
|
-smp cores=$(smp) \
|
|
|
|
|
-nographic
|
|
|
|
|
-smp cores=$(smp)
|
|
|
|
|
|
|
|
|
|
ifeq ($(arch), x86_64)
|
|
|
|
|
qemu_opts += \
|
|
|
|
@ -67,6 +73,10 @@ qemu_opts += \
|
|
|
|
|
-kernel $(bin)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifneq ($(graphic), on)
|
|
|
|
|
qemu_opts += -nographic
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifdef d
|
|
|
|
|
qemu_opts += -d $(d)
|
|
|
|
|
endif
|
|
|
|
@ -78,6 +88,10 @@ features += no_bbl
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifneq ($(graphic), on)
|
|
|
|
|
features += nographic
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(board), raspi3)
|
|
|
|
|
# qemu only has generic timer
|
|
|
|
|
# TODO: configure system/generic timer automatically
|
|
|
|
|