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 /i386/i386/cpuboot.S | |
parent | 4a3c2034436a02bd4f6e4178e370e882aa12e5e6 (diff) |
experiment: try to enable pagging
Diffstat (limited to 'i386/i386/cpuboot.S')
-rw-r--r-- | i386/i386/cpuboot.S | 21 |
1 files changed, 19 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 |