开发者

Can you access PCI cards(32 bits) in "real mode"?

Can you access PCI cards(32 bits) in "real mode" ? Isn't "real mode" 16 bits? I have a developer claiming he can only access hardware in Real开发者_StackOverflow mode. But PCI is 32bits...


Yes, you can.

IO ports 0xCF8 and 0xCF9 act as index and data registers for accessing PCI Config space. The address to be written to index register (i.e. 0xCF8) has a fixed predefined format (refer PCI spec). To access pci config data, one writes to index register and then reads from data register.

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

So to read from Bus:0 Device:0 Func:0 register:0 in real mode, you would say:

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

Hope this helps!

Thanks, Rohit

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜