VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

How should a x86 emulator respond to FPU opcodes (FWAIT and ESC) without a FPU present? I've just adjusted FINIT to do nothing, FSTSW, FNSTSW and FNSTCW to write FFFFh to the destination r/m16. And all other FPU opcodes do nothing (NOP).

And when CR0.TS or CR0.EM is set, it will trigger a #NM exception to allow the software to emulate it properly (or fault if it wants to).

What happens on real hardware with this x86 CPU without FPU? How is it actually detected to be properly not present?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 2, by superfury

User metadata
Rank l33t++
Rank
l33t++

I've already made those opcodes write all-ones to memory or registers when used (for those mentioned FPU opcodes that save the state or status word). Dind't implement any non-1 data fields in the data yet.

But the BIOS still thinks that there is a FPU present, which there isn't. And the BIOS itself is too large (lots of nested functions) to easily figure out what's causing this issue.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io