嗯,Ke386CallBios 就是从 VDM 走的。
NTSTATUS Ke386CallBios ( IN ULONG BiosCommand, IN OUT PCONTEXT BiosArguments )
/*++
Routine Description:
This function invokes specified ROM BIOS code by executing "INT BiosCommand." Before executing the BIOS code, this function will setup VDM context, change stack pointer ...etc. If for some reason the operation fails, a status code will be returned. Otherwise, this function always returns success regardless of the result of the BIOS call.
N.B. This implementation relies on the fact that the direct I/O access operations between apps are serialized by win user.
Arguments:
BiosCommand - Supplies which ROM BIOS function to invoke.
BiosArguments - Supplies a pointer to the context which will be used to invoke ROM BIOS.
Return Value:
NTSTATUS code to specify the failure.
--*/
bios int 0x10 的调用:
#define V86_CODE_ADDRESS 0x10000
PUCHAR BaseAddress = (PUCHAR)V86_CODE_ADDRESS;
// // Write "Int BiosCommand; bop" to reserved user space (0x1000). // Later control will transfer to the user space to execute // these two instructions. //
*BaseAddress++ = INT_OPCODE; *BaseAddress++ = (UCHAR)BiosCommand; /* ARG-2 */ *(PULONG)BaseAddress = V86_BOP_OPCODE;
00010000 cd 10 c4 c4 fe 00 cd cd cd cd cd cd cd cd ..............
|