diff options
author | dzwdz | 2022-07-16 19:35:05 +0200 |
---|---|---|
committer | dzwdz | 2022-07-16 19:35:05 +0200 |
commit | b26098268eb443f1ed3dc50d902b2beee40c8342 (patch) | |
tree | 1b7bf720cde8e68fe1f446a414f38f4f63175227 /src/kernel/arch/amd64/pagedir.c | |
parent | ce80ee8d40b0a2b48bfbbceac9a0baee189c5e1b (diff) |
amd64: seemingly working syscalls (SYSCALL/SYSRET)
Diffstat (limited to 'src/kernel/arch/amd64/pagedir.c')
-rw-r--r-- | src/kernel/arch/amd64/pagedir.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/kernel/arch/amd64/pagedir.c b/src/kernel/arch/amd64/pagedir.c index 135770d..56c541a 100644 --- a/src/kernel/arch/amd64/pagedir.c +++ b/src/kernel/arch/amd64/pagedir.c @@ -129,6 +129,7 @@ void pagedir_map(struct pagedir *dir, void __user *virt, void *phys, pml4e = &dir->e[v.pml4]; if (!pml4e->present) { + kprintf("allocating pdpt\n"); pml4e->as_ptr = addr_validate(page_zalloc(1)); pml4e->present = 1; pml4e->writeable = 1; @@ -138,6 +139,7 @@ void pagedir_map(struct pagedir *dir, void __user *virt, void *phys, pdpte = &((pe_generic_t*)addr_extract(*pml4e))[v.pdpt]; if (!pdpte->present) { + kprintf("allocating pd\n"); pdpte->as_ptr = addr_validate(page_zalloc(1)); pdpte->present = 1; pdpte->writeable = 1; @@ -147,6 +149,7 @@ void pagedir_map(struct pagedir *dir, void __user *virt, void *phys, pde = &((pe_generic_t*)addr_extract(*pdpte))[v.pd]; if (!pde->present) { + kprintf("allocating pt\n"); pde->as_ptr = addr_validate(page_zalloc(1)); pde->present = 1; pde->writeable = 1; @@ -156,7 +159,7 @@ void pagedir_map(struct pagedir *dir, void __user *virt, void *phys, pte = &((pe_generic_t*)addr_extract(*pde))[v.pt]; if (!pte->present) { - pte->as_ptr = addr_validate(page_zalloc(1)); + pte->address = ((uintptr_t)phys) >> 12; pte->present = 1; pte->writeable = writeable; pte->user = user; |