pxelinux: fix the handling of KeepPXE
authorH. Peter Anvin <hpa@linux.intel.com>
Tue, 14 Apr 2009 18:20:03 +0000 (11:20 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 14 Apr 2009 18:20:03 +0000 (11:20 -0700)
KeepPXE was broken in 3.74, because we tried to use both bits 0 and 1,
but failed to actually test both bits.  Instead, just use bit 0, but
move the place where we clear the bits.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
core/bootsect.inc
core/pxelinux.asm
core/runkernel.inc
core/ui.inc

index 2780958..bb7e82e 100644 (file)
@@ -117,8 +117,8 @@ replace_bootstrap:
                mov es,ax
 
 %if IS_PXELINUX
-               test byte [KeepPXE],01h
-               jz .stdstack
+               cmp byte [KeepPXE],0
+               je .stdstack
                les di,[InitStack]      ; Reset stack to PXE original
                jmp .stackok
 %endif
index 370cc2b..906c40b 100644 (file)
@@ -2000,8 +2000,8 @@ get_packet_gpxe:
 ; the memory.
 ;
 unload_pxe:
-               test byte [KeepPXE],01h         ; Should we keep PXE around?
-               jnz reset_pxe
+               cmp byte [KeepPXE],0            ; Should we keep PXE around?
+               jne reset_pxe
 
                push ds
                push es
index 44c0028..2d98773 100644 (file)
@@ -95,12 +95,6 @@ construct_cmdline:
 ;
 parse_cmdline:
                mov di,cmd_line_here
-               xor ax,ax
-               mov [InitRDPtr],ax              ; No initrd= option (yet)
-               mov [QuietBoot],al
-%if IS_PXELINUX
-               and byte [KeepPXE],~2
-%endif
 .skipspace:    mov al,[es:di]
                inc di
 .skipspace_loaded:
@@ -176,7 +170,7 @@ opt_quiet:
 
 %if IS_PXELINUX
 opt_keeppxe:
-               or byte [KeepPXE],2             ; KeepPXE set by command line
+               or byte [KeepPXE],1             ; KeepPXE set by command line
                ret
 %endif
 
index d59143b..53401bf 100644 (file)
@@ -310,16 +310,6 @@ command_done:
 
 load_kernel:                                   ; Load the kernel now
 ;
-; Common initialization for all kernel types
-;
-               xor ax,ax
-               mov [InitRDPtr],ax
-               mov [QuietBoot],al
-%if IS_PXELINUX
-               mov [KeepPXE],al
-%endif
-
-;
 ; First we need to mangle the kernel name the way DOS would...
 ;
                mov si,command_line
@@ -603,6 +593,15 @@ kernel_good_saved:
 
 kernel_good:
                pushad
+               ;
+               ; Common initialization for all kernel types
+               ;
+               xor ax,ax
+               mov [InitRDPtr],ax
+               mov [QuietBoot],al
+%if IS_PXELINUX
+               mov [KeepPXE],al
+%endif
 
                mov si,KernelName
                mov di,KernelCName