summaryrefslogtreecommitdiff
path: root/core/bootsect.inc
diff options
context:
space:
mode:
authorAhmed S. Darwish <darwish.07@gmail.com>2011-03-06 14:21:31 +0200
committerH. Peter Anvin <hpa@linux.intel.com>2011-03-07 12:02:35 -0800
commitc987272b97ecb89db19ee438dba0c8c2418f8ffe (patch)
treedd74999c4020988d599dcd349164af4b71198a34 /core/bootsect.inc
parent4686166dbaeb5c89672da6e48227f4e402b7bae8 (diff)
downloadsyslinux-c987272b97ecb89db19ee438dba0c8c2418f8ffe.tar.gz
core: Fix 'trackbuf' descriptor list byte lengthsyslinux-4.04-pre12
(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@gmail.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'core/bootsect.inc')
-rw-r--r--core/bootsect.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/bootsect.inc b/core/bootsect.inc
index b4402f1c..6c204096 100644
--- a/core/bootsect.inc
+++ b/core/bootsect.inc
@@ -169,7 +169,7 @@ replace_bootstrap_noclearmode:
mov [es:di+8],ax ; New DI
mov [es:di+4],bx ; New ES
%endif
- pop ax ; List length
+ pop ax ; descriptor list entries count
push di
push es
@@ -179,8 +179,8 @@ replace_bootstrap_noclearmode:
mov ebx,trackbuf
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
pop word [replace_stub.ss]
pop word [replace_stub.esp]