add Makefile option `graphic` & cargo feature `nographic`

master
equation314 6 years ago
parent b0915b102a
commit a55f3b61e6

@ -12,6 +12,7 @@ no_mmu = []
# Kernel in M-mode (for riscv32)
m_mode = ["no_mmu"]
# (for aarch64 RaspberryPi3)
nographic = []
board_raspi3 = ["bcm2837"]
raspi3_use_generic_timer = ["bcm2837/use_generic_timer"]

@ -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

@ -22,6 +22,7 @@ pub fn init_serial_early() {
/// Initialize raspi3 drivers
pub fn init_driver() {
#[cfg(not(feature = "nographic"))]
fb::init();
timer::init();
}

Loading…
Cancel
Save