From ff747ef4c75c9e55c9d5c5552126d994c96da245 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 28 May 2008 09:47:44 -0700 Subject: [PATCH] pxenv: save away the PXE return code so COMBOOT can return it PXELINUX itself doesn't actually use the PXE return code, but the COMBOOT interface is supposed to return it. Accordingly, make sure it is stashed away so we can return it; for code that doesn't care, it just writes a dedicated status variable which can be safely ignored. --- comboot.inc | 2 +- pxelinux.asm | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/comboot.inc b/comboot.inc index 35cc7f9..df9bb00 100644 --- a/comboot.inc +++ b/comboot.inc @@ -446,8 +446,8 @@ comapi_pxecall: mov es,P_ES mov di,P_DI call pxenv + mov ax,[PXEStatus] mov P_AX,ax - clc ret %else comapi_pxecall equ comapi_err ; Not available diff --git a/pxelinux.asm b/pxelinux.asm index 8be844f..c4feee2 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -1712,6 +1712,7 @@ pxenv: push bx .jump: call 0:0 add sp,6 + mov [cs:PXEStatus],ax add ax,-1 ; Set CF unless AX was 0 %if USE_PXE_PROVIDED_STACK == 0 @@ -1722,6 +1723,8 @@ pxenv: ; except for testing it against zero (and setting CF), ; which we did above. For anything else, ; use the Status field in the reply. + ; For the COMBOOT function, the value is saved in + ; the PXEStatus variable. popad cld ; Make sure DF <- 0 ret @@ -1729,6 +1732,12 @@ pxenv: ; Must be after function def due to NASM bug PXEEntry equ pxenv.jump+1 + section .bss + alignb 2 +PXEStatus resb 2 + + section .text + ; ; getfssec: Get multiple clusters from a file, given the starting cluster. ; -- 2.7.4