aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/paging.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-13 21:52:48 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-13 21:52:48 +0100
commit47e6cd42f0744f6c04b8347093f6549339a856c9 (patch)
treec91fc43178d136c2aa0f093087ba8cfb4e90bdae /src/kernel/core/paging.c
parentcf0b8a52287ee7c747b1d5a7d77abdef1fb46f94 (diff)
downloadkogata-47e6cd42f0744f6c04b8347093f6549339a856c9.tar.gz
kogata-47e6cd42f0744f6c04b8347093f6549339a856c9.zip
Implement ELF loading ; arrange so that user processes run.
Diffstat (limited to 'src/kernel/core/paging.c')
-rw-r--r--src/kernel/core/paging.c3
1 files changed, 2 insertions, 1 deletions
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(&current_pt[pt]);
}
current_pt[pt].page[page] =