From cf9135829836c85735b383f7c50f34232bea94f9 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 2 Jun 2020 23:10:27 +0200 Subject: Much work on the ELF parser and userspace jumping --- src/kernel/memory/paging.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/kernel/memory/paging.c') diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c index 1d9f6b1..e2c48b8 100644 --- a/src/kernel/memory/paging.c +++ b/src/kernel/memory/paging.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -27,9 +28,16 @@ void paging_install() kernel_page_directory->entries[0].writable = 1; kernel_page_directory->entries[0].address = SHIFT((u32)page_table); - paging_switch_directory((u32)kernel_page_directory); + paging_switch_dir((u32)kernel_page_directory); paging_enable(); info("Installed paging"); + + // Test mallocing + u32 *c = malloc(2048); + c[42] = 0x4242; + assert(c[42] == 0x4242); + free(c); + info("Malloc test succeeded!"); } void paging_disable() @@ -48,7 +56,7 @@ void paging_enable() paging_enabled = 1; } -void paging_switch_directory(u32 dir) +void paging_switch_dir(u32 dir) { cr3_set(dir); } -- cgit v1.2.3