0xcf8 揭底
2015-07-24 10:22
393 查看
Seeing a code starting from 0xcf8, I didnot know what it is, so checked and got some idea. Here they are.
Refer from: https://en.wikipedia.org/wiki/PCI_configuration_space (More info, refer here.)
Configuration reads and writes can be initiated from the CPU in two ways: one legacy method via I/O addresses
0xCF8 and 0xCFC, and another called memory-mapped configuration.
The legacy method was present in the original PCI, and it is called Configuration Access Mechanism (CAM). It allows for 256 bytes of a device's address space to be reached indirectly via two 32-bit registers called
PCI CONFIG_ADDRESS and PCI CONFIG_DATA. These registers are at addresses 0xCF8 and
0xCFC in the x86 I/O address space.[3] For example, a software driver (firmware, OS kernel or kernel driver)
can use these registers to configure a PCI device by writing the address of the device's register into CONFIG_ADDRESS, and by putting the data that is supposed to be written to the device into CONFIG_DATA. Since this process requires a write to a register
in order to write the device’s register, it is referred to as "indirection".
The format of CONFIG_ADDRESS is the following:
As explained previously, addressing a device via Bus, Device, and Function (BDF) is also referred to as "addressing a device geographically." See
code for an example of code that uses geographical addressing.[4]
The second method was created for PCI Express. It is called Enhanced Configuration Access Mechanism (ECAM). It extends device's configuration space to 4k, with the bottom 256 bytes overlapping the original (legacy)
configuration space in PCI. The section of the addressable space is "stolen" so that the accesses from the CPU don't go to memory but rather reach a given device in the PCI Express fabric. During system initialization, firmware determines the base address
for this “stolen” address region and communicates it to the root complex and to the operating system. This communication method is implementation-specific, and not defined in the PCI Express specification.
说简单一点就是要对CPU进行初始化读写操作,其中一个方法是从地址入口0xcf8或0xcfc进入。
Refer from: https://en.wikipedia.org/wiki/PCI_configuration_space (More info, refer here.)
Configuration reads and writes can be initiated from the CPU in two ways: one legacy method via I/O addresses
0xCF8 and 0xCFC, and another called memory-mapped configuration.
The legacy method was present in the original PCI, and it is called Configuration Access Mechanism (CAM). It allows for 256 bytes of a device's address space to be reached indirectly via two 32-bit registers called
PCI CONFIG_ADDRESS and PCI CONFIG_DATA. These registers are at addresses 0xCF8 and
0xCFC in the x86 I/O address space.[3] For example, a software driver (firmware, OS kernel or kernel driver)
can use these registers to configure a PCI device by writing the address of the device's register into CONFIG_ADDRESS, and by putting the data that is supposed to be written to the device into CONFIG_DATA. Since this process requires a write to a register
in order to write the device’s register, it is referred to as "indirection".
The format of CONFIG_ADDRESS is the following:
0x80000000 | bus << 16 | device << 11 | function << 8 | offset
As explained previously, addressing a device via Bus, Device, and Function (BDF) is also referred to as "addressing a device geographically." See
arch/x86/pci/early.cin the Linux kernel
code for an example of code that uses geographical addressing.[4]
The second method was created for PCI Express. It is called Enhanced Configuration Access Mechanism (ECAM). It extends device's configuration space to 4k, with the bottom 256 bytes overlapping the original (legacy)
configuration space in PCI. The section of the addressable space is "stolen" so that the accesses from the CPU don't go to memory but rather reach a given device in the PCI Express fabric. During system initialization, firmware determines the base address
for this “stolen” address region and communicates it to the root complex and to the operating system. This communication method is implementation-specific, and not defined in the PCI Express specification.
说简单一点就是要对CPU进行初始化读写操作,其中一个方法是从地址入口0xcf8或0xcfc进入。
相关文章推荐
- Full Stack developer and Fog Computing
- ef 事务
- Python-常用库扩展
- Algorithms—23.Merge k Sorted Lists
- 其他
- HCE基础知识普及
- Spring 的扫描
- ac53 python中文输入输出在windows下的cmd中的实现
- 10亿美金的教训——我居然错过Airbnb的天使轮
- 【BZOJ】1257 余数之和
- SetFilePointer设置文件指针使用示例
- SSZipArchive使用详解
- leetcode-动态规划:Unique Binary Search Trees
- Java连接mysql数据库
- iOS触摸事件
- Android开发之AlertDialog
- openGL圆及多边形的画法演示
- 解读Django框架中的低层次缓存API
- 7月21日全球域名商(国际域名)解析新增量排名
- 干货