Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

SSE in DOS under JEMM386 ?? (DOSX)

posted by Rugxulo Homepage, Usono, 09.01.2008, 10:46
(edited by Rugxulo on 09.01.2008, 11:03)

> Turn off the Emulate Math bit and turn on the Monitor Processor bit
> (something about FPU WAIT or whatever). Then, turn on the OSFXSR bit (if
> available, to tell the cpu that the OS supports SSE).

(quoting Intel's 25366821.PDF, aka "Intel 64 and IA-32 Architectures
Software Developer's Manual Volume 3A: System Programming Guide, Part 1"):

"As on the Intel 286 and Intel386 processors, the MP (monitor coprocessor) flag (bit 1 of register CR0) determines whether the WAIT/FWAIT instructions or waiting-type floating-point instructions trap when the context of the x87 FPU is different from that of the currently-executing task. If the MP and TS flag are set, then a WAIT/FWAIT instruction and waiting instructions will cause a device-not-available exception (interrupt vector 7). The MP flag is used on the Intel 286 and Intel386 processors to support the use of a WAIT/FWAIT instruction to wait on a device other than a math coprocessor. The device reports its status through the BUSY# pin. Since the P6 family, Pentium, and Intel486 processors do not have such a pin, the MP flag has no
relevant use and should be set to 1 for normal operation."

This is in contrast to Causeway/CW402's source:

.586p
mov     eax,1
cpuid
and     edx,3000000h    ; only want SSE and FXSR bit status
cmp     edx,3000000h
jne     nosse           ; both bits required
mov     eax,cr0
and     al,NOT 6        ; clear EM and MP bits
mov     cr0,eax
mov     eax,cr4
or      ax,200h         ; set OSFXFR bit to allow SSE instructions
mov     cr4,eax


But Intel also says flags should be set as this for a 486 Sx (which has no FPU): EM (1), MP (0), NE (1).

> Floating-point instructions trap to emulator; WAIT/FWAIT and
> other waiting-type instructions ignore TS.

Okay, a bit out of my league, but I still found it interesting. ;-)

---
Know your limits.h

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 304 users online (1 registered, 303 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum