首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 驱动开发 >

PCI驱动地址读写的有关问题

2012-02-27 
PCI驱动地址读写的问题写了个驱动(里面仅用RtlCopyMemory做一些操作),测试时采用CreateFile、ReadFile、Writ

PCI驱动地址读写的问题
写了个驱动(里面仅用RtlCopyMemory做一些操作),测试时采用CreateFile、ReadFile、WriteFile方式发现都是对共享内存进行操作,但是我想具体的读写PCI上所有地址和寄存器的值,驱动程序应该如何写呢?要应用哪些函数?

[解决办法]
去http;//www.driverdevelop.com看看
[解决办法]
用MmMapIoSpace();

MmMapIoSpace
The MmMapIoSpace routine maps the given physical address range to nonpaged system space.

PVOID
MmMapIoSpace(
IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN MEMORY_CACHING_TYPE CacheType
);


Parameters
PhysicalAddress
Specifies the starting physical address of the I/O range to be mapped.
NumberOfBytes
Specifies a value greater than zero, indicating the number of bytes to be mapped.
CacheType
Specifies a MEMORY_CACHING_TYPE value, which indicates the permitted caching behavior when mapping the physical address range.

Return Value
MmMapIoSpace returns the base virtual address that maps the base physical address for the range. If space for mapping the range is insufficient, it returns NULL.

可以看《Programming the microsoft windows driver model》的Reading and Writing Data这一章。
[解决办法]
经典mark
[解决办法]
up
[解决办法]
请教楼主一下
我现在在用DS编程读写物理内存,不知道楼主编程时如何将物理地址转换成虚拟地址
Kmemoryrange好像只能访问虚拟地址的,而且MapToSystemSpace()是将虚拟地址
转换到系统空间的,请楼主指教!
谢谢!

热点排行