aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/memory/paging.c
diff options
context:
space:
mode:
authorMarvin Borner2020-05-03 22:44:24 +0200
committerMarvin Borner2020-05-03 22:44:24 +0200
commit2ac25568839df7af2e271db9efa84bbd6fcb1f88 (patch)
tree3747958b729275c07115c579def55d246d72669e /src/kernel/memory/paging.c
parent5a02853da5c454ff34e65ddaea5e677a3285bc79 (diff)
Added missing memory functions
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r--src/kernel/memory/paging.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c
index f355449..67c471f 100644
--- a/src/kernel/memory/paging.c
+++ b/src/kernel/memory/paging.c
@@ -112,6 +112,14 @@ void paging_map_user(struct page_directory *dir, uint32_t phys, uint32_t virt)
}
}
+// Hmm
+uint32_t paging_get_phys(uint32_t virt)
+{
+ uint32_t pdi = virt >> 22;
+ uint32_t pti = (virt >> 12) & 0x03FF;
+ return (*(uint32_t *)&paging_current_directory->tables[pdi]->pages[pti]) & 0xFFFFF000;
+}
+
void paging_install()
{
kheap_init();