免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: skyrim
打印 上一主题 下一主题

[硬件及驱动] 请教x86 io地址空间和内存地址空间的关系 [复制链接]

论坛徽章:
59
2015年亚洲杯之约旦
日期:2015-01-27 21:27:392015年亚洲杯之日本
日期:2015-02-06 22:09:41拜羊年徽章
日期:2015-03-03 16:15:432015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:50:282015元宵节徽章
日期:2015-03-06 15:50:392015年亚洲杯之阿联酋
日期:2015-03-19 17:39:302015年亚洲杯之中国
日期:2015-03-23 18:52:23巳蛇
日期:2014-12-14 22:44:03双子座
日期:2014-12-10 21:39:16处女座
日期:2014-12-02 08:03:17天蝎座
日期:2014-07-21 19:08:47
11 [报告]
发表于 2012-05-28 13:49 |只看该作者
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:


  1. +---------------------+------------------------+--------------------------------------------+
  2. |  RAM                    | ROM LOCATE HRERE  |   RAM                                                |
  3. +---------------------+------------------------+--------------------------------------------+
复制代码
then os is starting and the bios is not longer needed, the os would mask rom out(by config the bus contorllor)

  1. +---------------------+------------------------+--------------------------------------------+
  2. |         RAM                                                                                                          |
  3. +---------------------+------------------------+--------------------------------------------+

  4.                              +------------------------+
  5.                              | ROM masked and became invisible...                                    
  6.                              +------------------------+

复制代码
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*)

  1.                                                      | ROOT CONTORL |   addr 0x0000~addr 0xffff, can be configurated
  2.                                                                  |
  3.         +------------------------------------------+----------------------------------------------------------------------+
  4.         |                                                                                                                                                    |
  5. [Sub contorl 1] Addr 0xa000~0xffff (can be configurated but must in the range 0000~ffff)        [sub controllor2               ] addr 0000~0fff
  6.           |                                                                                                                                                  |
  7. .... sub contorl or device attached here                                                                              device or sub contorllor attached here...
复制代码

论坛徽章:
0
12 [报告]
发表于 2012-05-28 20:35 |只看该作者
谢谢楼上的讲解,基本上明白了!再深入的也就不深究了,等啥时候再有疑问的时候再请教! {:2_168:}
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP