From 4546c75d685475d8b9f215b588364e1d1bbd0b79 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 29 Apr 2020 19:21:29 +0200 Subject: MUCH work in libc Also cleaned up some syscalls etc --- src/kernel/memory/paging.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/kernel/memory/paging.c') 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); -- cgit v1.2.3