如何在Windows XP中读取PCI Express设备的存储空间? [英] how to read the memory space of pci express device in windows xp?

查看:246
本文介绍了如何在Windows XP中读取PCI Express设备的存储空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Windows XP中读取pci Express设备的内存空间?
我发现PCIe基址0xF0000000使用RW-Everything.exe,但我无法访问0xF0000000.
我尝试读取0xF0000000,然后结果为0x00000000.
如果结果有效,则结果为8086xxxx.
我习惯于READ_PORT_ULONG((PULONG)0xF000000).

我不知道读取0xF0000000的方法
0xF0000000是内存空间

how to read the memory space of pci express device in windows xp?
I found PCIe baseaddress 0xF0000000 to use RW-Everything.exe but i don''t access 0xF0000000.
I tried to read 0xF0000000 then result 0x00000000.
if result is valid, then result is 8086xxxx.
I use to READ_PORT_ULONG((PULONG)0xF000000).

I don''t know read method to 0xF0000000
0xF0000000 is mempry space

推荐答案

我认为您不能在用户模式程序中执行此操作(所有普通程序都在用户模式下运行).首先,值0xF0000000的指针不一定指向该硬件地址.

首先,检查是否没有其他方法可以做您想要的事情.您确定该设备没有某种SDK或代码库可以为您完成此操作.在如此低的水平上直接使用硬件是一件痛苦的事情.

否则,您将需要查看Windows驱动程序工具包:

http://www.microsoft.com/whdc/devtools/wdk/default.mspx [ ^ ]

这样一来,您便可以制作出可能直接在硬件模式下工作的软件,这些软件可以直接访问您的硬件.但是,您实际上可能最终会编写一个完整的设备驱动程序,其中包括所有额外的工作和问题.亲自调查之后,强烈建议您查看是否有可用的SDK或库.
I don''t think you can do this in a User Mode program (all normal programs run in User Mode). For a start, a pointer with value 0xF0000000 doesn''t necessarily point to that hardware address.

First, check there isn''t another way of doing what you want. Are you certain there isn''t some kind of SDK or code library for the device that''ll do this for you. Working directly with hardware at that low a level is a pain.

Otherwise, you are going to need to look at the Windows Driver Kit:

http://www.microsoft.com/whdc/devtools/wdk/default.mspx[^]

This will let you produce software, probably working in Kernel Mode, that can directly access your hardware. However, you could essentially end up writing a full device driver, with all the extra work and problems that entails. Having looked in to this myself, I strongly suggest you see if you have an SDK or library available.


在某些装有WindowsXP + SP3的PC上,我可以读取内存空间0xF0008000上的数据. /> 我尝试使用MmMaploSpace()读取物理地址的映射虚拟地址
但是在某些装有WindowsXP + SP3的PC上,我无法读取内存空间0xF0008000上的数据.
当我在PC上读取此地址时,系统挂起.
我不知道为什么某些系统挂起.
我附上了我的代码.请参考并给我建议.
如果您知道如何读取PCI Express扩展配置空间,请告诉我.
我想阅读主板上ICH芯片的扩展配置空间.
谢谢.
最好的问候,

示例代码

{
PVOID pvk;
PHYSICAL_ADDRESS phyAddr;
ULONG pcieMemData = 0;

phyAddr.QuadPart =(ULONGLONG)0xF0008000 ;;

//获取映射的内核地址
pvk = MmMapIoSpace(phyAddr,0x300,MmNonCached);

pcieMemData = READ_REGISTER_ULONG((PULONG)(pvk)); ß这点挂

KdPrint(("pcieMemData = 0x%x addr = 0x%x \ n",pcieMemData,pvk));
}
I could read data at memory space 0xF0008000 in some PC with WindowsXP + SP3.
I tried to read mapped virtual address of physical address using MmMaploSpace()
But I couldn''t read data at memory space 0xF0008000 in some PC with WindowsXP + SP3.
When I read at this address in the PC, the system is hang.
I don''t know why some system is hang.
I attached my code. please refer and give me advices.
If you know how to read PCI Express extended configuration spaces, please let me know.
I would like to read extended configuration spaces of ICH chip in mainboard.
Thanks.
Best Regards,

sample code

{
PVOID pvk;
PHYSICAL_ADDRESS phyAddr;
ULONG pcieMemData = 0;

phyAddr.QuadPart=(ULONGLONG)0xF0008000;;

//get mapped kernel address
pvk=MmMapIoSpace(phyAddr, 0x300, MmNonCached);

pcieMemData = READ_REGISTER_ULONG((PULONG)(pvk)); ß this point hang

KdPrint(("pcieMemData=0x%x addr =0x%x \n", pcieMemData, pvk));
}


这篇关于如何在Windows XP中读取PCI Express设备的存储空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆