Merge branch 'lab3' into lab4

This commit is contained in:
2019-05-02 16:12:36 -07:00
2 changed files with 25 additions and 7 deletions

View File

@@ -187,8 +187,6 @@ mem_init(void)
boot_map_region(kern_pgdir,
UPAGES, ROUNDUP(pages_size, PGSIZE),
PADDR(pages), PTE_U);
kern_pgdir[PDX(UPAGES)] |= PTE_U;
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
//////////////////////////////////////////////////////////////////////
// Map the 'envs' array read-only by the user at linear address UENVS
@@ -200,8 +198,6 @@ mem_init(void)
boot_map_region(kern_pgdir,
UENVS, ROUNDUP(envs_size, PGSIZE),
PADDR(envs), PTE_U);
kern_pgdir[PDX(UENVS)] |= PTE_U;
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
//////////////////////////////////////////////////////////////////////
// Use the physical memory that 'bootstack' refers to as the kernel
@@ -217,8 +213,11 @@ mem_init(void)
boot_map_region(kern_pgdir,
KSTACKTOP-KSTKSIZE, KSTKSIZE,
PADDR(bootstack), PTE_W);
<<<<<<< HEAD
kern_pgdir[PDX(KSTACKTOP-KSTKSIZE)] |= PTE_W;
kern_pgdir[PDX(KSTACKTOP-KSTKSIZE)] &= ~PTE_U;
=======
>>>>>>> lab2
//////////////////////////////////////////////////////////////////////
// Map all of physical memory at KERNBASE.
@@ -231,9 +230,6 @@ mem_init(void)
boot_map_region(kern_pgdir,
KERNBASE, 0x100000000 - KERNBASE,
0, PTE_W);
kern_pgdir[PDX(KERNBASE)] |= PTE_W | PTE_P;
kern_pgdir[PDX(KERNBASE)] &= ~PTE_U;
// Initialize the SMP-related parts of the memory map
mem_init_mp();