aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/memory/paging.c
diff options
context:
space:
mode:
authorMarvin Borner2020-04-18 17:45:30 +0200
committerMarvin Borner2020-04-18 17:45:30 +0200
commit54d848127e2026b710463508b1e6ca89c2b4b068 (patch)
tree73929602c8824bc6fa06236840b6cac664448241 /src/kernel/memory/paging.c
parent8d78616a2b80c7625c1aa9ca4733e48a8bf8bf22 (diff)
I don't know HOW I did it, but it works!
I finally fixed the acpi tables with some memory mapping magic and paging allocations, which seems to do the trick. YAY.
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r--src/kernel/memory/paging.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c
index 4b87540..38ed4a7 100644
--- a/src/kernel/memory/paging.c
+++ b/src/kernel/memory/paging.c
@@ -25,11 +25,9 @@ void paging_init()
for (uint32_t i = 0; i < 1024; i++) {
current_page_directory[i] = ((uint32_t)current_page_tables[i]) | PD_RW | PD_PRESENT;
}
-
- paging_set_present(0, memory_get_all() >> 3); // /4
}
-void paging_install()
+void paging_install(uint32_t multiboot_address)
{
// User paging
//paging_switch_directory(1);
@@ -39,10 +37,14 @@ void paging_install()
// Kernel paging
paging_switch_directory(0);
paging_init();
+
+ // if mmap approach didn't work
+ if (!memory_init(multiboot_address))
+ paging_set_present(0, memory_get_all() >> 3); // /4
paging_set_used(0, ((uint32_t)ASM_KERNEL_END >> 12) + 1); // /4096
paging_enable();
- vga_log("Installed paging");
+ log("Installed paging");
}
void paging_disable()