On Mon, 2 Aug 1999, Alex Holden wrote:
> On Fri, 30 Jul 1999, Greg Haerr wrote:
> > I see. Does anyone have any code for auto-detection of an
> > 8087/8287/8387?
> >From allegro/src/cpu.c:
Here's another one.
>From linux/arch/i386/kernel/head.S:
/*
* We depend on ET to be correct. This checks for 287/387.
*/
check_x87:
movb $0,X86_HARD_MATH
clts
fninit
fstsw %ax
cmpb $0,%al
je 1f
movl %cr0,%eax /* no coprocessor: have to set bits */
xorl $4,%eax /* set EM */
movl %eax,%cr0
ret
ALIGN
1: movb $1,X86_HARD_MATH
.byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */
ret
--------------- Linux- the choice of a GNU generation. --------------
: Alex Holden (M1CJD)- Caver, Programmer, Land Rover nut, Radio Ham :
-------------------- http://www.linuxhacker.org/ --------------------