diff options
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r-- | src/kernel/memory/paging.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c index 8b5de59..4b87540 100644 --- a/src/kernel/memory/paging.c +++ b/src/kernel/memory/paging.c @@ -3,6 +3,7 @@ #include <kernel/system.h> #include <kernel/lib/lib.h> #include <kernel/io/io.h> +#include <kernel/acpi/acpi.h> int paging_enabled = 0; @@ -31,9 +32,9 @@ void paging_init() void paging_install() { // User paging - paging_switch_directory(1); - paging_init(); - paging_set_user(0, memory_get_all() >> 3); + //paging_switch_directory(1); + //paging_init(); + //paging_set_user(0, memory_get_all() >> 3); // Kernel paging paging_switch_directory(0); @@ -53,6 +54,16 @@ void paging_disable() paging_enabled = 0; } +void paging_enable() +{ + asm("mov %0, %%cr3" ::"r"(current_page_directory)); + uint32_t cr0; + asm("mov %%cr0, %0" : "=r"(cr0)); + cr0 |= 0x80000000; + asm("mov %0, %%cr0" ::"r"(cr0)); + paging_enabled = 1; +} + void paging_switch_directory(int user) { if (user == 1) { @@ -65,16 +76,6 @@ void paging_switch_directory(int user) asm("mov %0, %%cr3" ::"r"(current_page_directory)); } -void paging_enable() -{ - asm("mov %0, %%cr3" ::"r"(current_page_directory)); - uint32_t cr0; - asm("mov %%cr0, %0" : "=r"(cr0)); - cr0 |= 0x80000000; - asm("mov %0, %%cr0" ::"r"(cr0)); - paging_enabled = 1; -} - inline void invlpg(uint32_t addr) { asm("invlpg (%0)" ::"r"(addr) : "memory"); @@ -191,4 +192,4 @@ uint32_t paging_get_used_pages() } } return n; -}
\ No newline at end of file +} |