浏览代码

[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 年前
父节点
当前提交
309c58824f
共有 2 个文件被更改,包括 8 次插入0 次删除
  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 查看文件

@@ -40,6 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
40 40
 #include <ipxe/segment.h>
41 41
 #include <ipxe/init.h>
42 42
 #include <ipxe/io.h>
43
+#include <ipxe/console.h>
43 44
 
44 45
 /**
45 46
  * Execute COMBOOT image
@@ -281,6 +282,9 @@ static int com32_exec ( struct image *image ) {
281 282
 		return rc;
282 283
 	}
283 284
 
285
+	/* Reset console */
286
+	console_reset();
287
+
284 288
 	return com32_exec_loop ( image );
285 289
 }
286 290
 

+ 4
- 0
src/arch/i386/image/comboot.c 查看文件

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

正在加载...
取消
保存