summaryrefslogtreecommitdiffstats
path: root/src/arch/i386
diff options
context:
space:
mode:
authorMichael Brown2015-11-17 15:17:03 +0100
committerMichael Brown2015-11-17 15:20:35 +0100
commit309c58824fc75a931cf3c25268abdb35870ce8f0 (patch)
treefe4111751d58b4573d593abb3d75b9b7a3d7e43f /src/arch/i386
parent[dhcp] Limit maximum number of DHCP discovery deferrals (diff)
downloadipxe-309c58824fc75a931cf3c25268abdb35870ce8f0.tar.gz
ipxe-309c58824fc75a931cf3c25268abdb35870ce8f0.tar.xz
ipxe-309c58824fc75a931cf3c25268abdb35870ce8f0.zip
[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 <awiddersheim@inetu.net> Tested-by: Andrew Widdersheim <awiddersheim@inetu.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386')
-rw-r--r--src/arch/i386/image/com32.c4
-rw-r--r--src/arch/i386/image/comboot.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/arch/i386/image/com32.c b/src/arch/i386/image/com32.c
index c12ffb68..ff64fd1a 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 <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 );
}
diff --git a/src/arch/i386/image/comboot.c b/src/arch/i386/image/comboot.c
index 1ec02331..20b5ae1e 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 <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 );
}