Skip to content

Commit b0951a0

Browse files
hdpmi: fixed int 31h, ax=301h/302h
1 parent 8949b31 commit b0951a0

File tree

7 files changed

+97
-124
lines changed

7 files changed

+97
-124
lines changed

Src/DPMILDR/DPMILDR.ASM

Lines changed: 3 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ endif
8080

8181
?RESETDEFPATH = 0 ;0 1= reset szPath? No, currently this is done
8282
; every time a .EXE is loaded
83-
?PSPSAVEI2FADDR = 007Ch ;address in PSP to save int vector 2Fh
8483

8584
if ?HDPMI
8685
_COPY2PSP_ = 0
@@ -505,20 +504,6 @@ _TEXT segment
505504
wLdrDS label word
506505
jmp overlayentry
507506

508-
if ?DISABLESERVER ;obsolete
509-
510-
int2frm:
511-
if ?HIDENEASWELL
512-
cmp ah, 16h
513-
else
514-
cmp ax, 1687h
515-
endif
516-
jz @F
517-
jmp dword ptr cs:[?PSPSAVEI2FADDR]
518-
@@:
519-
iret
520-
endif
521-
522507
if _COPY2PSP_
523508
psp_rou:
524509
int 31h ;free extended memory
@@ -1660,32 +1645,26 @@ endif
16601645
int214b_1:
16611646
endif
16621647
xor cx,cx
1663-
if ?DISABLESERVER
1664-
call disableserver
1665-
endif
16661648
if ?32BIT
1667-
if ?DOSEMUSUPP
1649+
if ?DOSEMUSUPP
16681650
test cs:fMode, FMODE_DOSEMU
16691651
jz @F
16701652
call __loadpgm
16711653
jmp loadpgmdone
16721654
@@:
1673-
endif
1655+
endif
16741656
endif
16751657

16761658
;------------------- here there was code to reset int21
16771659
;------------------- so the loader does not intercept int 21, ah=4ch
16781660
;------------------- of the now launched program (if it is a pm app)
16791661
;------------------- but it seems better to check in int21,ah=4ch
16801662
;------------------- if the terminating app is one started by the loader
1681-
call doscall ;exec (real mode) program
1663+
call doscall ;exec (real mode) program
16821664
loadpgmdone:
16831665
pushf
16841666
@trace_s <lf,"-------------------------------------------",lf>
16851667
@trace_s <"dpmildr 21-4bh: back from int 21h, ax=4B00h",lf>
1686-
if ?DISABLESERVER
1687-
call enableserver
1688-
endif
16891668
popf
16901669
pushf
16911670
if _LASTRC_
@@ -2002,52 +1981,6 @@ __loadpgm endp
20021981
endif
20031982
endif
20041983

2005-
if ?DISABLESERVER ;obsolete
2006-
2007-
disableserver proc uses ds
2008-
if 1
2009-
mov ds, cs:[wLdrPSP]
2010-
mov word ptr ds:[?PSPSAVEI2FADDR+2],0
2011-
endif
2012-
test cs:[bEnvFlgs], ENVFL_LOAD1APPONLY
2013-
jz exit
2014-
if 0
2015-
cmp cs:[wTasks], 0 ;is anything loaded at all?
2016-
jz exit
2017-
endif
2018-
pusha
2019-
mov bl, 2fh
2020-
mov ax, 200h
2021-
int 31h
2022-
mov ds:[?PSPSAVEI2FADDR+0],dx
2023-
mov ds:[?PSPSAVEI2FADDR+2],cx
2024-
mov cx, cs:[wPSPSegm]
2025-
mov dx, 0100h+offset int2frm
2026-
mov ax, 0201h
2027-
int 31h
2028-
popa
2029-
exit:
2030-
ret
2031-
disableserver endp
2032-
2033-
enableserver proc public uses ds
2034-
pusha
2035-
mov ds, cs:[wLdrPSP]
2036-
xor dx,dx
2037-
xor cx,cx
2038-
xchg dx, ds:[?PSPSAVEI2FADDR+0]
2039-
xchg cx, ds:[?PSPSAVEI2FADDR+2]
2040-
jcxz @F
2041-
mov bl, 2fh
2042-
mov ax, 0201h
2043-
int 31h
2044-
@@:
2045-
popa
2046-
ret
2047-
enableserver endp
2048-
2049-
endif
2050-
20511984
if ?SUPAPPTITLE
20521985

20531986
;*** prepare call of SetAppTitle

Src/DPMILDR/DPMILDR.INC

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ endif
2424
?INT23RES = 1 ;1, restore int 23
2525
?INT41SUPPORT = 1 ;1, support Int 41h debugging messages
2626
?SUPAPPTITLE = 1 ;1, support for "application title" (win9x only, in rm!)
27-
?DISABLESERVER = 0 ;0, 1=disable DPMI server for next task if DPMILDR=8;
28-
; since HDPMI=32 exists, this is now obsolete
2927
?SETDTA = 1 ;1, 1=for ?MULTPSP: init DTA to PSP:80 on start
3028
?ZEROHIWORDEBP = 1 ;1, 1=if ?32BIT clear hiword(ebp) before 16-bit proc is called.
3129
; this is essentially for ENTER/LEAVE instructions!

Src/HDPMI/EXCEPT.ASM

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,16 @@ if 0 ;v3.23: reverted - this caused severe problems with exc display in v3.22
323323
mov bPICMask, al
324324
mov al,-1
325325
out 21h, al
326-
else
327326
endif
328327
;--- v3.22: prevent reentry thru std rmcbs
329-
;--- v3.23: switch also used to prevent reentry thru internal rmcbs
330-
mov [bNoRMCBEntry], 1
328+
;--- v3.23: switch also used to prevent reentry thru internal rmcbs;
329+
;--- however, activate switch only if at least one rmcb/irq is active!
330+
mov al,0Bh
331+
out 20h,al
332+
in al,20h
333+
cbw
334+
or ax,[cRMCB]
335+
setnz [bNoRMCBEntry]
331336

332337
if ?SAFERMSTACK
333338
push [wHostPSP]

Src/HDPMI/HDPMI.ASM

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,7 @@ callrmsint_rm:
34553455
push cs:[tmpFLReg]
34563456
call cs:[calladdr2]
34573457
pushf
3458+
public callrmsint_brk
34583459
callrmsint_brk::
34593460
@rm2pmbrk
34603461
pop cs:[tmpFLReg]
@@ -6151,15 +6152,15 @@ int1588:
61516152
iretwithNC:
61526153
push bp
61536154
mov bp,sp
6154-
and byte ptr [bp+6],not _CY
6155+
and byte ptr [bp+2].IRETSRM.rFL,not _CY
61556156
pop bp
61566157
iret ;real-mode iret!
61576158
if ?WATCHDOG
61586159
iretwithC:
61596160
popf
61606161
push bp
61616162
mov bp,sp
6162-
or byte ptr [bp+6],_CY
6163+
or byte ptr [bp+2].IRETSRM.rFL,_CY
61636164
pop bp
61646165
iret ;real-mode iret!
61656166
endif

Src/HDPMI/HDPMIHIS.TXT

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
� setting HDPMI=8192 now runs an INT3 instead of setting the trace flag.
1717
� fixed regression in v3.22: interrupts are no longer masked during exc
1818
display, since this may have caused the system to freeze.
19+
� fixed: clear IF in current flags for int 31h, ax=302h, alike ax=300h.
20+
� fixed: ensure that the real-mode part of int 31h, ax=301h is fully
21+
reentrant.
1922

2023
24.03.2025, version 3.22
2124

0 commit comments

Comments
 (0)