1

您可以在“实模式”下访问 PCI 卡(32 位)吗?“实模式”不是 16 位吗?我有一个开发人员声称他只能在实模式下访问硬件。但是PCI是32位...

4

1 回答 1

1

是的你可以。

IO 端口 0xCF8 和 0xCF9 用作访问 PCI 配置空间的索引和数据寄存器。要写入索引寄存器的地址(即 0xCF8)具有固定的预定义格式(参见 PCI 规范)。要访问 pci 配置数据,先写入索引寄存器,然后从数据寄存器中读取。

The Index register is a DWORD (32-bit) register and the format is:

Byte-3 = 0x80
Byte-2 = Bus No
Byte-1 = Upper 5 bits as DEVICE no, and lower 3 bits as FUNCTION no.
Byte-0 = Register no. to read from config space

所以要在实模式下从 Bus:0 Device:0 Func:0 register:0 读取,你会说:

IoPortWrite32(0xCF8, 0x80000000);
ValueRead = IoPortRead32(0xCFC);

希望这可以帮助!

谢谢,罗希特

于 2012-03-20T21:06:43.967 回答