diff --git a/Makefile b/Makefile index 5094846..08f2f57 100644 --- a/Makefile +++ b/Makefile @@ -79,13 +79,12 @@ 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) built-in.o linker.ld +$(KERNEL): $(KOBJ) linker.ld $(Q)echo " LD $@" $(Q)$(LD) $(KOBJ) $(LDFLAGS) -T linker.ld -o $@ diff --git a/mem/mem.c b/mem/mem.c index aad9cce..0cd9877 100644 --- a/mem/mem.c +++ b/mem/mem.c @@ -29,20 +29,17 @@ static void mem_init_zones() struct mem_zone *last; static const char *grid[] = {"Entry", "Physical base", "Length", "Type"}; -#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++) { + 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++) { 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) { - kdebug("| %05d | %016llx | %16llx | %-22s |\n", i, ent->base, ent->length, zone_type_strings[ent->type]); - } + 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]); bool usable; switch (ent->type) { @@ -77,13 +74,6 @@ 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()