|
如何"写"PCI设备的Base Address 0
[复制链接]
我们知道,PCI设备通用配置寄存器如下:
DW | Byte3 | Byte2 | Byte1 | Byte0 | Addr
---+---------------------------------------------------------+-----
0 | Device ID | Vendor ID | 00
---+---------------------------------------------------------+-----
1 | Status | Command | 04
---+---------------------------------------------------------+-----
2 | Class Code | Revision ID | 08
---+---------------------------------------------------------+-----
3 | BIST | Header Type | Latency Timer | Cache Line | 0C
---+---------------------------------------------------------+-----
4 | Base Address 0 | 10
---+---------------------------------------------------------+-----
5 | Base Address 1 | 14
---+---------------------------------------------------------+-----
6 | Base Address 2 | 18
---+---------------------------------------------------------+-----
7 | Base Address 3 | 1C
---+---------------------------------------------------------+-----
8 | Base Address 4 | 20
---+---------------------------------------------------------+-----
9 | Base Address 5 | 24
---+---------------------------------------------------------+-----
10 | CardBus CIS pointer | 28
---+---------------------------------------------------------+-----
11 | Subsystem Device ID | Subsystem Vendor ID | 2C
---+---------------------------------------------------------+-----
12 | Expansion ROM Base Address | 30
---+---------------------------------------------------------+-----
13 | Reserved(Capability List) | 34
---+---------------------------------------------------------+-----
14 | Reserved | 38
---+---------------------------------------------------------+-----
15 | Max_Lat | Min_Gnt | IRQ Pin | IRQ Line | 3C
-------------------------------------------------------------------
我现在的问题是,如何"写"Base Address 0 ?
看清楚,是写,不是读啊,
比如,我现在想将该设备映射到0x80000000这个内存地址去,该怎么写?
前提是没有OS,并且不要用PCI BIOS,要用汇编程序写,
另,对于有多个function的PCI设备,比如网卡,有8个funtion,这样的设备怎么处理?每个function都要写Base Address 0吗?
在线等,对于解决问题的人,立马奉送100分.
|
|