From 2ac25568839df7af2e271db9efa84bbd6fcb1f88 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 3 May 2020 22:44:24 +0200 Subject: Added missing memory functions --- src/kernel/memory/paging.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/kernel/memory/paging.c') 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(); -- cgit v1.2.3