diff options
Diffstat (limited to '')
-rw-r--r-- | src/arch/amd64/paging.c | 8 | ||||
-rw-r--r-- | src/kmain.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/arch/amd64/paging.c b/src/arch/amd64/paging.c index 3ea79f1..18eb079 100644 --- a/src/arch/amd64/paging.c +++ b/src/arch/amd64/paging.c @@ -88,6 +88,8 @@ load_pml4( void *phys ) { static struct pte *pt = &paging_pt[0]; + if ((uint64_t)phys >> 12 == pt->address) + return; pt->address = (uint64_t)phys >> 12; pt->flags = F_PRESENT | F_WRITEABLE; invlpg(pml4_mapped); @@ -98,6 +100,8 @@ load_pdpt( void *phys ) { static struct pte *pt = &paging_pt[1]; + if ((uint64_t)phys >> 12 == pt->address) + return; pt->address = (uint64_t)phys >> 12; pt->flags = F_PRESENT | F_WRITEABLE; invlpg(pdpt_mapped); @@ -108,6 +112,8 @@ load_pd( void *phys ) { static struct pte *pt = &paging_pt[2]; + if ((uint64_t)phys >> 12 == pt->address) + return; pt->address = (uint64_t)phys >> 12; pt->flags = F_PRESENT | F_WRITEABLE; invlpg(pdpt_mapped); @@ -118,6 +124,8 @@ load_pt( void *phys ) { static struct pte *pt = &paging_pt[3]; + if ((uint64_t)phys >> 12 == pt->address) + return; pt->address = (uint64_t)phys >> 12; pt->flags = F_PRESENT | F_WRITEABLE; invlpg(pt_mapped); diff --git a/src/kmain.c b/src/kmain.c index 057620d..85a051a 100644 --- a/src/kmain.c +++ b/src/kmain.c @@ -16,7 +16,7 @@ void kmain(struct boot_info *info) { *(char*)(0xB8000 + 0x146) = 'i'; while (1) { - //kprintf("ret: 0x%p\n", kalloc(2)); + //kprintf("ret: 0x%p\n", kalloc(1024)); // loop so we dont halt // this allows interrupts to fire } |