diff options
author | AlmuHS <almuhs@github.com> | 2019-05-05 17:14:45 +0200 |
---|---|---|
committer | AlmuHS <almuhs@github.com> | 2019-05-05 17:15:36 +0200 |
commit | 2df0c646aa188aab00f2b119574da61a94353b59 (patch) | |
tree | a61de5feaafff9e0d71f4baf63e94aa252688d10 | |
parent | 4a3c2034436a02bd4f6e4178e370e882aa12e5e6 (diff) |
experiment: try to enable pagging
-rw-r--r-- | i386/i386/cpuboot.S | 21 | ||||
-rw-r--r-- | i386/i386/mp_desc.c | 11 |
2 files changed, 30 insertions, 2 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S index e19e7a5c..9d40d53e 100644 --- a/i386/i386/cpuboot.S +++ b/i386/i386/cpuboot.S @@ -96,10 +96,27 @@ _apboot: popf pushl stack_ptr - - call cpu_ap_main cli + /* Initialize pagging */ + mov kernel_page_dir, %eax + add KERNELBASE,%eax + mov %eax, %cr3 + + mov %cr0,%eax + or $0x80010000,%eax + + mov %eax,%cr0 + mov %cr0,%eax + and $0x9fffffff,%eax + mov %eax,%cr0 + mov %cr4,%eax + or $0x80,%al + mov %eax,%cr4 + + call cpu_ap_main + + .align 0x10 gdt_descr_tmp: .short 0x8*3 - 1 diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.c index 1c8ca47d..eff54c87 100644 --- a/i386/i386/mp_desc.c +++ b/i386/i386/mp_desc.c @@ -346,6 +346,16 @@ cpu_setup() break; } +#if 0 + +#ifdef MACH_PV_PAGETABLES + for (i = 0; i < PDPNUM; i++) + pmap_set_page_readonly_init((void*) kernel_page_dir + i * INTEL_PGBYTES); +#if PAE + pmap_set_page_readonly_init(kernel_pmap->pdpbase); +#endif /* PAE */ +#endif /* MACH_PV_PAGETABLES */ + #if PAE set_cr3((unsigned)_kvtophys(kernel_pmap->pdpbase)); #ifndef MACH_HYP @@ -367,6 +377,7 @@ cpu_setup() set_cr4(get_cr4() | CR4_PGE); #endif /* MACH_HYP */ +#endif //slave_main(i); printf("cpu %d enabled\n", cpu_number()); |