diff options
author | Freya Murphy <freya@freyacat.org> | 2024-02-01 14:43:11 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-02-01 14:43:11 -0500 |
commit | 341c95f5357c451e2420fb81e64ec6b42c40e124 (patch) | |
tree | 725afc747d5f0ca9ad4b5e8558f5f1cf178fae9b /src | |
parent | acpi, fix mboot memory map, fix kalloc, fix virtalloc node allocator, add kpr... (diff) | |
download | corn-341c95f5357c451e2420fb81e64ec6b42c40e124.tar.gz corn-341c95f5357c451e2420fb81e64ec6b42c40e124.tar.bz2 corn-341c95f5357c451e2420fb81e64ec6b42c40e124.zip |
update makefile
Diffstat (limited to 'src')
-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 } |