Change some memory mappings.

This commit is contained in:
Danila Fedorin 2019-04-29 21:00:57 -07:00
parent 46cc5c9478
commit 0289ec3b3e
1 changed files with 1 additions and 8 deletions

View File

@ -175,9 +175,7 @@ mem_init(void)
// Your code goes here:
boot_map_region(kern_pgdir,
UPAGES, ROUNDUP(pages_size, PGSIZE),
PADDR(pages), PTE_W);
kern_pgdir[PDX(UPAGES)] |= PTE_U | PTE_P;
kern_pgdir[PDX(UPAGES)] &= ~PTE_W;
PADDR(pages), PTE_U);
//////////////////////////////////////////////////////////////////////
// Use the physical memory that 'bootstack' refers to as the kernel
@ -193,8 +191,6 @@ mem_init(void)
boot_map_region(kern_pgdir,
KSTACKTOP-KSTKSIZE, KSTKSIZE,
PADDR(bootstack), PTE_W);
kern_pgdir[PDX(KSTACKTOP-KSTKSIZE)] |= PTE_W | PTE_P;
kern_pgdir[PDX(KSTACKTOP-KSTKSIZE)] &= ~PTE_U;
//////////////////////////////////////////////////////////////////////
// Map all of physical memory at KERNBASE.
@ -207,9 +203,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;
// Check that the initial page directory has been set up correctly.
check_kern_pgdir();