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:
parent
f9317dc039
commit
c37401f23f
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue