summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorMichael Brown2010-04-25 16:57:00 +0200
committerMichael Brown2010-04-25 17:37:06 +0200
commit132c391712b19fd76847f192d7523cf67d44f67f (patch)
tree1281661a003c59447758f09366e3085e358f9b05 /src/util
parent[build] Replace obsolete makerom.pl with quick script using Option::ROM (diff)
downloadipxe-132c391712b19fd76847f192d7523cf67d44f67f.tar.gz
ipxe-132c391712b19fd76847f192d7523cf67d44f67f.tar.xz
ipxe-132c391712b19fd76847f192d7523cf67d44f67f.zip
[romprefix] Add .mrom format, allowing loading of large ROMs
Add an infrastructure allowing the prefix to provide an open_payload() method for obtaining out-of-band access to the whole iPXE image. Add a mechanism within this infrastructure that allows raw access to the expansion ROM BAR by temporarily borrowing an address from a suitable memory BAR on the same PCI card. For cards that have a memory BAR that is at least as large as their expansion ROM BAR, this allows large iPXE ROMs to be supported even on systems where PMM fails, or where option ROM space pressure makes it impossible to use PMM shrinking. The BIOS sees only a stub ROM of approximately 3kB in size; the remainder (which can be well over 64kB) is loaded only at the time iPXE is invoked. As a nice side-effect, an iPXE .mrom image will continue to work even if its PMM-allocated areas are overwritten between initialisation and invocation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Option/ROM.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/Option/ROM.pm b/src/util/Option/ROM.pm
index a86d3262..9fea4d34 100644
--- a/src/util/Option/ROM.pm
+++ b/src/util/Option/ROM.pm
@@ -349,7 +349,8 @@ sub checksum {
my $hash = shift;
my $self = tied(%$hash);
- return unpack ( "%8C*", ${$self->{data}} );
+ my $raw = substr ( ${$self->{data}}, 0, ( $hash->{length} * 512 ) );
+ return unpack ( "%8C*", $raw );
}
=pod