Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

SSE in HDPMI / bug (c/c) (DOSX)

posted by DOS386, 04.01.2008, 10:20

> HDPMI does it.

Evidence, please :lol3:

;*** server initialization when first client starts
;--- DS=DGROUP, ES=FLAT

                @ResetTrace

_init2server_pm proc near

                pushad
                assume  ds:DGROUP

                @strout <"#init2server_pm enter",lf>
if _LTRACE_       
        test fMode, FM_CLONE
        jz @F
        @waitesckey
@@:
endif
    test byte ptr dwFeatures+3, 2 ; Is SSE supported?
    jz @F                 
    @mov_eax_cr4
    or ah,2                       ; or ah,2 -> or ax,$0200 -> bit 9 :lol:
    @mov_cr4_eax
@@:

if ?KDSUPP
if ?EARLYDBGINIT eq 0
                call    initdebugger_pm
endif
endif


Less beautiful (but working):

;--- the lgdt,sgdt,lidt and sidt opcodes
;--- are CS Default bit dependant!
;--- in 16bit code segments the highest byte of the address
;--- is *not* loaded without prefix 66h!

@lgdt   macro x
                db 66h
                lgdt x
                endm
@sgdt   macro x
                db 66h
                sgdt x
                endm
@lidt   macro x
                db 66h
                lidt x
                endm
@sidt   macro x
                db 66h
                sidt x
                endm

@mov_eax_cr4 macro
;       mov eax, cr4
                db 0Fh,20h,0E0h
                endm

@mov_cr4_eax macro
;       mov cr4, eax
                db 0Fh,22h,0E0h
                endm

@cpuid  macro
;               cpuid
                db 0Fh,0A2h
                endm


But seems I found a (critical/criminal) bug:

   Additionally, some privileged opcodes are emulated:   
   - HLT (F4)
   - MOV reg,CRx (0F 20 xx) - using ESP for <reg> will not work!
   - MOV CRx,reg (0F 22 xx) - using ESP for <reg> will not work!


but

?CMPCR3       = 1  ;std 1: 1=improves performance by 2-3%
?EMUMOVREGCRX = 1  ;std 1: emulate mov reg, crX (req. by 32rtm!)
?EMUMOVCRXREG = 1  ;std 1: emulate mov crX, reg
?EMUMOVCR0REG = 0  ;std 0: emulate mov cr0, reg :no:
?EMUMOVREGDRX = 0  ;std 0: emulate mov reg, drX
?EMUMOVDRXREG = 0  ;std 0: emulate mov drX, reg
?SUPP32RTM    = 1  ;std 1: support int2f, ax=168a, "VIRTUAL SUPPORT"
?CATCHREBOOT  = 1  ;std 1; catch ctrl-alt-delete


:confused:

---
This is a LOGITECH mouse driver, but some software expect here
the following string:*** This is Copyright 1983 Microsoft ***

 

Complete thread:

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