This commit is contained in:
nub31
2025-12-30 01:51:51 +01:00
parent 532d3e7b48
commit 8340de0ad1
2 changed files with 4 additions and 6 deletions

View File

@@ -2,8 +2,6 @@ ENTRY(_start)
SECTIONS SECTIONS
{ {
. = 2M;
kernel_start = .; kernel_start = .;
.text : .text :

View File

@@ -33,7 +33,7 @@ extern uptr kernel_start;
extern uptr kernel_end; extern uptr kernel_end;
static region regions[MAX_REGIONS] = {0}; static region regions[MAX_REGIONS] = {0};
static u32 region_count = 0; static size_t region_count = 0;
static void find_memory_regions(uptr multiboot_info) { static void find_memory_regions(uptr multiboot_info) {
multiboot_tag_mmap *tag = multiboot_find_tag(multiboot_info, MULTIBOOT_TAG_TYPE_MMAP); multiboot_tag_mmap *tag = multiboot_find_tag(multiboot_info, MULTIBOOT_TAG_TYPE_MMAP);
@@ -63,12 +63,12 @@ void c_start(u32 magic, uptr multiboot_info) {
console_clear(); console_clear();
if (magic != MULTIBOOT_BOOTLOADER_MAGIC) { if (magic != MULTIBOOT_BOOTLOADER_MAGIC) {
boot_panic("Expected bootloader magic 0x%x, but got 0x%x", MULTIBOOT_BOOTLOADER_MAGIC, magic); boot_panic("Expected bootloader magic 0x%x, got 0x%x", MULTIBOOT_BOOTLOADER_MAGIC, magic);
} }
find_memory_regions(multiboot_info); find_memory_regions(multiboot_info);
for (u32 i = 0; i < region_count; ++i) { for (size_t i = 0; i < region_count; i++) {
kprintf("base: 0x%X, length: 0x%X\n", regions[i].base_address, regions[i].length); kprintf("Memory region %d: base=0x%X, length=0x%X\n", i, regions[i].base_address, regions[i].length);
} }
} }