- 论坛徽章:
- 59
|
i don't know all of the detail
1.io space到总线地址的映射是通过什么部件完成的?
原以为是IOMMU,但是看了下面这个帖子zx_wing前辈在7楼说MMIO跟IOMMU没关系,就又有有些疑惑了。
只感觉应该是北桥中的某个设备完成的映射。
[/qutote]
mapped by bus controllor.
[quote]
2.这个映射是在何时完成的?
因为在系统启动的时候就已经完成pci设备的枚举,所有pci设备的总线地址都已经写入BAR寄存器,那么是否可以理解为这个映射是由硬件自动完成的?
内核所做的只是从pci设备的中读取出它们的总线地址?
如果是这样,还有问题,pci设备有bar寄存器可以读取分配的总线地址,那其他设备怎么知道cpu把它们的地址映射到什么总线地址上了?比如我机器上的System RAM, System ROM, Video ROM, ACPI Tables等等
which area is mapping to a special device is managed by bus controllor, but configurated by cpu(program).
[quote]
内核所做的只是从pci设备的中读取出它们的总线地址?
[\quote]
no, the first time that the io space are allocated by BIOS( yes, it is).
and, os (kernel) may scan the device that attached in the bus then decided how to occupy the io addr for it.
[quote]
pci设备有bar寄存器可以读取分配的总线地址,那其他设备怎么知道cpu把它们的地址映射到什么总线地址上了?比如我机器上的System RAM, System ROM, Video ROM, ACPI Tables等等
[\quote]
some device can be configurated, and others can't be. such as RAM,ROM(BIOS) in many system. but you can mask it out in some case, just like the following shows:
- +---------------------+------------------------+--------------------------------------------+
- | RAM | ROM LOCATE HRERE | RAM |
- +---------------------+------------------------+--------------------------------------------+
复制代码 then os is starting and the bios is not longer needed, the os would mask rom out(by config the bus contorllor)
- +---------------------+------------------------+--------------------------------------------+
- | RAM |
- +---------------------+------------------------+--------------------------------------------+
- +------------------------+
- | ROM masked and became invisible...
- +------------------------+
复制代码 actually, ram has some port, and you can read some thing about it (such as me
mory size, SPD data,etc, but i am not detail that if it is configuratable...)
the bus controll managing the io device (and memory device by the following image, *it is just a sample*)
- | ROOT CONTORL | addr 0x0000~addr 0xffff, can be configurated
- |
- +------------------------------------------+----------------------------------------------------------------------+
- | |
- [Sub contorl 1] Addr 0xa000~0xffff (can be configurated but must in the range 0000~ffff) [sub controllor2 ] addr 0000~0fff
- | |
- .... sub contorl or device attached here device or sub contorllor attached here...
复制代码 |
|