From f9f2a082c1474f45ecd9a06e7dd572ace9a2aab1 Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Sun, 20 Nov 2005 19:03:17 +0000 Subject: [PATCH] cleaner push immediate from Arkady and note big bug to be fixed git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1157 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/intwrap.asm | 11 +++++------ kernel/kernel.asm | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/kernel/intwrap.asm b/kernel/intwrap.asm index 6c642a5..4f20ad2 100644 --- a/kernel/intwrap.asm +++ b/kernel/intwrap.asm @@ -50,6 +50,7 @@ reloc_call_int13_handler: stc ; force error unless BIOS clears push dx ; store BIOS drive # for error handling usage +;TODO FIX this alters DS which is used by some subfunctions!!! push ds ; get segment of kernel DATA mov ds, [cs:_DGROUP_] pushf ; simulate int call so returns back here (flags+cs:ip on stack) @@ -61,7 +62,6 @@ reloc_call_int13_handler: int13iret: inc sp ; clean up stack inc sp - sti ; ensure int's are renabled retf 2 ; return to caller leaving flags asis int13err: @@ -78,11 +78,10 @@ int13err: int13wrap: %IF XCPU < 186 - push ax ; preserve registers, setup stack frame + push bp push bp mov bp, sp - mov ax, 13h ; want to push 0x13 onto stack - xchg ax, [bp+2] ; so restore pushed ax value and put 0x13 on stack + mov [bp+2], word 13h ; do the push 0x13 onto stack pop bp ; clean up stack frame (leaving just 0x13 pushed on stack) %ELSE push 13h ; the 186+ way to push a constant on the stack @@ -141,7 +140,7 @@ intWrapCall: -#if 0 +%IF 0 ; receives int 19h request, resets various int values, ; clears hma if in use, and finally invokes original handler, @@ -158,4 +157,4 @@ reloc_call_int19_handler: mov ax, 19h ; handler for int 19h push ax jmp intWrapCall -#endif +%ENDIF diff --git a/kernel/kernel.asm b/kernel/kernel.asm index b95cf78..c2c2f70 100644 --- a/kernel/kernel.asm +++ b/kernel/kernel.asm @@ -867,12 +867,12 @@ __HMARelocationTableStart: _int13_handler: jmp 0:reloc_call_int13_handler call near forceEnableA20 -#if 0 +%IF 0 global _int19_handler extern reloc_call_int19_handler _int19_handler: jmp 0:reloc_call_int19_handler call near forceEnableA20 -#endif +%ENDIF global _int2f_handler extern reloc_call_int2f_handler