Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed Nov 17, 2015
1 parent ed0d7c4 commit 309c588
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/arch/i386/image/com32.c
Expand Up @@ -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
Expand Down Expand Up @@ -281,6 +282,9 @@ static int com32_exec ( struct image *image ) {
return rc;
}

/* Reset console */
console_reset();

return com32_exec_loop ( image );
}

Expand Down
4 changes: 4 additions & 0 deletions src/arch/i386/image/comboot.c
Expand Up @@ -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 );

Expand Down Expand Up @@ -316,6 +317,9 @@ static int comboot_exec ( struct image *image ) {
return rc;
}

/* Reset console */
console_reset();

return comboot_exec_loop ( image );
}

Expand Down

0 comments on commit 309c588

Please sign in to comment.