diff options
author | Marvin Borner | 2020-05-03 22:44:24 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-03 22:44:24 +0200 |
commit | 2ac25568839df7af2e271db9efa84bbd6fcb1f88 (patch) | |
tree | 3747958b729275c07115c579def55d246d72669e /src/kernel/memory/paging.c | |
parent | 5a02853da5c454ff34e65ddaea5e677a3285bc79 (diff) |
Added missing memory functions
Diffstat (limited to 'src/kernel/memory/paging.c')
-rw-r--r-- | src/kernel/memory/paging.c | 8 |
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(); |