[syslinux] isolinux.bin checksum
Ady Ady
ady-sf at hotmail.com
Fri Jan 12 04:01:30 PST 2018
> man mkisofs paragraph "EL TORITO BOOT INFORMATION TABLE" says:
> -----------------------------------------------------------------------------
> The format of this table is as follows; all integers are in section
> 7.3.1 ("little endian") format.
>
> Offset Name Size Meaning
> 8 bi_pvd 4 bytes LBA of primary volume descriptor
> 12 bi_file 4 bytes LBA of boot file
> 16 bi_length 4 bytes Boot file length in bytes
> 20 bi_csum 4 bytes 32-bit checksum
> 24 bi_reserved 40 bytes Reserved
>
> The 32-bit checksum is the sum of all the 32-bit words in the
> boot file starting at byte offset 64. All linear block
> addresses (LBAs) are given in CD sectors (normally 2048 bytes).
> -----------------------------------------------------------------------------
>
> The "primary volume descriptor" of a first session on medium is always at
> Logical Block Address 16 = 0x10 0x00 0x00 0x00.
> "Boot file length" and "32-bit checksum" get filled in by prepcore and do
> not change by the -boot-info-table changes. Nevertheless the ISO producer
> programs set these values too.
With this info, I have re-checked all the isolinux.bin files that were involved
in my tests, both before and after the creation of the ISO images, and those
within the ISO images themselves.
Besides discovering a "brain fart" in my prior email ( 40 = 0x28 != 28, oops),
all the above "fields" are correct in all the isolinux.bin files originated
from the one that included Thomas' patch for '.lzo/prepcore.c':
diff --git a/lzo/prepcore.c b/lzo/prepcore.c
index 9147b2e4..b5ebe88b 100644
--- a/lzo/prepcore.c
+++ b/lzo/prepcore.c
@@ -331,7 +331,7 @@ int main(int argc, char *argv[])
unsigned int ptr;
outfile_len =
((offset - start + out_len + 2047) & ~2047) - (offset - start);
- for (ptr = 64; ptr < offset; ptr += 4)
+ for (ptr = start + 64; ptr < offset; ptr += 4)
csum += get_32((uint32_t *) (infile + ptr));
for (ptr = 0; ptr < outfile_len; ptr += 4)
csum += get_32((uint32_t *) (out + ptr));
Is there any reason not to accept Thomas' patch immediately?
Regards,
Ady.
More information about the Syslinux
mailing list