소스 검색

[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
 

Loading…
취소
저장