summaryrefslogtreecommitdiff
path: root/i386/i386/cpuboot.S
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-05-05 17:14:45 +0200
committerAlmuHS <almuhs@github.com>2019-05-05 17:14:45 +0200
commitf5ddb41d7cf82bc4900f29030320f488580fedbf (patch)
tree5fec005f60cbba83280781eafc1cea29f282a2e0 /i386/i386/cpuboot.S
parent4a3c2034436a02bd4f6e4178e370e882aa12e5e6 (diff)
experiment: try to enable pagging
Diffstat (limited to 'i386/i386/cpuboot.S')
-rw-r--r--i386/i386/cpuboot.S16
1 files changed, 16 insertions, 0 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S
index e19e7a5c..544a1329 100644
--- a/i386/i386/cpuboot.S
+++ b/i386/i386/cpuboot.S
@@ -100,6 +100,22 @@ _apboot:
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
+
.align 0x10
gdt_descr_tmp:
.short 0x8*3 - 1