]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[comboot] Reset console before starting COMBOOT executable
authorMichael Brown <mcb30@ipxe.org>
Tue, 17 Nov 2015 14:17:03 +0000 (14:17 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 17 Nov 2015 14:20:35 +0000 (14:20 +0000)
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 <awiddersheim@inetu.net>
Tested-by: Andrew Widdersheim <awiddersheim@inetu.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/image/com32.c
src/arch/i386/image/comboot.c

index c12ffb684039c7375de28d22fa271ed866f93e33..ff64fd1a1611c8cc8130e2b7e503838b226af3fb 100644 (file)
@@ -40,6 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <ipxe/segment.h>
 #include <ipxe/init.h>
 #include <ipxe/io.h>
+#include <ipxe/console.h>
 
 /**
  * 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 );
 }
 
index 1ec02331d19dcf92475148844d9afd5f4782014c..20b5ae1e79b9a51b2324f07146aa02e3af907e77 100644 (file)
@@ -40,6 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <ipxe/segment.h>
 #include <ipxe/init.h>
 #include <ipxe/features.h>
+#include <ipxe/console.h>
 
 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 );
 }