summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-06-14 16:01:30 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-06-14 16:01:30 -0700
commitfd4cab20788d3bf35b76f59dc9b3f1c06587b5e8 (patch)
tree1f2b29e08954a1fb634218be65563fac9e958551
parent18ca4d8cc87761c6a5ab763069fad562fec69b59 (diff)
downloadsyslinux-fd4cab20788d3bf35b76f59dc9b3f1c06587b5e8.tar.gz
PXELINUX: when chaining an NBP, restore *all* registers
On at least ASUS A8N-E, unless *all* registers are restored to pre-PXE status, localboot doesn't work. We were clobbering DS, ESI and EDX when chainloading an NBP, which meant that localboot wouldn't work in the chainloaded NBP. Fix this. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/bootsect.inc16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/bootsect.inc b/core/bootsect.inc
index 3ea36bf5..200f00ad 100644
--- a/core/bootsect.inc
+++ b/core/bootsect.inc
@@ -74,13 +74,19 @@ load_bootsec:
xor ax,ax
rep movsw
pop si ; DS:SI points to partition info
+ xor bx,bx
%elif IS_ISOLINUX
mov dl,[DriveNumber]
+ xor bx,bx
%elif IS_PXELINUX
mov byte [KeepPXE],03h ; Chainloading + keep PXE
call reset_pxe
+ lfs si,[InitStack]
+ ; Put restore DS, EDX and ESI to the true initial values
+ mov bx,[fs:si+6]
+ mov edx,[fs:si+28]
+ mov esi,[fs:si+12]
%endif
- xor bx,bx
;
; replace_bootstrap for the special case where we have exactly one
@@ -91,12 +97,12 @@ load_bootsec:
replace_bootstrap_one:
mov eax,[trackbuf] ; Base address
add eax,[trackbuf+8] ; Length
- movzx edx,word [BIOS_fbm]
- shl edx,10 ; Free Base Memory
- sub edx,eax
+ movzx ecx,word [BIOS_fbm]
+ shl ecx,10 ; Free Base Memory
+ sub ecx,eax
mov [trackbuf+12],eax
or dword [trackbuf+16],-1 ; Zero memory
- mov [trackbuf+20],edx
+ mov [trackbuf+20],ecx
push word 2 ; Length of descriptor list
; Fall through