相对于PCI来说,PCIE最大不同之处就是配置空间增加到了4K(2*12)。 传统的PCI配置空间读写可以对PCIE的00h-0ffh操作,方法一致。但是对100-3ffh的访问需要一番周折了(下面以常见的Intel芯片为例,简单介绍):
1、初始化PCIE BaseAddress (Assume: PCIE_BaseAdd)
2、mov esi ,PCIE_BaseAdd or (Bus#<<20) or (Dev#<<15) OR (Fun#<<12) OR (Reg#and 0FCh);
mov eax ,ds:[edi] ;; cpu 工作在 flat mode下或big real mode,ds==0