summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2012-07-23 18:41:38 +0200
committerMichael Brown2012-07-23 18:57:40 +0200
commit5de45cd3da2308a6db37fb7c0822c9fdadf00d96 (patch)
treee33ac06ab9d117ea86644d2362660e84b7727c2f /src/arch
parent[contrib] Fix rom-o-matic git version number issues (diff)
downloadipxe-5de45cd3da2308a6db37fb7c0822c9fdadf00d96.tar.gz
ipxe-5de45cd3da2308a6db37fb7c0822c9fdadf00d96.tar.xz
ipxe-5de45cd3da2308a6db37fb7c0822c9fdadf00d96.zip
[romprefix] Report a pessimistic runtime size estimate
PCI3.0 allows us to report a "runtime size" which can be smaller than the actual ROM size. On systems that support PMM our runtime size will be small (~2.5kB), which helps to conserve the limited option ROM space. However, there is no guarantee that the PMM allocation will succeed, and so we need to report the worst-case runtime size in the PCI header. Move the "shrunk ROM size" field from the PCI header to a new "iPXE ROM header", allowing it to be accessed by ROM-manipulation utilities such as disrom.pl. Reported-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/i386/prefix/romprefix.S28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/arch/i386/prefix/romprefix.S b/src/arch/i386/prefix/romprefix.S
index 2719a70aa..2b4c20b8e 100644
--- a/src/arch/i386/prefix/romprefix.S
+++ b/src/arch/i386/prefix/romprefix.S
@@ -63,6 +63,8 @@ romheader_size: .byte 0 /* Size in 512-byte blocks */
jmp init /* Initialisation vector */
checksum:
.byte 0
+ .org 0x10
+ .word ipxeheader
.org 0x16
.word undiheader
.org 0x18
@@ -78,9 +80,6 @@ checksum:
.long 0
.previous
-build_id:
- .long _build_id /* Randomly-generated build ID */
-
pciheader:
.ascii "PCIR" /* Signature */
.word pci_vendor_id /* Vendor identification */
@@ -106,7 +105,7 @@ pciheader_runtime_length:
.long pciheader_image_length
.long 512
.long 0
- .ascii "ADHW"
+ .ascii ZINFO_TYPE_ADxW
.long pciheader_runtime_length
.long 512
.long 0
@@ -175,6 +174,25 @@ undiheader:
.equ undiheader_len, . - undiheader
.size undiheader, . - undiheader
+ipxeheader:
+ .ascii "iPXE" /* Signature */
+ .byte ipxeheader_len /* Length of structure */
+ .byte 0 /* Checksum */
+shrunk_rom_size:
+ .byte 0 /* Shrunk size (in 512-byte blocks) */
+ .byte 0 /* Reserved */
+build_id:
+ .long _build_id /* Randomly-generated build ID */
+ .equ ipxeheader_len, . - ipxeheader
+ .size ipxeheader, . - ipxeheader
+
+ .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
+ .ascii "ADHB"
+ .long shrunk_rom_size
+ .long 512
+ .long 0
+ .previous
+
/* Initialisation (called once during POST)
*
* Determine whether or not this is a PnP system via a signature
@@ -354,7 +372,7 @@ pmm_scan:
addr32 rep movsl /* PMM presence implies flat real mode */
popw %es
/* Shrink ROM */
- movw pciheader_runtime_length, %ax
+ movb shrunk_rom_size, %al
movb %al, romheader_size
1: /* Allocate decompression PMM block. Round up the size to the
* nearest 128kB and use the size within the PMM handle; this