diff --git a/arch/x86/kernel/entry.asm b/arch/x86/kernel/entry.asm index 80ab63b8..9f15bc05 100644 --- a/arch/x86/kernel/entry.asm +++ b/arch/x86/kernel/entry.asm @@ -64,6 +64,21 @@ ALIGN 4 stublet: ; initialize stack pointer. mov esp, default_stack_pointer +; initialize cpu features + call cpu_init +; interpret multiboot information + extern multiboot_init + push ebx + call multiboot_init + add esp, 4 + +; jump to the boot processors's C code + extern main + call main + jmp $ + +global cpu_init +cpu_init: mov eax, cr0 ; enable caching, disable paging and fpu emulation and eax, 0x1ffffffb @@ -77,16 +92,7 @@ stublet: mov eax, cr4 and eax, 0xfffbf9ff mov cr4, eax -; interpret multiboot information - extern multiboot_init - push ebx - call multiboot_init - add esp, 4 - -; jump to the boot processors's C code - extern main - call main - jmp $ + ret ; This will set up our new segment registers. We need to do ; something special in order to set CS. We do what is called a