From 47e6cd42f0744f6c04b8347093f6549339a856c9 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 13 Feb 2015 21:52:48 +0100 Subject: Implement ELF loading ; arrange so that user processes run. --- src/kernel/core/paging.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/kernel/core/paging.c') diff --git a/src/kernel/core/paging.c b/src/kernel/core/paging.c index 74331c0..5a58c8c 100644 --- a/src/kernel/core/paging.c +++ b/src/kernel/core/paging.c @@ -221,7 +221,8 @@ bool pd_map_page(void* vaddr, uint32_t frame_id, bool rw) { } current_pd->page[pt] = pd->page[pt] = - (new_pt_frame << PTE_FRAME_SHIFT) | PTE_PRESENT | PTE_RW; + (new_pt_frame << PTE_FRAME_SHIFT) | PTE_PRESENT | PTE_RW + | ((size_t)vaddr < K_HIGHHALF_ADDR ? PTE_USER : 0); invlpg(¤t_pt[pt]); } current_pt[pt].page[page] = -- cgit v1.2.3