[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>
This commit is contained in:
Michael Brown
2012-07-23 17:41:38 +01:00
parent ee3636370d
commit 5de45cd3da
4 changed files with 111 additions and 6 deletions

View File

@@ -85,4 +85,15 @@ do {
printf "\n";
}
my $ipxe = $rom->ipxe_header();
if ( $ipxe ) {
printf "iPXE header:\n\n";
printf " %-16s 0x%02x (%s0x%02x)\n", "Checksum:", $ipxe->{checksum},
( ( $ipxe->checksum == 0 ) ? "" : "INCORRECT: " ), $ipxe->checksum;
printf " %-16s 0x%02x (%d)\n", "Shrunk length:",
$ipxe->{shrunk_length}, ( $ipxe->{shrunk_length} * 512 );
printf " %-16s 0x%08x\n", "Build ID:", $ipxe->{build_id};
printf "\n";
}
} while ( $rom = $rom->next_image );