From 17d50fff3b9ce81003a923f915f12ae471b0083a Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sat, 3 Aug 2002 02:02:15 +0000 Subject: [PATCH] Disable the A20 line upon exec (int21/ah=4B). This is necessary for some brain-dead exepacked programs. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@402 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/kernel.asm | 36 ++++++++++++++++++++++++++++-------- kernel/procsupt.asm | 3 ++- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/kernel/kernel.asm b/kernel/kernel.asm index 610d8a8..030937e 100644 --- a/kernel/kernel.asm +++ b/kernel/kernel.asm @@ -574,6 +574,15 @@ _prev_user_r: prev_int21regs_off dw 0 ;2D0 - pointer to prev int 21 frame prev_int21regs_seg dw 0 + ; Pad to 02ddh + times (2ddh - ($ - _internal_data)) db 0 + global _ext_open_action + global _ext_open_attrib + global _ext_open_mode +_ext_open_action dw 0 ;2DD - extended open action +_ext_open_attrib dw 0 ;2DF - extended open attrib +_ext_open_mode dw 0 ;2E1 - extended open mode + ; Pad to 0620h times (300h - ($ - _internal_data)) db 0 global _szNames @@ -883,14 +892,7 @@ forceEnableA20retry: ; ; ok, we have to enable A20 )at least seems so ; - ; some debug first - ; push bx - ; mov ah, 0eh - ; mov al, 'H' - ; mov bx, 0007h - ; int 10h - ; pop bx - + call far __EnableA20 jmp short forceEnableA20retry @@ -903,9 +905,27 @@ forceEnableA20success: pop ds ret +; +; global f*cking compatibility issues: +; +; very old brain dead software (PKLITE, copyright 1990) +; forces us to execute with A20 disabled +; +global _ExecUserDisableA20 +_ExecUserDisableA20: + cmp word [cs:_XMSDriverAddress],0 + jne NeedToDisable + cmp word [cs:_XMSDriverAddress+2],0 + je noNeedToDisable +NeedToDisable: + push ax + call far __DisableA20 + pop ax +noNeedToDisable: + iret segment _TEXT diff --git a/kernel/procsupt.asm b/kernel/procsupt.asm index f89c7e5..582b1b8 100644 --- a/kernel/procsupt.asm +++ b/kernel/procsupt.asm @@ -67,7 +67,8 @@ _exec_user: sti ; POP$ALL - iret + extern _ExecUserDisableA20 + jmp far _ExecUserDisableA20 segment _TEXT