isolinux: Clear upper half of EDX before using
authorH. Peter Anvin <hpa@zytor.com>
Tue, 26 Nov 2013 17:58:17 +0000 (09:58 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 12 Dec 2013 02:04:04 +0000 (18:04 -0800)
In checkin:

    cb015497a4e4 isolinux: Update LBA in getlinsec loop

... we use EDX as a sector count, but the sector count is actually in
DX, and the upper half of EDX is uninitialized.  If the BIOS enters
with a nonzero value in the upper half of EDX, this breaks horribly.

At least one set of BIOSes has been identified where if the LBA > 64K
then the upper half of EDX will be nonzero.

Reported-by: Carl Duff <cdrw2400@gmail.com>
Reported-by: Philip Müller <philm@manjaro.org>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/isolinux.asm

index db6d2d4..dd0fa89 100644 (file)
@@ -430,7 +430,7 @@ MaxLMA              equ 384*1024            ; Reasonable limit (384K)
                call getlinsec
                pop eax
                pop cx
-               mov dx,cx
+               movzx edx,cx
                pop bp
                pop bx