fixed issues when running on hardware
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user