Change some memory mappings.
This commit is contained in:
parent
46cc5c9478
commit
0289ec3b3e
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user