syslinux $PnP search fix syslinux-3.53-pre1
authorGerald Britton <gbritton@alum.mit.edu>
Mon, 29 Oct 2007 21:03:17 +0000 (17:03 -0400)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 1 Nov 2007 22:42:50 +0000 (15:42 -0700)
I finally fixed the "chain.c32 hangs when run on modern qemu" problem.
Apparently it was hanging hitting the "Invalid $PnP header (too short)" branch
of the code which loops without ever incrementing bx, so it never terminates.

The patch below (taken against your current git) seems to fix the problem for
me, but having not explored the code much, it probably isn't the most elegant
of fixes.

-- Gerald

bootsect.inc

index 715100a..5775c5a 100644 (file)
@@ -149,6 +149,7 @@ replace_bootstrap:
 .findpnp:
                cmp dword [fs:bx], "$PnP"
                jz .foundpnp
+.againpnp:
                inc bx
                cmp bx,-21h             ; Don't get a segment overflow error!
                jbe .findpnp
@@ -156,7 +157,7 @@ replace_bootstrap:
 .foundpnp:
                movzx cx,byte [fs:bx+5] ; Size of $PnP header
                cmp cl,21h
-               jb .findpnp             ; Invalid $PnP header (too short)
+               jb .againpnp            ; Invalid $PnP header (too short)
                push bx
                xor ax,ax
 .checkpnp: