Fix permissions.
This commit is contained in:
parent
f0e2ab8abd
commit
f4e3196494
|
@ -183,8 +183,8 @@ mem_init(void)
|
||||||
// Your code goes here:
|
// Your code goes here:
|
||||||
boot_map_region(kern_pgdir,
|
boot_map_region(kern_pgdir,
|
||||||
UPAGES, ROUNDUP(pages_size, PGSIZE),
|
UPAGES, ROUNDUP(pages_size, PGSIZE),
|
||||||
PADDR(pages), PTE_W);
|
PADDR(pages), PTE_U);
|
||||||
kern_pgdir[PDX(UPAGES)] |= PTE_U | PTE_P;
|
kern_pgdir[PDX(UPAGES)] |= PTE_U;
|
||||||
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
|
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
@ -196,7 +196,7 @@ mem_init(void)
|
||||||
// LAB 3: Your code here.
|
// LAB 3: Your code here.
|
||||||
boot_map_region(kern_pgdir,
|
boot_map_region(kern_pgdir,
|
||||||
UENVS, ROUNDUP(envs_size, PGSIZE),
|
UENVS, ROUNDUP(envs_size, PGSIZE),
|
||||||
PADDR(envs), PTE_W);
|
PADDR(envs), PTE_U);
|
||||||
kern_pgdir[PDX(UENVS)] |= PTE_U;
|
kern_pgdir[PDX(UENVS)] |= PTE_U;
|
||||||
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
|
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user