fixed issues when running on hardware

This commit is contained in:
2026-06-24 21:52:05 -05:00
parent bf0d1caa89
commit 8fa7a5930c
3 changed files with 11 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
#include "memory/mm.h"
#include "lib/print.h"
#include "multiboot.h"
#include <stddef.h>
@@ -61,6 +62,7 @@ static void parse_multiboot_mmap(void* base, uint32_t limit) {
uint32_t usable_start, usable_end, usable_size;
usable_size = align(region_start, entry->len, &usable_start, &usable_end);
if (usable_size <= 4096) {
entry = (multiboot_mmap_entry*)((uint32_t)entry + entry_size);
continue;
}
@@ -139,6 +141,8 @@ void init_pmm(void* mmap_base, uint32_t mmap_limit) {
if (mmap_base != NULL && mmap_limit > 0) {
parse_multiboot_mmap(mmap_base, mmap_limit);
}
kprintf("total free memory: %dMB\n", total_available_memory / 1024 / 1024);
}
void init_page_tables() {