|
下面是将物理地址0xD0000开始的3000个字节映射到虚拟地址:
在驱动层的XXX_Init()函数中:
- #define MY_PHYSICAL_ADDRESS (0xD0000)
- PHYSICAL_ADDRESS ioPhysicalBase = {MY_PHYSICAL_ADDRESS, 0};
- PUCHAR g_BufSpace = (PUCHAR)MmMapIoSpace(ioPhysicalBase, 3000, FALSE);
复制代码
这样,读写g_BufSpace既是操作0xD0000物理地址了 |
|