diff --git a/Makefile b/Makefile index e976f7c..8646c26 100644 --- a/Makefile +++ b/Makefile @@ -310,6 +310,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) @@ -335,15 +342,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 @@ -353,7 +364,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) @@ -449,3 +460,5 @@ help: clean: rm -rf $(BUILD_DIR) $(IMAGE) + +-include $(DEPS) diff --git a/README.md b/README.md index e382283..e37a5a7 100644 --- a/README.md +++ b/README.md @@ -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`, `UniquePtr` (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. --- diff --git a/drivers/video/canvas.c b/drivers/video/canvas.c index e128d23..9b5afdd 100644 --- a/drivers/video/canvas.c +++ b/drivers/video/canvas.c @@ -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}, // _