我需要Windows Driver里调用 PnP BIOS的服务,我认为DMIScope的驱动就是这么修改DMI的。
但是有一台机器无法使用DMIScope修改DMI但可以在实模式下使用AMI的DMI editor修改DMI,而DMI Editor是直接调用PnP BIOS实现的。
所以我想请问,在保护模式下调用16位的PnP BIOS是否可行?
谢谢!
多谢 sysnap!
我在ring 3下使用了sinister的方法修改了TSS,又使用Porttalk的方法都没有成功.
我看了看DMIScope的驱动实现,应该是通过自己设置门来实现,但也没有成功 ;-(.
然后我把所有情况都排列组合一下,还是没有成功.
我认为使用v86模式调用PnP BIOS应该在TSS上下功夫,但依然没有结果.
嗯,Ke386CallBios 就是从 VDM 走的。
NTSTATUSKe386CallBios ( 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 ..............