summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorMichael Brown2006-06-06 17:29:14 +0200
committerMichael Brown2006-06-06 17:29:14 +0200
commit8d0c5f3302c847c5c2177c23fa8d5925067a4e58 (patch)
tree2923b57ddb912a61bf2e29956272fee3f51f6560 /src/util
parentForce pci.o to be included. (diff)
downloadipxe-8d0c5f3302c847c5c2177c23fa8d5925067a4e58.tar.gz
ipxe-8d0c5f3302c847c5c2177c23fa8d5925067a4e58.tar.xz
ipxe-8d0c5f3302c847c5c2177c23fa8d5925067a4e58.zip
Use byte 6 for the checksum, rather than byte 5. (Byte 5 may be part of
the jmp instruction).
Diffstat (limited to 'src/util')
-rwxr-xr-xsrc/util/makerom.pl16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/util/makerom.pl b/src/util/makerom.pl
index 9d751e190..2bd8e1f95 100755
--- a/src/util/makerom.pl
+++ b/src/util/makerom.pl
@@ -131,9 +131,9 @@ sub writerom ($$) {
sub checksum ($) {
my ($romref) = @_;
- substr($$romref, 5, 1) = "\x00";
+ substr($$romref, 6, 1) = "\x00";
my $sum = unpack('%8C*', $$romref);
- substr($$romref, 5, 1) = chr(256 - $sum);
+ substr($$romref, 6, 1) = chr(256 - $sum);
# Double check
$sum = unpack('%8C*', $$romref);
if ($sum != 0) {
@@ -168,14 +168,10 @@ sub makerom () {
$romsize = ($filesize + 511) & ~511
}
} else {
- $romsize = getromsize(\$rom);
- # 0 put there by *loader.S means makerom should pick the size
- if ($romsize == 0) {
- # Shrink romsize down to the smallest power of two that will do
- for ($romsize = MAXROMSIZE;
- $romsize > MINROMSIZE and $romsize >= 2*$filesize;
- $romsize /= 2) { }
- }
+ # Shrink romsize down to the smallest power of two that will do
+ for ($romsize = MAXROMSIZE;
+ $romsize > MINROMSIZE and $romsize >= 2*$filesize;
+ $romsize /= 2) { }
}
if ($filesize > $romsize) {
print STDERR "ROM size of $romsize not big enough for data, ";