From 7c761e266caafb590e5d1c5698a1e011ebdd93ae Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 14 Apr 2009 11:20:03 -0700 Subject: [PATCH] pxelinux: fix the handling of KeepPXE 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 --- core/bootsect.inc | 4 ++-- core/pxelinux.asm | 4 ++-- core/runkernel.inc | 8 +------- core/ui.inc | 19 +++++++++---------- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/core/bootsect.inc b/core/bootsect.inc index 2780958..bb7e82e 100644 --- a/core/bootsect.inc +++ b/core/bootsect.inc @@ -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 diff --git a/core/pxelinux.asm b/core/pxelinux.asm index 370cc2b..906c40b 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -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 diff --git a/core/runkernel.inc b/core/runkernel.inc index 44c0028..2d98773 100644 --- a/core/runkernel.inc +++ b/core/runkernel.inc @@ -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 diff --git a/core/ui.inc b/core/ui.inc index d59143b..53401bf 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -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 -- 2.7.4