add generic kremap for kernel remapping
[lunaix-os.git] / lunaix-os / arch / x86 / boot / i386 / init32.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_OSXMMEXCPT | CR4_OSFXSR | CR4_PSE36);
12
13     ptr_t pagetable = kpg_init();
14     cpu_chvmspace(pagetable);
15
16     cr0_unsetfeature(CR0_WP | CR0_EM);
17     cr0_setfeature(CR0_PG | CR0_MP);
18 }