mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[NTVDM]
Instead of reassembling each time the very same common stub code for each interrupt, do it once, and then assemble just a little part for each interrupt and jump to the common stub. Now the 4DOS Ctrl-C exception bug changes, but I have an idea what's happening in there... svn path=/branches/ntvdm/; revision=60917
This commit is contained in:
parent
bf2731fb9f
commit
e4946e8b85
1 changed files with 28 additions and 16 deletions
|
@ -128,25 +128,16 @@ VOID WINAPI Int32Dispatch(LPWORD Stack)
|
||||||
|
|
||||||
VOID WINAPI InitializeInt32(WORD BiosSegment)
|
VOID WINAPI InitializeInt32(WORD BiosSegment)
|
||||||
{
|
{
|
||||||
USHORT i;
|
|
||||||
WORD Offset = 0;
|
|
||||||
|
|
||||||
LPDWORD IntVecTable = (LPDWORD)BaseAddress;
|
LPDWORD IntVecTable = (LPDWORD)BaseAddress;
|
||||||
LPBYTE BiosCode = (LPBYTE)SEG_OFF_TO_PTR(BiosSegment, 0);
|
LPBYTE BiosCode = (LPBYTE)SEG_OFF_TO_PTR(BiosSegment, 0);
|
||||||
|
|
||||||
/* Generate ISR stubs and fill the IVT */
|
USHORT i;
|
||||||
for (i = 0x00; i <= 0xFF; i++)
|
WORD CommonStub, BopSeqOffset, Offset;
|
||||||
|
|
||||||
|
CommonStub = Offset = 0x00;
|
||||||
|
|
||||||
|
/* Write the common stub code */
|
||||||
{
|
{
|
||||||
IntVecTable[i] = MAKELONG(Offset, BiosSegment);
|
|
||||||
|
|
||||||
BiosCode[Offset++] = 0xFA; // cli
|
|
||||||
|
|
||||||
BiosCode[Offset++] = 0x6A; // push i
|
|
||||||
BiosCode[Offset++] = (UCHAR)i;
|
|
||||||
|
|
||||||
BiosCode[Offset++] = 0x6A; // push 0
|
|
||||||
BiosCode[Offset++] = 0x00;
|
|
||||||
|
|
||||||
// BOP_SEQ:
|
// BOP_SEQ:
|
||||||
BiosCode[Offset++] = 0xF8; // clc
|
BiosCode[Offset++] = 0xF8; // clc
|
||||||
|
|
||||||
|
@ -173,6 +164,27 @@ VOID WINAPI InitializeInt32(WORD BiosSegment)
|
||||||
|
|
||||||
BiosCode[Offset++] = 0xCF; // iret
|
BiosCode[Offset++] = 0xCF; // iret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Generate ISR stubs and fill the IVT */
|
||||||
|
for (i = 0x00; i <= 0xFF; i++)
|
||||||
|
{
|
||||||
|
IntVecTable[i] = MAKELONG(Offset, BiosSegment);
|
||||||
|
|
||||||
|
BiosCode[Offset++] = 0xFA; // cli
|
||||||
|
|
||||||
|
BiosCode[Offset++] = 0x6A; // push i
|
||||||
|
BiosCode[Offset++] = (UCHAR)i;
|
||||||
|
|
||||||
|
BiosCode[Offset++] = 0x6A; // push 0
|
||||||
|
BiosCode[Offset++] = 0x00;
|
||||||
|
|
||||||
|
BopSeqOffset = CommonStub - Offset - 3;
|
||||||
|
|
||||||
|
BiosCode[Offset+0] = 0xE9; // jmp near BOP_SEQ
|
||||||
|
BiosCode[Offset+1] = LOBYTE(BopSeqOffset);
|
||||||
|
BiosCode[Offset+2] = HIBYTE(BopSeqOffset);
|
||||||
|
Offset+=3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID WINAPI RegisterInt32(BYTE IntNumber, EMULATOR_INT32_PROC IntHandler)
|
VOID WINAPI RegisterInt32(BYTE IntNumber, EMULATOR_INT32_PROC IntHandler)
|
||||||
|
|
Loading…
Reference in a new issue