【Linux c】读写pcie配置空间(安装lib库)

readme.txt + pcie.c + in.txt +Makefile 

可参考源码是: lspci

readme.txt

Please open the terminal in your linux system, then:

1.Please install two lib about pcie:

apt-get install libpciaccess-dev
apt-get install pciutils-dev

2.Please find the road path of libpci.a in your system, follows the commands:

cd /usr
find ./ -name "*pci*"

then, please modify the road path of the Makefile.

(in my ubuntu, it's road path: /usr/lib/i386-linux-gnu/libpci.a )

3.Please go into the directory of pcie.c, follows the commands:

make
./pcie

4. If you want to write pcie's configuration space, please write your data into the in.txt file.
Separating each byte with space .Such as "3a 4b 5c 6d 7e".

5. You computer may be poweroff, when you modify the byte 37, 38, 39 of PCIE configuration space. (that is,if you modify the Base Address Register 6)

pcie.c

</

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值