diff options
author | Freya Murphy <freya@freyacat.org> | 2024-01-29 13:22:50 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-01-29 13:22:50 -0500 |
commit | e71a141533c742d05c0612d3a87ffb3810a4b5de (patch) | |
tree | 06f8b5f8d33b287e8443caa65dea4abb64a5d3c4 /src/arch/amd64/shim.c | |
parent | changes (diff) | |
download | corn-e71a141533c742d05c0612d3a87ffb3810a4b5de.tar.gz corn-e71a141533c742d05c0612d3a87ffb3810a4b5de.tar.bz2 corn-e71a141533c742d05c0612d3a87ffb3810a4b5de.zip |
memory works
Diffstat (limited to 'src/arch/amd64/shim.c')
-rw-r--r-- | src/arch/amd64/shim.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/arch/amd64/shim.c b/src/arch/amd64/shim.c index dcd37bf..4afa6d2 100644 --- a/src/arch/amd64/shim.c +++ b/src/arch/amd64/shim.c @@ -4,23 +4,17 @@ #include <shim.h> #include <memory.h> +#include "paging.h" #include "mboot.h" static struct boot_info boot_info; // entry point for amd64 void* amd64_shim(void *mboot_data_ptr) { - //struct pml4e *pml4 = (struct pml4e *)0x1000; - //struct pdpte *pdpt = (struct pdpte *)0x2000; - //struct pde *pd = (struct pde *)0x3000; - //struct pte *pt = (struct pte *)0x4000; - //pd[1].flags = F_PRESENT | F_WRITEABLE; - //pd[1].address = ((uint64_t)pt) >> 12; - //map_page(pml4, (void *)0x80000000, (void *)0xB8002, F_WRITEABLE); - //__asm("invlpg 0x200000"); - //void *ret; - //find_phys_addr(pml4, (void *)0x80000000, &ret); - //return ret; + serial_init(); + paging_init(); + + kmap_page(mboot_data_ptr, mboot_data_ptr, F_WRITEABLE); struct mboot_info mboot_info; mboot_info = mboot_load_info(mboot_data_ptr); |