Framework for exporting system header to user space (#59)
[lunaix-os.git] / lunaix-os / arch / x86 / boot / x86_64 / init64.c
1 #include "sys/boot/archinit.h"
2 #include "asm/x86_cpu.h"
3
4 ptr_t __multiboot_addr boot_data;
5
6 void boot_text
7 x86_init(ptr_t mb)
8 {
9     __multiboot_addr = mb;
10
11     cr4_setfeature(CR4_PCIDE);
12
13     ptr_t pagetable = kpg_init();
14     cpu_chvmspace(pagetable);
15
16     cr0_unsetfeature(CR0_WP | CR0_EM);
17     cr0_setfeature(CR0_MP);
18 }