feat: simple drawing board GUI
This commit is contained in:
parent
206c09fe86
commit
932ae94711
33 changed files with 191 additions and 669 deletions
29
os/Makefile
29
os/Makefile
|
@ -12,6 +12,12 @@ BOARD := qemu
|
|||
SBI ?= rustsbi
|
||||
BOOTLOADER := ../bootloader/$(SBI)-$(BOARD).bin
|
||||
|
||||
# GUI
|
||||
GUI ?= off
|
||||
ifeq ($(GUI), off)
|
||||
GUI_OPTION := -display none
|
||||
endif
|
||||
|
||||
# Building mode argument
|
||||
ifeq ($(MODE), release)
|
||||
MODE_ARG := --release
|
||||
|
@ -67,27 +73,12 @@ disasm-vim: kernel
|
|||
|
||||
run: run-inner
|
||||
|
||||
gui: build
|
||||
ifeq ($(BOARD),qemu)
|
||||
@qemu-system-riscv64 \
|
||||
-M 128m \
|
||||
-machine virt \
|
||||
-bios $(BOOTLOADER) \
|
||||
-device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) \
|
||||
-drive file=$(FS_IMG),if=none,format=raw,id=x0 \
|
||||
-device virtio-blk-device,drive=x0 \
|
||||
-device virtio-gpu-device \
|
||||
-device virtio-keyboard-device \
|
||||
-device virtio-mouse-device \
|
||||
-serial stdio
|
||||
endif
|
||||
|
||||
run-inner: build
|
||||
@qemu-system-riscv64 \
|
||||
-M 128m \
|
||||
-machine virt \
|
||||
-bios $(BOOTLOADER) \
|
||||
-display none \
|
||||
$(GUI_OPTION) \
|
||||
-device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) \
|
||||
-drive file=$(FS_IMG),if=none,format=raw,id=x0 \
|
||||
-device virtio-blk-device,drive=x0 \
|
||||
|
@ -96,6 +87,10 @@ run-inner: build
|
|||
-device virtio-mouse-device \
|
||||
-serial stdio
|
||||
|
||||
fdt:
|
||||
@qemu-system-riscv64 -M 128m -machine virt,dumpdtb=virt.out
|
||||
fdtdump virt.out
|
||||
|
||||
debug: build
|
||||
@tmux new-session -d \
|
||||
"qemu-system-riscv64 -machine virt -nographic -bios $(BOOTLOADER) -device loader,file=$(KERNEL_BIN),addr=$(KERNEL_ENTRY_PA) -s -S" && \
|
||||
|
@ -109,4 +104,4 @@ gdbserver: build
|
|||
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 fs-img gdbserver gdbclient
|
||||
.PHONY: build env kernel clean disasm disasm-vim run-inner fs-img gdbserver gdbclient fdt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue