Architectural Support: x86_64 (#37)
[lunaix-os.git] / lunaix-os / arch / x86 / boot / x86_64 / init64.c
diff --git a/lunaix-os/arch/x86/boot/x86_64/init64.c b/lunaix-os/arch/x86/boot/x86_64/init64.c
new file mode 100644 (file)
index 0000000..bab0173
--- /dev/null
@@ -0,0 +1,17 @@
+#include "sys/boot/archinit.h"
+#include "sys/crx.h"
+#include "sys/cpu.h"
+
+void boot_text
+x86_init(struct multiboot_info* mb)
+{
+    mb_parse(mb);
+
+    cr4_setfeature(CR4_PCIDE);
+
+    ptr_t pagetable = kpg_init();
+    cpu_chvmspace(pagetable);
+
+    cr0_unsetfeature(CR0_WP | CR0_EM);
+    cr0_setfeature(CR0_MP);
+}
\ No newline at end of file