mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
build: Track header dependencies, fix default goal, and repair the font table comment
Three build-correctness fixes plus README coverage of the new kernel core. The Makefile had no header dependency tracking, so editing a header left every unrebuilt caller linked against the old layout. That is how the desktop's window paint callbacks silently landed at the wrong struct offset after gui_window_t grew: gui_apps.o was never recompiled. Compiles now emit .d files via -MMD -MP and the build pulls them in. The include has to sit at the end of the file with .DEFAULT_GOAL pinned to `all` -- a .d file's first rule would otherwise become make's default goal and turn a bare `make` into a silent no-op. drivers/video/canvas.c carried the same font table defect gui_gfx.c did: the `// \` comment on the backslash glyph continues onto the next line, swallowing the `]` entry and shifting every glyph from ']' onward by one, so all lowercase text rendered one letter off. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01L5yKJT4Wo2cV3rfPrwY5MP
This commit is contained in:
1 parent
29d7726a91
commit
ed8922c498
3 files changed
+35
-5
No files matched your search
@@ -283,7 +283,8 @@ ifeq ($(CONFIG_USERLAND_LAZYBOX), y)
|
||||
CONFIG_SRCS-y += userland/lazybox/lazybox.c userland/lazybox/shell.c userland/lazybox/sh.c userland/lazybox/nano.c userland/lazybox/snake.c userland/lazybox/tree.c userland/lazybox/coreutils.c
|
||||
endif
|
||||
|
||||
CONFIG_SRCS-y += gui/gui.c gui/gui_gfx.c gui/gui_cursor.c gui/gui_wm.c gui/gui_desktop.c gui/gui_apps.c
|
||||
CONFIG_SRCS-y += gui/gui.c gui/gui_gfx.c gui/gui_cursor.c gui/gui_wm.c gui/gui_desktop.c gui/gui_apps.c \
|
||||
gui/gui_widgets.c gui/gui_icons.c gui/gui_dialog.c gui/gui_apps_ext.c
|
||||
|
||||
# Deduplicate
|
||||
CONFIG_SRCS-y := $(sort $(CONFIG_SRCS-y))
|
||||
@@ -312,6 +313,13 @@ else
|
||||
OTHER_OBJS = $(filter-out $(ENTRY_OBJ), $(S_OBJS) $(C_OBJS))
|
||||
endif
|
||||
|
||||
# Generated dependency files, one per object. The include lives at the very
|
||||
# end of this file: a .d file's first rule would otherwise become make's
|
||||
# default goal and turn a bare `make` into a no-op.
|
||||
DEPS = $(C_OBJS:.o=.d) $(CPP_OBJS:.o=.d) $(S_OBJS:.o=.d)
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
.PHONY: all clean run debug info configure menuconfig config tui nconfig defconfig x86_64_defconfig aarch64_defconfig armv8_defconfig armv8i_defconfig armv81_defconfig arm32_defconfig qemu help
|
||||
|
||||
all: $(TARGET)
|
||||
@@ -337,15 +345,19 @@ armv8_defconfig armv8i_defconfig armv81_defconfig arm32_defconfig:
|
||||
# -----------------------------------------------------------------------------
|
||||
# Compilation Rules
|
||||
# -----------------------------------------------------------------------------
|
||||
# Header dependency tracking: without this a header change leaves stale objects
|
||||
# behind, and a struct layout edit silently corrupts every unrebuilt caller.
|
||||
DEPFLAGS = -MMD -MP
|
||||
|
||||
# C Source Files
|
||||
$(BUILD_DIR)/%.o: %.c include/config/autoconf.h
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
$(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
# C++ Source Files
|
||||
$(BUILD_DIR)/%.o: %.cpp include/config/autoconf.h
|
||||
@mkdir -p $(dir $@)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
$(CXX) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
# x86_64 NASM Assembly Files
|
||||
$(BUILD_DIR)/%.o: %.asm
|
||||
@@ -355,7 +367,7 @@ $(BUILD_DIR)/%.o: %.asm
|
||||
# ARM/AArch64 GNU Assembly Files (.S)
|
||||
$(BUILD_DIR)/%.o: %.S
|
||||
@mkdir -p $(dir $@)
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
$(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
# Rust Source Compilation
|
||||
$(RUST_LIB): rust/src/lib.rs $(RUST_SRCS)
|
||||
@@ -462,3 +474,5 @@ help:
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) $(IMAGE)
|
||||
|
||||
-include $(DEPS)
|
||||
@@ -27,6 +27,20 @@
|
||||
|
||||
## 🌟 Key Architecture & Capabilities
|
||||
|
||||
- 🧵 **Kernel Concurrency Core (`kernel/wait.c`, `kernel/futex.c`, `kernel/rcu.c`)**:
|
||||
- **Wait Queues & Completions**: Sleeper parking with timed waits, one-shot completion barriers, and a static entry pool so a blocking path never re-enters the allocator (`waitinfo`).
|
||||
- **Futex Hash Table**: 32 buckets with value re-check on the slow path, requeue support, and an `fmutex_t` sleeping mutex built on the uncontended-fastpath protocol (`futexinfo`).
|
||||
- **Tiny RCU**: Lock-free readers with nesting depth tracking, deferred `call_rcu`/`kfree_rcu` callbacks, grace-period accounting, and `rcu_assign_pointer`/`rcu_dereference` publish barriers (`rcuinfo`).
|
||||
- 🧱 **Core Data Structures (`lib/rbtree.c`, `lib/kfifo.c`, `lib/hashtable.c`)**:
|
||||
- **Red-Black Tree**: Linux-compatible parent-pointer rbtree with full insert/erase rebalancing, forward and reverse in-order iteration, and a black-height invariant validator.
|
||||
- **kfifo Ring Buffer**: Power-of-two byte ring with free-running indices, so the wrap path costs one mask instead of a branch per byte.
|
||||
- **Hash Table**: Separately-chained FNV-1a table with string or `u64` keys and rehash-on-growth at a 3/4 load factor.
|
||||
- 💾 **Block Page Cache (`mm/page_cache.c`)**:
|
||||
- Write-back cache of 4 KB pages keyed by `(device, page index)`, indexed through the kernel hash table.
|
||||
- CLOCK second-chance eviction with dirty write-back, pinning, per-device flush and invalidate, and live hit-rate telemetry (`pagecache`).
|
||||
- 🧪 **In-Kernel Test Harness (`kernel/ktest.c`)**:
|
||||
- KUnit-style suites with assertion macros, per-case pass/fail reporting and timing.
|
||||
- **6 built-in suites, 21 cases, 735 assertions** covering rbtree, kfifo, hashtable, RCU, futex, wait queues, page cache and libcore — runnable from the shell (`ktest`) or the desktop KTest Runner.
|
||||
- ⚡ **Freestanding C++17 OOP Kernel Engine (`kernel/cpp/`)**:
|
||||
- **Bare-Metal C++ Runtime**: `operator new`/`delete`, sized deallocation, placement `new`, pure virtual handlers (`__cxa_pure_virtual`), and `.init_array` global constructor dispatcher.
|
||||
- **Modern Generic Containers**: Pure freestanding `Vector<T>`, `UniquePtr<T>` (with polymorphic converting constructors and custom deleters), dynamic `String`, and move semantics (`kernel::move`, `kernel::forward`).
|
||||
@@ -85,6 +99,8 @@
|
||||
- 🧰 **LazyBox Userland Suite (85+ Linux, Rust, C++ & SUB-Lang Applets)**:
|
||||
- Interactive shell with history, quote-aware tokenization, tab autocompletion, ANSI cursor editing, and script runner (`sh`).
|
||||
- GNU-compatible **Nano** visual text editor.
|
||||
- **Text Processing Suite (`userland/lazybox/coreutils.c`)**: `sort`, `uniq`, `cut`, `tr`, `rev`, `tac`, `nl`, `seq`, `diff`, `xxd`, `du`, `factor`, `sum` and `truncate`, all reading through the VFS and handling the zero-length synthetic nodes procfs and sysfs expose.
|
||||
- **Kernel Diagnostics**: `ktest`, `rcuinfo`, `futexinfo`, `waitinfo` and `pagecache`.
|
||||
- Full utilities: `ls`, `cat`, `touch`, `mkdir`, `rm`, `cp`, `pwd`, `cd`, `tree`, `find`, `wc`, `head`, `tail`, `stat`, `df`, `mkfs.vfat`, `hexdump`, `neofetch`, `uname`, `free`, `uptime`, `top`, `ps`, `pstree`, `kill`, `dmesg`, `netstat`, `ifconfig`, `ping`, `traceroute`, `curl`, `ssh`, `tts`, `alsamixer`, `sensors`, `rustinfo`, `chacha20`, `sha3sum`, `base64`, `cryptobench`, `fdisk`, `rfilter`, `dcache`, `watchdog`, `jsonquery`, `subinfo`, `subi`, `subpower`, `subbench`, `subquote`, `cppinfo`, `cpptest`, `snake`, and more.
|
||||
|
||||
---
|
||||
|
||||
@@ -70,7 +70,7 @@ static const uint8_t font8x8_basic[96][8] = {
|
||||
{0x66,0x66,0x66,0x3c,0x18,0x18,0x3c,0x00}, // Y
|
||||
{0xfe,0x06,0x0c,0x18,0x30,0x60,0xfe,0x00}, // Z
|
||||
{0x3c,0x30,0x30,0x30,0x30,0x30,0x3c,0x00}, // [
|
||||
{0xc0,0x60,0x30,0x18,0x0c,0x06,0x02,0x00}, // \
|
||||
{0xc0,0x60,0x30,0x18,0x0c,0x06,0x02,0x00}, // backslash
|
||||
{0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00}, // ]
|
||||
{0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00}, // ^
|
||||
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff}, // _
|
||||
|
||||
Reference in new issue
Block a user