diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-13 21:52:48 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-02-13 21:52:48 +0100 |
commit | 47e6cd42f0744f6c04b8347093f6549339a856c9 (patch) | |
tree | c91fc43178d136c2aa0f093087ba8cfb4e90bdae /src/kernel/core/paging.c | |
parent | cf0b8a52287ee7c747b1d5a7d77abdef1fb46f94 (diff) | |
download | kogata-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.c | 3 |
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(¤t_pt[pt]); } current_pt[pt].page[page] = |