|
修改了一下,但是HalTranslateBusAddress转换出来的物理地址只是将ISA_BUS_ADDR放在低32位,高32位为空。
- #define ISA_BUS_ADDR (0x000D0000)
- #define ISA_MEM_SIZE (0x1000)
- char szBuff[ISA_MEM_SIZE];
- PVOID pMem = NULL;
- PHYSICAL_ADDRESS paIsaBusAddr, paIsaPhysAddr;
- pMem = VirtualAlloc(0, ISA_MEM_SIZE, MEM_RESERVE, PAGE_NOACCESS);
- if (pMem)
- {
- paIsaBusAddr.QuadPart = ISA_BUS_ADDR;
- if (HalTranslateBusAddress(Eisa, (ULONG)1, paIsaBusAddr, NULL, &paIsaPhysAddr))
- if (VirtualCopy(pMem, (PVOID)&(paIsaPhysAddr.u.LowPart), ISA_MEM_SIZE, PAGE_READWRITE | PAGE_NOCACHE | PAGE_PHYSICAL))
- memcpy(szBuff, pMem, ISA_MEM_SIZE);
- VirtualFree(pMem, ISA_MEM_SIZE, MEM_RELEASE);
- }
复制代码 |
|