diff options
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r-- | src/kernel/memory/paging.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c index 9075d1d..ed06004 100644 --- a/src/kernel/memory/paging.c +++ b/src/kernel/memory/paging.c @@ -43,6 +43,17 @@ void set_cr0(uint32_t cr0) asm volatile("movl %%eax, %%cr0" ::"a"(cr0)); } +void paging_disable() +{ + set_cr0(get_cr0() | 0x7fffffff); +} + +void paging_enable() +{ + set_cr3(paging_current_directory); + set_cr0(get_cr0() | 0x80000000); +} + void paging_switch_directory(struct page_directory *dir) { set_cr3(dir); |