DPMI - how to chain user and original RM handler? (Developers)
Hello!
I have a problem with my INT15h handler written in DPMI program.
I am able to redirect the realmode interrupt to my protected mode routine.
If I return back to real mode everything is fine.
The problem is when I want to call the original routine from the main.
I am trying to implement the INT 15h/AH=4Fh keyboard interrupt.
If I detect the 4Fh in the AH I can do what I want.
But if there is not the 4Fh (if there is f.e. AX=E820h) I have to put my hands off and just to call the original routine.
But I do not know how because my program crashes here....
procedure int15_handler; {$IFDEF NEWFPC}nostackframe;{$ENDIF}assembler;
{Handler for software interrupt 15h, installed by:
get_rm_callback(@int15_handler, int15_regs, newint15_handler);
Set_rm_interrupt($15, newint15_handler);}
{In Entrance:
DS:ESI = real mode SS:SP
ES:EDI = copied real mode registers to our protected mode segment
disabled hardware interrupts}
asm
push ds
push eax
mov ax,es {ES points to our protected mode segment}
mov ds,ax {Let also DS point to our segment to be FreePacal happy}
pushad
mov ax,DOSmemSelector
mov fs,ax
call Internal_Int15_Handler; {written in pascal}
popad
pop eax
pop ds {restore DS}
call es:[oldint15_handler] {DOES NOT WORK !!! (Crashes here)}
{oldint15_handler is got from Get_rm_interrupt($15, oldint15_handler)}
mov eax,ds:[esi+0] {restore return address (CS:IP)}
mov es:[edi+2Ah],eax
(*
mov eax,ds:[esi+4] {do we have to do anything with flags?}
mov es:[edi+20h],ax
*)
add word ptr es:[edi+2Eh],6 {updates SP}
iret
end;
---
DOS-u-akbar!
Complete thread:
- DPMI - how to chain user and original RM handler? - Laaca, 29.04.2023, 00:41
- DPMI - how to chain user and original RM handler? - ecm, 29.04.2023, 08:43
- DPMI - how to chain user and original RM handler? - ecm, 29.04.2023, 08:45
- DPMI - how to chain user and original RM handler? - Laaca, 29.04.2023, 14:04
- DPMI - how to chain user and original RM handler? - ecm, 29.04.2023, 15:17
- DPMI - how to chain user and original RM handler? - Laaca, 29.04.2023, 14:04
- DPMI - how to chain user and original RM handler? - ecm, 29.04.2023, 08:45
- DPMI - how to chain user and original RM handler? - bretjohn, 04.05.2023, 04:03
- DPMI - how to chain user and original RM handler? - CandyMan, 05.05.2023, 12:36
- DPMI - how to chain user and original RM handler? - Laaca, 05.05.2023, 21:53
- DPMI - how to chain user and original RM handler? - Laaca, 12.06.2023, 23:39
- DPMI - how to chain user and original RM handler? - ecm, 29.04.2023, 08:43