diff --git a/kernel/init-mod.h b/kernel/init-mod.h index 8300170..86cd1f4 100644 --- a/kernel/init-mod.h +++ b/kernel/init-mod.h @@ -269,12 +269,17 @@ extern struct RelocationTable DOSTEXTFAR ASM _HMARelocationTableEnd[]; extern void FAR *DOSTEXTFAR ASM XMSDriverAddress; -extern VOID ASMCFUNC FAR _EnableA20(VOID); -extern VOID ASMCFUNC FAR _DisableA20(VOID); +extern VOID ASMPASCAL FAR _EnableA20(VOID); +extern VOID ASMPASCAL FAR _DisableA20(VOID); -extern void FAR * ASMCFUNC DetectXMSDriver(VOID); -extern int ASMCFUNC init_call_XMScall(void FAR * driverAddress, UWORD ax, +extern void FAR * ASMPASCAL DetectXMSDriver(VOID); +extern int ASMPASCAL init_call_XMScall(void FAR * driverAddress, UWORD ax, UWORD dx); +#ifdef __WATCOMC__ +#pragma aux (pascal) DetectXMSDriver modify exact [ax dx] +#pragma aux (pascal) _EnableA20 modify exact [ax] +#pragma aux (pascal) _DisableA20 modify exact [ax] +#endif #if defined(WATCOM) && 0 ULONG ASMCFUNC FAR MULULUS(ULONG mul1, UWORD mul2); /* MULtiply ULong by UShort */ diff --git a/kernel/intr.asm b/kernel/intr.asm index 57d3141..b6ca61a 100644 --- a/kernel/intr.asm +++ b/kernel/intr.asm @@ -141,21 +141,23 @@ INIT_CALL_INTR: ; ; this calls HIMEM.SYS ; - global _init_call_XMScall -_init_call_XMScall: - push bp - mov bp,sp - - mov ax,[bp+8] - mov dx,[bp+10] - call far [bp+4] + global INIT_CALL_XMSCALL +INIT_CALL_XMSCALL: + pop bx ; ret address + pop dx + pop ax + pop cx ; driver address + pop es - pop bp - ret + push cs ; ret address + push bx + push es ; driver address ("jmp es:cx") + push cx + retf ; void FAR *DetectXMSDriver(VOID) -global _DetectXMSDriver -_DetectXMSDriver: +global DETECTXMSDRIVER +DETECTXMSDRIVER: mov ax, 4300h int 2fh ; XMS installation check diff --git a/kernel/kernel.asm b/kernel/kernel.asm index acad9be..01aa7fb 100644 --- a/kernel/kernel.asm +++ b/kernel/kernel.asm @@ -858,8 +858,8 @@ _XMSDriverAddress: dw 0 ; XMS driver, if detected dw 0 - global __EnableA20 -__EnableA20: + global _ENABLEA20 +_ENABLEA20: mov ah,5 UsingXMSdriver: push bx @@ -867,8 +867,8 @@ UsingXMSdriver: pop bx retf - global __DisableA20 -__DisableA20: + global _DISABLEA20 +_DISABLEA20: mov ah,6 jmp short UsingXMSdriver @@ -906,7 +906,7 @@ forceEnableA20retry: ; ok, we have to enable A20 )at least seems so ; - call far __EnableA20 + call far _ENABLEA20 jmp short forceEnableA20retry @@ -935,7 +935,7 @@ _ExecUserDisableA20: je noNeedToDisable NeedToDisable: push ax - call far __DisableA20 + call far _DISABLEA20 pop ax noNeedToDisable: iret