Browse Source

[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>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
309c58824f
2 changed files with 8 additions and 0 deletions
  1. 4
    0
      src/arch/i386/image/com32.c
  2. 4
    0
      src/arch/i386/image/comboot.c

+ 4
- 0
src/arch/i386/image/com32.c View File

40
 #include <ipxe/segment.h>
40
 #include <ipxe/segment.h>
41
 #include <ipxe/init.h>
41
 #include <ipxe/init.h>
42
 #include <ipxe/io.h>
42
 #include <ipxe/io.h>
43
+#include <ipxe/console.h>
43
 
44
 
44
 /**
45
 /**
45
  * Execute COMBOOT image
46
  * Execute COMBOOT image
281
 		return rc;
282
 		return rc;
282
 	}
283
 	}
283
 
284
 
285
+	/* Reset console */
286
+	console_reset();
287
+
284
 	return com32_exec_loop ( image );
288
 	return com32_exec_loop ( image );
285
 }
289
 }
286
 
290
 

+ 4
- 0
src/arch/i386/image/comboot.c View File

40
 #include <ipxe/segment.h>
40
 #include <ipxe/segment.h>
41
 #include <ipxe/init.h>
41
 #include <ipxe/init.h>
42
 #include <ipxe/features.h>
42
 #include <ipxe/features.h>
43
+#include <ipxe/console.h>
43
 
44
 
44
 FEATURE ( FEATURE_IMAGE, "COMBOOT", DHCP_EB_FEATURE_COMBOOT, 1 );
45
 FEATURE ( FEATURE_IMAGE, "COMBOOT", DHCP_EB_FEATURE_COMBOOT, 1 );
45
 
46
 
316
 		return rc;
317
 		return rc;
317
 	}
318
 	}
318
 
319
 
320
+	/* Reset console */
321
+	console_reset();
322
+
319
 	return comboot_exec_loop ( image );
323
 	return comboot_exec_loop ( image );
320
 }
324
 }
321
 
325
 

Loading…
Cancel
Save