From 08207f0782a1c67c1cdb067f3e67c9106de665be Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Fri, 17 Jul 2026 16:13:44 -0400 Subject: [PATCH 1/2] Makefile: fix build bug "make run" Signed-off-by: Michael Shaw --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 08f2f57..5094846 100644 --- a/Makefile +++ b/Makefile @@ -79,12 +79,13 @@ default: all: $(KERNEL) $(Q)compiledb -n make +.PHONY: __build_all __build_all: $(Q)$(MAKE) --no-print-directory -f scripts/Makefile.build _all obj=. $(KOBJ): __build_all -$(KERNEL): $(KOBJ) linker.ld +$(KERNEL): $(KOBJ) built-in.o linker.ld $(Q)echo " LD $@" $(Q)$(LD) $(KOBJ) $(LDFLAGS) -T linker.ld -o $@ From 3dacb8d3f4d1c60829f6e7c5a7341a53588d9771 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Fri, 17 Jul 2026 16:14:41 -0400 Subject: [PATCH 2/2] mem: fix up fancy memory map printout Signed-off-by: Michael Shaw --- mem/mem.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mem/mem.c b/mem/mem.c index 0cd9877..aad9cce 100644 --- a/mem/mem.c +++ b/mem/mem.c @@ -29,17 +29,20 @@ static void mem_init_zones() struct mem_zone *last; static const char *grid[] = {"Entry", "Physical base", "Length", "Type"}; - int grid_width = kprintf("| %-5s | %-18s | %-18s | %-22s |\n", grid[0], grid[1], grid[2], grid[3]); - kprintf("|"); - for (int i = 0; i < grid_width - 3; i++) { +#ifdef KDEBUG + int grid_width = kdebug("| %-5s | %-16s | %-16s | %-22s |\n", grid[0], grid[1], grid[2], grid[3]); + kdebug("|"); + for (int i = 0; i < grid_width - 17; i++) { kprintf("-"); } kprintf("|\n"); +#endif for (int i = 0; i < map->entry_count; i++) { struct limine_memmap_entry *ent = kern_map_res->entries[i]; - if (ARRAY_SIZE(zone_type_strings) > ent->type) - kprintf("| %-5d | 0x%-16x | 0x%-16x | %-22s |\n", i, ent->base, ent->length, zone_type_strings[ent->type]); + if (ARRAY_SIZE(zone_type_strings) > ent->type) { + kdebug("| %05d | %016llx | %16llx | %-22s |\n", i, ent->base, ent->length, zone_type_strings[ent->type]); + } bool usable; switch (ent->type) { @@ -74,6 +77,13 @@ static void mem_init_zones() last_usable = usable; } +#ifdef KDEBUG + kdebug("|"); + for (int i = 0; i < grid_width - 17; i++) { + kprintf("-"); + } + kprintf("|\n"); +#endif } void mem_init()