选项rom:PXE设计

时间:2017-09-25 20:33:52

标签: bios pci nic option-rom

在研究PCI固件规范和查看PXE Boot Agents的现有实现时,我误解了它应该如何工作。

根据PCI固件规范,在POST过程中,BIOS应将Option ROM映射到UMB内存(0xC000-0xF000),然后通过偏移量0x3调用“Init”入口点,此后BIOS可以禁用Option ROM。

PXE oprom binary由三部分组成:“初始化代码”,“基本代码”和“UNDI代码”。 BIOS仅将“初始化代码”加载到UMB中。稍后通过直接从闪存复制(从PCI闪存BAR(BAR1,根据英特尔规范))将基本代码和UNDI代码加载到内存中。

问题:需要这种工作算法的原因是什么? 供应商为什么不使用BIOS机制而不将整个Extension ROM加载到内存中(而是从Flash BAR中复制)?

1 个答案:

答案 0 :(得分:0)

整体式PXE选件ROM是一个单元,但是现在大多数PXE选件ROM具有拆分的体系结构(分为UNDI选件ROM和BC选件ROM)。虽然,BC ROM通常嵌入在BIOS中,甚至可能不作为可选ROM出现。

如今,NIC仅具有一个选件ROM,即UNDI选件ROM。

Option ROM Header: 0x000DA000
55 AA 08 E8 76 10 CB 55 BC 01 00 00 00 00 00 00 U...v..U........
00 00 00 00 00 00 20 00 40 00 60 00             ...... .@.`.    
  Signature 0xAA55
  Length    0x08 (4096 bytes)
  Initialization entry  0xCB1076E8 //call then far return 
  Reserved  0x55 0xBC 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
  Reserved  0x00 0x00 0x00 0x00 0x00 
  PXEROMID Offset  0x0020 //RWEverything didn't pick it up as a separate field and made it part of the reserved section so I separated it.
  PCI Data Offset   0x0040  
  Expansion Header Offset   0x0060

UNDI ROM ID Structure: 0x000DA020  //not recognised by RW Everything so I parsed it myself
55 4E 44 49 16 08 00 00 01 02 32 0D 00 08 B0 C4  UNDI......2...
80 46 50 43 49 52                                ¦-ÇFPCIR
  Signature  UNDI
  StructLength  0x16
  Checksum  0x08  
  StructRev  0x00
  UNDIRev 0x00 0x01 0x02
  UNDI Loader Offset 0x0D32
  StackSize 0x0800
  DataSize 0xC4B0
  CodeSize 0x4680
  BusType PCIR

PCI Data Structure: 0x000DA040
50 43 49 52 EC 10 68 81 00 00 1C 00 03 00 00 02 PCIR..h.........
08 00 01 02 00 80 08 00                         ........        
  Signature PCIR
  Vendor ID 0x10EC - Realtek Semiconductor
  Device ID 0x8168
  Product Data  0x0000
  Structure Length  0x001C
  Structure Revision    0x03
  Class Code    0x00 0x00 0x02
  Image Length  0x0008
  Revision Level    0x0201
  Code Type 0x00
  Indicator 0x80
  Reserved  0x0008

PnP Expansion Header: 0x000DA060
24 50 6E 50 01 02 00 00 00 D7 00 00 00 00 AF 00 $PnP............
92 01 02 00 00 E4 00 00 00 00 C1 0B 00 00 00 00 ................
  Signature $PnP
  Revision  0x01
  Length    0x02 (32 bytes)
  Next Header   0x0000
  Reserved  0x00
  Checksum  0xD7
  Device ID 0x00000000
  Manufacturer  0x00AF - Intel Corporation
  Product Name  0x0192 - Realtek PXE B02 D00
  Device Type Code  0x02 0x00 0x00
  Device Indicators 0xE4
  Boot Connection Vector    0x0000
  Disconnect Vector 0x0000
  Bootstrap Entry Vector    0x0BC1 // will be at 0xDABC1
  Reserved  0x0000
  Resource info. vector 0x0000