From: Michael Brown Date: Tue, 17 Nov 2015 14:17:03 +0000 (+0000) Subject: [comboot] Reset console before starting COMBOOT executable X-Git-Tag: v1.20.1~666 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=309c58824fc75a931cf3c25268abdb35870ce8f0;p=thirdparty%2Fipxe.git [comboot] Reset console before starting COMBOOT executable iPXE does not call shutdown() before invoking a COMBOOT executable, since the executable is allowed to make API calls back into iPXE. If a background picture is used, then the console will not be restored to text mode before invoking the COMBOOT executable. This can cause undefined behaviour. Fix by adding an explicit call to console_reset() immediately before invoking a COMBOOT or COM32 executable, analogous to the call made to console_reset() immediately before invokving a PXE NBP. Debugged-by: Andrew Widdersheim Tested-by: Andrew Widdersheim Signed-off-by: Michael Brown --- diff --git a/src/arch/i386/image/com32.c b/src/arch/i386/image/com32.c index c12ffb684..ff64fd1a1 100644 --- a/src/arch/i386/image/com32.c +++ b/src/arch/i386/image/com32.c @@ -40,6 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include /** * Execute COMBOOT image @@ -281,6 +282,9 @@ static int com32_exec ( struct image *image ) { return rc; } + /* Reset console */ + console_reset(); + return com32_exec_loop ( image ); } diff --git a/src/arch/i386/image/comboot.c b/src/arch/i386/image/comboot.c index 1ec02331d..20b5ae1e7 100644 --- a/src/arch/i386/image/comboot.c +++ b/src/arch/i386/image/comboot.c @@ -40,6 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include FEATURE ( FEATURE_IMAGE, "COMBOOT", DHCP_EB_FEATURE_COMBOOT, 1 ); @@ -316,6 +317,9 @@ static int comboot_exec ( struct image *image ) { return rc; } + /* Reset console */ + console_reset(); + return comboot_exec_loop ( image ); }