aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bcopy32.inc19
-rw-r--r--bootsect.inc24
-rw-r--r--pxelinux.asm5
3 files changed, 22 insertions, 26 deletions
diff --git a/bcopy32.inc b/bcopy32.inc
index 4910fbb0..af322f91 100644
--- a/bcopy32.inc
+++ b/bcopy32.inc
@@ -381,10 +381,7 @@ try_wbinvd:
;
; Inputs:
; ESI, EDI, ECX - same as bcopy
-; EDX - edx on invocation
-; EAX - esi on invocation
-; EBX - ebx on invocation
-; ES - es on invocation
+; On stack - initial state (ad, fd, ds, es, fs, gs)
;
%define ADJUST (__bcopy_start - trackbuf)
@@ -397,10 +394,6 @@ adjlist dw bcopy_gdt.adj1 - ADJUST
adjlist_cnt equ ($-adjlist)/2
bcopy_over_self:
- push es
- push ebx
- push eax
- push edx
push esi
push edi
push ecx
@@ -408,8 +401,6 @@ bcopy_over_self:
xor bx,bx
mov es,bx
mov ds,bx
- mov fs,bx
- mov gs,bx
mov si,__bcopy_start
mov di,trackbuf
@@ -439,9 +430,11 @@ bcopy_over_self:
pop esi
call bcopy
- pop edx
- pop esi
- pop ebx
+ pop gs
+ pop fs
pop es
+ pop ds
+ popfd
+ popad
jmp 0:7c00h
__bcopy_end:
diff --git a/bootsect.inc b/bootsect.inc
index 4546eda2..4d2274f8 100644
--- a/bootsect.inc
+++ b/bootsect.inc
@@ -73,25 +73,33 @@ load_bootsec:
push di
mov cx,8 ; 16 bytes
rep movsw
- pop ax ; DS:SI points to partition info
+ pop si ; DS:SI points to partition info
%elif IS_ISOLINUX
mov dl,[DriveNo]
%endif
- mov esi,7C00h
- mov edi,100000h
- pop ecx ; Byte count
+ pop ecx ; Byte count to copy
cli
- xor ebx,ebx
- mov ds,bx
%if IS_PXELINUX
lss sp,[Stack] ; Reset stack to PXE original
- les bx,[InitESBX] ; ES:BX -> PXENV+
+ pop es
%else
+ xor ebx,ebx
+ mov ds,bx
mov es,bx
- mov esp,esi
+ mov esp,7C00h
+ pushad
+ pushfd
+ push bx ; ds
+ push bx ; es
+ push bx ; fs
+ push bx ; gs
%endif
+
+ mov esi,100000h ; Copy from...
+ mov edi,7C00h ; Copy to...
+
jmp bcopy_over_self
%if IS_SYSLINUX = 0
diff --git a/pxelinux.asm b/pxelinux.asm
index 3d1da266..f447b7de 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -198,7 +198,6 @@ RamdiskMax resd 1 ; Highest address for a ramdisk
KernelSize resd 1 ; Size of kernel (bytes)
SavedSSSP resd 1 ; Our SS:SP while running a COMBOOT image
Stack resd 1 ; Pointer to reset stack
-InitESBX resd 1 ; Initial ES:BX pointer
PXEEntry resd 1 ; !PXE API entry point
RebootTime resd 1 ; Reboot timeout, if set by option
KernelClust resd 1 ; Kernel size in clusters
@@ -276,10 +275,6 @@ _start1:
push fs
push gs
- mov [cs:InitESBX],bx
- mov bx,es
- mov [cs:InitESBX+2],bx
-
mov bp,sp
les bx,[bp+48] ; Initial !PXE structure pointer