[modrom] Avoid clobbering near jump with checksum
commitb0b0b8f65c478c3b7f17064c7916db7873b33248
authorJoshua Oreman <oremanj@rwcr.net>
Wed, 7 Oct 2009 20:40:49 +0000 (7 16:40 -0400)
committerMarty Connor <mdc@etherboot.org>
Thu, 15 Oct 2009 18:47:54 +0000 (15 14:47 -0400)
treeca458566d19d01582cbddf6bfda3550922c45895
parent3fa277920804b056ce72fd9ba0074a7ff7c871fa
[modrom] Avoid clobbering near jump with checksum

A jump instruction starts at the third byte of an option ROM image, and
it is required that the bytes in the whole image add up to zero. To
achieve this, a checksum byte is usually placed after the jump. The jump
can be either a short jump (2 bytes, EB xx) or a near jump (3 bytes,
E9 xx xx). gPXE's romprefix.S uses a near jump, but modrom.pl assumed
a short jump, and clobbered the high byte of the offset. This caused
modrom-modified gPXE ROM images to crash the system during POST.

Fix by making modrom.pl place the checksum at byte 6, like makerom.pl does.

Signed-off-by: Marty Connor <mdc@etherboot.org>
src/util/modrom.pl