feat: Integrate LVGL v8.3 desktop GUI, PS/2 mouse driver, live system monitor, and make gui target

This commit is contained in:
RarDog
2026-09-02 20:42:18 +03:00
parent c98c8de9d4
commit 78d38f7620
435 changed files with 286235 additions and 24 deletions
+37 -7
View File
@@ -36,12 +36,14 @@ INIT_SERVER := $(BUILD_DIR)/init_server.elf
UART_DRIVER := $(BUILD_DIR)/uart_driver.elf
SH_SERVER := $(BUILD_DIR)/sh.elf
PROCMGR := $(BUILD_DIR)/procmgr.elf
GUI_SERVER := $(BUILD_DIR)/gui_server.elf
LVGL_LIB := $(BUILD_DIR)/liblvgl.a
DISK_IMG := $(BUILD_DIR)/opencoreC.img
LIBC_OBJS := $(BUILD_DIR)/string.o $(BUILD_DIR)/syscalls.o $(BUILD_DIR)/stdlib.o
NET_OBJS := $(BUILD_DIR)/net.o $(BUILD_DIR)/rtl8139.o $(BUILD_DIR)/pci.o
.PHONY: all kernel libc hal servers image run clean help limine-setup
.PHONY: all kernel libc hal servers lvgl image run gui qemu clean help limine-setup
all: kernel libc hal servers
@mkdir -p $(BUILD_DIR)
@@ -49,8 +51,8 @@ all: kernel libc hal servers
@echo "======================================================="
@echo " [SUCCESS] opencoreC Build Complete!"
@echo " Kernel: $(KERNEL_ELF)"
@echo " Servers: $(INIT_SERVER), $(UART_DRIVER), $(SH_SERVER), $(PROCMGR)"
@echo " Run: make image && make run"
@echo " Servers: $(INIT_SERVER), $(UART_DRIVER), $(SH_SERVER), $(PROCMGR), $(GUI_SERVER)"
@echo " Run: make run (Serial CLI) or make gui (LVGL Desktop Window)"
@echo "======================================================="
kernel:
@@ -75,7 +77,14 @@ hal: libc
@$(CC) $(CFLAGS) -I$(HAL_DIR)/include -c $(HAL_DIR)/src/fb.c -o $(BUILD_DIR)/fb.o
@$(CC) $(CFLAGS) -I$(HAL_DIR)/include -c $(HAL_DIR)/src/rtl8139.c -o $(BUILD_DIR)/rtl8139.o
servers: libc hal
lvgl: $(LVGL_LIB)
$(LVGL_LIB):
@mkdir -p $(BUILD_DIR)/lvgl
@echo "[CC] Compiling LVGL v8.3 Graphics Library..."
@python3 scripts/build_lvgl.py $(CC) "$(CFLAGS)" $(BUILD_DIR)
servers: libc hal $(LVGL_LIB)
@mkdir -p $(BUILD_DIR)
@echo "[CXX/CC] Linking Ring 3 User-space Servers..."
@# C++ LibIPC
@@ -96,6 +105,10 @@ servers: libc hal
@$(CXX) $(CXXFLAGS) -c $(SERVERS_DIR)/procmgr/main.cpp -o $(BUILD_DIR)/procmgr_main.o
@$(LD) -T $(CONFIG_DIR)/user.ld -nostdlib -static -o $(PROCMGR) \
$(BUILD_DIR)/procmgr_main.o $(BUILD_DIR)/ipc.o $(LIBC_OBJS)
@# Desktop GUI Server (LVGL v8.3)
@$(CXX) $(CXXFLAGS) -Ilib/lvgl -c $(SERVERS_DIR)/gui_server/main.cpp -o $(BUILD_DIR)/gui_main.o
@$(LD) -T $(CONFIG_DIR)/user.ld -nostdlib -static -o $(GUI_SERVER) \
$(BUILD_DIR)/gui_main.o $(BUILD_DIR)/ipc.o $(LVGL_LIB) $(LIBC_OBJS)
# Download and build the Limine bootloader host tool
limine-setup:
@@ -119,6 +132,7 @@ image: all limine-setup
@mcopy -i $(DISK_IMG)@@1M $(UART_DRIVER) ::/boot/
@mcopy -i $(DISK_IMG)@@1M $(SH_SERVER) ::/boot/
@mcopy -i $(DISK_IMG)@@1M $(PROCMGR) ::/boot/
@mcopy -i $(DISK_IMG)@@1M $(GUI_SERVER) ::/boot/
@# Bootloader config
@mcopy -i $(DISK_IMG)@@1M limine.conf ::/
@mcopy -i $(DISK_IMG)@@1M limine.cfg ::/
@@ -132,7 +146,22 @@ image: all limine-setup
@$(LIMINE_DIR)/limine bios-install $(DISK_IMG) 2>&1 | grep -v "^Physical\|^Installing\|^Stage\|^Reminder"
@echo "[IMAGE] Done: $(DISK_IMG) (BIOS + UEFI bootable)"
# Launch QEMU with serial terminal, VGA framebuffer, and RTL8139 network card
# Launch QEMU with Desktop GUI Window (LVGL, Framebuffer, PS/2 Mouse & Keyboard)
gui: image
@echo "[QEMU] Launching opencoreC Desktop GUI (LVGL, Framebuffer, PS/2 Mouse)..."
@echo "[QEMU] Click inside window to grab mouse. Press Ctrl+Alt+G to release mouse."
$(QEMU) \
-M q35 \
-smp 4 \
-m 512M \
-vga std \
-netdev user,id=net0 \
-device rtl8139,netdev=net0 \
-serial mon:stdio \
-no-reboot \
-drive file=$(DISK_IMG),format=raw
# Launch QEMU with serial terminal (Headless CLI mode)
run: image
@echo "[QEMU] Launching opencoreC (SMP 4 cores, Serial terminal, Framebuffer, RTL8139 Net)..."
@echo "[QEMU] Type 'help' for commands. Ctrl+A X to exit QEMU."
@@ -167,8 +196,9 @@ help:
@echo "Targets:"
@echo " make all - Build kernel, HAL, libc, and all user servers"
@echo " make image - Create bootable disk image (build/opencoreC.img)"
@echo " make run - Build image and launch in QEMU (interactive serial)"
@echo " make qemu - Quick relaunch without rebuild"
@echo " make gui - Launch QEMU with Desktop GUI Window (LVGL, Framebuffer, Mouse)"
@echo " make run - Build image and launch in QEMU (interactive serial CLI)"
@echo " make qemu - Quick relaunch without rebuild (CLI)"
@echo " make limine-setup - Download/build Limine bootloader"
@echo " make clean - Remove all build artifacts"
@echo ""