UEFI BIOS之PCI Expansion Rom(PCI Option Rom)

1.Option Rom介绍/什么是PCI Option Rom?

PCI规范中允许一些 PCI 设备可以自己包含用于初始化、实现自身功能的代码。这些特殊的code存在于设备自身携带的EPROM中,或者是包含在 source code 中。这样的Rom Image,我们称之为 PCI Expansion Rom,也可以称为PCI Option Rom或PCI Rom.

2.常用的设备

显卡、网卡、NVMe devices 等其他 PCI 设备。

3.Expansion ROM Image structure

Option Rom 存储格式:(Rom Header + PCI Data Structure + Image Data)* N

3.1PCI Expansion ROM Header Format

The information required in each ROM image is split into two different areas. One area, the ROM header, is required to be located at the beginning of the ROM image. The second area, the PCI Data Structure, must be located in the first 64 KiB of the image. The format for the PCI Expansion ROM Header is given below. The offset is a hexadecimal number from the beginning of the image, and the length of each field is given in bytes.

3.2PCI Data Structure Format

The PCI Data Structure must be located within the first 64 KiB of the ROM image and must be DWORD aligned. The PCI Data Structure contains the following information:

3.3Device List Format

Revision 3.0 (or later) defines a Device List Pointer that points to the list of Device IDs supported by the Expansion ROM image whose Code Type is not 3 (UEFI). The beginning reference point (“offset zero”) for this pointer is the beginning of the PCI Data structure (the first byte of the Signature field). If this field does not exist (i.e., its contents are zero), then the Expansion ROM only supports the one specific Device ID listed in the Device ID field in the PCI Data structure. However, if this field is non-zero then it must point to a Device List Table.

4.主要分类(Code Type)

The Code Type field is a one-byte field that identifies the type of code contained in this section of the ROM. The code may be executable binary for a specific processor and system architecture or interpretive code. The following code types are assigned:

根据Code Type不同,Rom Header 有两种格式:

4.1Type 0 :Intel x86, PC-AT compatible (Legacy Option Rom)

The standard header for PCI Expansion ROM images is expanded slightly for PC-compatibility (Code Type 0). Code Type 0 headers use offset 03h as the entry point for the Expansion ROM INIT function.

Expansion ROM Header Extensions:

4.2Type 3:Unified Extensible Firmware Interface (UEFI)

5.Several rules that must be followed when constructing a PCI Option ROM

1. A PCI Option ROM can be no larger than 16 MiB.

2. A PCI Option ROM may contain one or more images.

3. Each image must being on a 512-byte boundary.

4. Each image must be an even multiple of 512 bytes in length. This means that images that are not an even multiple of 512 bytes in length must be padded to the next 512-byte boundary.

5. Legacy Option ROM images begin with a Standard PCI Expansion ROM Header .

6. EFI Option ROM images begin with an EFI PCI Expansion ROM Header .

7. Each image must contain a PCIR data structure in the first 64 KiB of the image.

8. The image data for an EFI Option ROM image must begin in the first 64 KiB of the image.

9. The image data for an EFI Option ROM image must be a PE/COFF image or a compressed PE/ COFF image following the UEFI Compression Algorithm, and referencing Appendix H for the Compression Source Code.

10. The PCIR data structure must begin on a 4-byte boundary.

11. If the PCI Option ROM contains a Legacy Option ROM image, it must be the first image.

12. The images are placed in the PCI Option ROM in order from highest to lowest priority. This priority is used to build the ordered list of Driver Image Handles that are produced by the Bus Specific Driver Override Protocol for a PCI Controller.

13. In the future EBC is the only way new processor bindings can be added.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值