kernel: fpu init to separate function; also move fpu init down

moving the fpu code causes exceptions raised by it to be trapped
neatly instead of causing a triple fault, before the IDT is initialized.
This commit is contained in:
Ben Gras 2010-04-28 13:25:29 +00:00
parent f9317dc039
commit c37401f23f

View file

@ -136,7 +136,7 @@ PRIVATE void tss_init(struct tss_s * tss, void * kernel_stack,
*((reg_t *)(tss->sp0 + 1 * sizeof(reg_t))) = cpu; *((reg_t *)(tss->sp0 + 1 * sizeof(reg_t))) = cpu;
} }
PUBLIC void arch_init(void) PRIVATE void fpu_init(void)
{ {
unsigned short cw, sw; unsigned short cw, sw;
@ -184,7 +184,10 @@ PUBLIC void arch_init(void)
osfxsr_feature = 0; osfxsr_feature = 0;
return; return;
} }
}
PUBLIC void arch_init(void)
{
#ifdef CONFIG_APIC #ifdef CONFIG_APIC
/* /*
* this is setting kernel segments to cover most of the phys memory. The * this is setting kernel segments to cover most of the phys memory. The
@ -208,6 +211,7 @@ PUBLIC void arch_init(void)
} }
#endif #endif
fpu_init();
} }
#define COM1_BASE 0x3F8 #define COM1_BASE 0x3F8