[syslinux] [PATCH] core: Fix 'trackbuf' descriptor list byte length

H. Peter Anvin hpa at zytor.com
Sun Mar 6 15:21:16 PST 2011


On 03/06/2011 04:21 AM, Ahmed S. Darwish wrote:
> (Tested using a Linux bzImage, with and without an initrd.)
> 
> Per shuffle_and_boot documentation, %ecx must contain the descriptor
> list byte length, but it's set with such list end address instead.  Fix.
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07 at gmail.com>

Hmm... unless there are other code paths, it would be easier to simply
"inc ax" before the imul here, no?

>  		imul di,ax,12
> +		push di			; length of list
>  		add di,bx		; DI <- end of list
> -		push di
>  
>  		; Terminating entry...
>  		lea eax,[replace_stub]	; Entrypoint
> @@ -196,8 +196,10 @@ replace_bootstrap_noclearmode:
>  		mov cx,__replacestub_dwords
>  		rep movsd
>  
> +		; ECX <- final list length
>  		xor ecx,ecx
> -		pop cx			; ECX <- length of list
> +		pop cx			; original length in bytes
> +		add cx, 12		; + termination entry size
>  


-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.




More information about the Syslinux mailing list