core: use vk_append for function 0016h temp storage syslinux-4.00-pre24
authorH. Peter Anvin <hpa@zytor.com>
Tue, 16 Feb 2010 22:53:51 +0000 (14:53 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 16 Feb 2010 22:53:51 +0000 (14:53 -0800)
a) we have to copy the command line tail earlier - the pm_*
   calls may use xfer_buf_seg in particular.
b) use vk_append rather than trackbuf; vk_append should definitely
   be unused.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/comboot.inc

index 74ec55d..d7186d5 100644 (file)
@@ -747,6 +747,18 @@ comapi_runkernel:
                cmp al,VK_TYPES-1
                ja .error
                mov [KernelType],al
+
+               ; It's not just possible, but quite likely, that ES:BX
+               ; points into real_mode_seg or xfer_buf_seg, so we
+               ; need to exercise some special care here... use
+               ; vk_append for temporary storage.
+               push ds
+               mov ds,P_ES
+               mov si,P_BX
+               mov di,vk_append
+               call strcpy
+               pop ds
+
                push ds
                mov ds,P_DS
                mov si,P_SI
@@ -760,17 +772,6 @@ comapi_runkernel:
                mov [Kernel_SI],si
                mov [Kernel_EAX],eax
 
-               ; It's not just possible, but quite likely, that ES:BX
-               ; points into real_mode_seg or xfer_buf_seg, so we
-               ; need to exercise some special care here... use
-               ; trackbuf as an intermediary
-               push ds
-               mov ds,P_ES
-               mov si,P_BX
-               mov di,trackbuf
-               call strcpy
-               pop ds
-
 %if IS_PXELINUX
                mov al,P_CL
                mov [IPAppend],al
@@ -783,10 +784,10 @@ comapi_runkernel:
                push es
                mov dx,real_mode_seg
                mov es,dx
-               mov si,trackbuf
+               mov si,vk_append
                mov di,cmd_line_here
                call strcpy
-               mov byte [es:di-1],' '          ; Simulate APPEND
+               mov word [es:di-1],' '  ; Simulate APPEND: space plus null
                pop es
                mov [CmdLinePtr],di
                mov word [CmdOptPtr],zero_string