- Timestamp:
- Jan 19, 2023 9:20:54 AM (21 months ago)
- Location:
- trunk/src/VBox/Devices/EFI
- Files:
-
- 3 edited
-
DevEFI.cpp (modified) (2 diffs)
-
DevEFI.h (modified) (1 diff)
-
Firmware/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r98103 r98131 461 461 } 462 462 #endif /* IN_RING3 */ 463 464 465 /** 466 * Handles writes to the event port. 467 * 468 * @returns VBox status suitable for I/O port write handler. 469 * 470 * @param pThisCC The EFI state for the current context. 471 * @param u32 The value being written. 472 * @param cb The size of the value. 473 */ 474 static int efiR3PortEventWrite(PDEVEFIR3 pThisCC, uint32_t u32, unsigned cb) 475 { 476 if (cb == sizeof(uint16_t)) 477 { 478 switch (u32) 479 { 480 case EFI_EVENT_TYPE_BOOT_FAILED: 481 { 482 /* No additional data for this event. */ 483 LogRel(("EFI: Boot failure\n")); 484 int rc = PDMDevHlpVMSetRuntimeError(pThisCC->pDevIns, 0 /*fFlags*/, "VMBootFail", 485 N_("The VM failed to boot. This is possibly caused by not having an operating system installed or a misconfigured boot order. Maybe picking a guest OS install DVD will resolve the situation")); 486 AssertRC(rc); 487 break; 488 } 489 default: 490 Log(("EFI: Unknown event: %#x (cb=%d)\n", u32, cb)); 491 break; 492 } 493 } 494 else 495 Log(("EFI: Invalid write size for the event port cb=%u\n", cb)); 496 497 return VINF_SUCCESS; 498 } 463 499 464 500 … … 782 818 break; 783 819 } 820 break; 821 } 822 823 case EFI_PORT_EVENT: 824 { 825 rc = efiR3PortEventWrite(pThisCC, u32, cb); 784 826 break; 785 827 } -
trunk/src/VBox/Devices/EFI/DevEFI.h
r98103 r98131 123 123 /** @} */ 124 124 125 /** Undefined port. */ 126 #define EFI_PORT_UNDEFINED (EFI_PORT_BASE+0x2) 125 /** EFI event signalling. 126 * A 16-bit event identifier is written first. 127 * It might follow a number of writes to convey additional data, 128 * the size depends on the event identifier. 129 */ 130 #define EFI_PORT_EVENT (EFI_PORT_BASE+0x2) 131 132 /** 133 * Events. 134 */ 135 typedef enum EFI_EVENT_TYPE 136 { 137 /** Invalid event id. */ 138 EFI_EVENT_TYPE_INVALID = 0, 139 /** Booting any guest OS failed. */ 140 EFI_EVENT_TYPE_BOOT_FAILED, 141 /** 32bit blow up hack. */ 142 EFI_EVENT_TYPE_16_BIT_HACK = 0x7fff 143 } EFI_EVENT_TYPE; 144 127 145 128 146 /** Debug logging. -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
r89983 r98131 13 13 #include <Library/Tcg2PhysicalPresenceLib.h> 14 14 #include <Library/XenPlatformLib.h> 15 #ifdef VBOX 16 # include <Library/IoLib.h> 17 # include "../../../../DevEFI.h" 18 #endif 15 19 16 20 … … 1541 1545 // Register UEFI Shell 1542 1546 // 1547 #ifndef VBOX 1543 1548 PlatformRegisterFvBootOption ( 1544 1549 &gUefiShellFileGuid, L"EFI Internal Shell", LOAD_OPTION_ACTIVE 1545 1550 ); 1551 #else 1552 /* 1553 * Don't start the shell automatically (can still be selected from the boot manager) 1554 * so we get into the error path when none of the boot options worked. 1555 */ 1556 PlatformRegisterFvBootOption ( 1557 &gUefiShellFileGuid, L"EFI Internal Shell", 0 1558 ); 1559 #endif 1546 1560 1547 1561 RemoveStaleFvFileOptions (); … … 1710 1724 UINTN Index; 1711 1725 1726 #ifdef VBOX 1727 IoWrite16(EFI_PORT_EVENT, EFI_EVENT_TYPE_BOOT_FAILED); 1728 #endif 1729 1712 1730 // 1713 1731 // BootManagerMenu doesn't contain the correct information when return status
Note:
See TracChangeset
for help on using the changeset viewer.

