aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/memory/paging.c
diff options
context:
space:
mode:
authorMarvin Borner2020-04-29 19:21:29 +0200
committerMarvin Borner2020-04-29 19:21:29 +0200
commit4546c75d685475d8b9f215b588364e1d1bbd0b79 (patch)
tree2077f72ad46dfe877f7febdd0692edc139fd7937 /src/kernel/memory/paging.c
parent396d7d303d3bf0e796d0c817883ec1dec928352a (diff)
MUCH work in libc
Also cleaned up some syscalls etc
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r--src/kernel/memory/paging.c11
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);