访问 PCI 配置空间中寄存器的正确方法
当您需要访问 PCI 配置空间中的寄存器时,是否只需使用内置 BIOS 函数将 DWORD 读/写到配置空间中?
例如,如果我尝试使用位于 B0:D31:F1 上的 IDE 控制器,我是否可以使用该 BDF 作为 BIOS 功能的参数来继续读/写配置寄存器? 因此,如果我想获取供应商 ID,我会读取给定 BDF 中的第一个 DWORD 吗?
或者我离基地太远了?
编辑:
在 PCI BIOS 规范中,我一直在研究用于在配置空间中读取和写入字的 BIOS 函数的定义。 我相信这意味着我可以在配置空间内的各种偏移处写入寄存器。 我想我的问题是,这是在此级别访问这些寄存器的正确方法吗?
When you need to access registers in the PCI configuration space, do you simply need to used built-in BIOS functions to read/write DWORDs into the configuration space?
For example, if I am trying to use an IDE controller that is on B0:D31:F1 do I proceed to read/write the configuration register using that BDF as the parameters to the BIOS functions? So if I wanted to get the vendor id I would read the first DWORD in a given BDF?
Or am I just way off base?
EDIT:
In the PCI BIOS specification, I have been looking over the definitions of the BIOS functions for reading and writing words into the configuration space. Which I believe means that I can write into the registers at various offsets within the configuration space. I guess my question is, is this the correct way of accessing these registers at this level?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
读完 PCI 规范后,我只需要通过给定的中断向量(1Ah)调用 PCI BIOS 函数即可。 然而,这由于必须事先进行 PCI 配置而变得复杂。
PCI配置空间似乎不使用显式地址进行访问,而是使用BIOS函数调用。
编辑:实际上,BIOS 的功能比我知道的要多得多。 我所要做的就是枚举 PCI 总线,直到找到 IDE 控制器的设备和供应商 ID。 唯一需要的组件是输入/输出端口包装器。
After reading the PCI specification, I simply need to call the PCI BIOS functions through a given interrupt vector (1Ah). However, this is complicated by the PCI configuration which must happen before hand.
The PCI configuration space appears to not use an explicit address for access, but BIOS function calls.
EDIT: Actually, turns out the BIOS does a lot more than I knew. All I had to do was enumerate the PCI bus until I found the IDE controller's device and vendor ID. The only assembly needed was the in/out port wrappers.