Author: aandrejevic
Date: Sat Sep 19 22:12:56 2015
New Revision: 69297
URL:
http://svn.reactos.org/svn/reactos?rev=69297&view=rev
Log:
[NTVDM]
Save and restore the general purpose and segment registers around Int32Call
calls in the BIOS. Also, make sure CF doesn't get set by the called interrupt
procedure.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/bios32.c [iso-8859-1] Sat Sep 19
22:12:56 2015
@@ -721,7 +721,30 @@
* because some programs may hook only BIOS_SYS_TIMER_INTERRUPT
* for their purpose...
*/
+
+ WORD AX = getAX();
+ WORD CX = getCX();
+ WORD DX = getDX();
+ WORD BX = getBX();
+ WORD BP = getBP();
+ WORD SI = getSI();
+ WORD DI = getDI();
+ WORD DS = getDS();
+ WORD ES = getES();
+
Int32Call(&BiosContext, BIOS_SYS_TIMER_INTERRUPT);
+
+ setAX(AX);
+ setCX(CX);
+ setDX(DX);
+ setBX(BX);
+ setBP(BP);
+ setSI(SI);
+ setDI(DI);
+ setDS(DS);
+ setES(ES);
+ setCF(0);
+
// BiosSystemTimerInterrupt(Stack);
PicIRQComplete(LOBYTE(Stack[STACK_INT_NUM]));
}
Modified: trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/bios…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Sat Sep 19
22:12:56 2015
@@ -209,8 +209,15 @@
* In return, if CF is set we continue processing the scan code
* stored in AL, and if not, we skip it.
*/
- BYTE CF = getCF();
WORD AX = getAX();
+ WORD CX = getCX();
+ WORD DX = getDX();
+ WORD BX = getBX();
+ WORD BP = getBP();
+ WORD SI = getSI();
+ WORD DI = getDI();
+ WORD DS = getDS();
+ WORD ES = getES();
setCF(1);
setAL(IOReadB(PS2_DATA_PORT));
@@ -222,7 +229,15 @@
ScanCode = getAL();
setAX(AX);
- setCF(CF);
+ setCX(CX);
+ setDX(DX);
+ setBX(BX);
+ setBP(BP);
+ setSI(SI);
+ setDI(DI);
+ setDS(DS);
+ setES(ES);
+ setCF(0);
if (ScanCode == 0xE0)
{