http://bugzilla.openwatcom.org/show_bug.cgi?id=1161
Summary: __x87id FPU detection routine locks up on 8088 without
FPU
Product: Open Watcom Libraries
Version: OW 1.9
Platform: All (Generic)
OS/Version: All
Status: UNCONFIRMED
Severity: normal
Priority: --
Component: C libraries
AssignedTo:
openwatco...@openwatcom.org
ReportedBy:
sc...@scali.eu.org
This code in the __x87id proc in ini87086.asm will lock up on an 8088 without
FPU:
sub AX,AX
push AX ; allocate space for status word
finit ; use default infinity mode
fstcw word ptr [BP-2] ; save control word
fwait
pop AX
mov AL,0
cmp AH,3
jnz nox87
The reason is that the fwaits will wait forever for the FPU to clear the bus.
Instead, I suggest this method to detect an FPU on all systems (based on an
example from Intel):
fninit
mov AX,5A5Ah
push AX
fnstsw word ptr [BP-2]
pop AX
cmp AL, 0
mov AL, 0
jnz nox87
The fninit is a 'bare' finit, without a wait prefix.
If there is no 8087, it will just do nothing.
Then the fnstsw will store the status word, if there is an 8087... Else it does
nothing.
After the finit, the status word should always be 0. So, if the value is now 0,
we have an FPU, else we don't.
--
Configure bugmail:
http://bugzilla.openwatcom.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.