Boot framework rework (#45)
[lunaix-os.git] / lunaix-os / arch / x86 / boot / x86_64 / init64.c
1 #include "sys/boot/archinit.h"
2 #include "sys/crx.h"
3 #include "sys/cpu.h"
4
5 ptr_t __multiboot_addr boot_data;
6
7 void boot_text
8 x86_init(ptr_t mb)
9 {
10     __multiboot_addr = mb;
11
12     cr4_setfeature(CR4_PCIDE);
13
14     ptr_t pagetable = kpg_init();
15     cpu_chvmspace(pagetable);
16
17     cr0_unsetfeature(CR0_WP | CR0_EM);
18     cr0_setfeature(CR0_MP);
19 }