Changeset 58836 in vbox for trunk/src/VBox/Devices/EFI/Firmware
- Timestamp:
- Nov 23, 2015 6:46:58 PM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/Library/PlatformBdsLib/BdsPlatform.c
r58460 r58836 17 17 #ifdef VBOX 18 18 #include "VBoxPkg.h" 19 #include "DevEFI.h"20 #include "iprt/asm.h"21 19 #include "Library/PrintLib.h" 22 /* Hmmm Uga Draw wasn't pointed in BDS, so perhaps it's totally dead */23 #include <Protocol/UgaDraw.h>24 20 #include <Guid/EventGroup.h> /* gEfiEventReadyToBootGuid */ 25 21 #endif … … 35 31 EFI_EVENT mEmuVariableEvent; 36 32 BOOLEAN mDetectVgaOnly; 37 38 #ifdef VBOX39 static EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *TextOutputProtocol;40 static EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;41 static EFI_UGA_DRAW_PROTOCOL *Uga;42 43 /*44 * @todo move this function to the library.45 */46 static UINT3247 GetVmVariable(UINT32 Variable, CHAR8* Buffer, UINT32 Size )48 {49 UINT32 VarLen, i;50 51 52 ASMOutU32(EFI_INFO_PORT, Variable);53 VarLen = ASMInU32(EFI_INFO_PORT);54 55 for (i=0; i < VarLen && i < Size; i++)56 {57 Buffer[i] = ASMInU8(EFI_INFO_PORT);58 }59 60 return VarLen;61 }62 63 static VOID64 EFIAPI65 VBoxConsoleSwitchMode (66 IN EFI_EVENT Event,67 IN VOID *Context68 )69 {70 EFI_STATUS r = EFI_NOT_FOUND; /* Neither GOP nor UGA is found*/71 EFI_TPL OldTpl;72 OldTpl = gBS->RaiseTPL (TPL_NOTIFY);73 74 gBS->LocateProtocol(&gEfiSimpleTextOutProtocolGuid, NULL, (VOID **)&TextOutputProtocol);75 gBS->LocateProtocol(&gEfiUgaDrawProtocolGuid, NULL, (VOID **)&Uga);76 gBS->LocateProtocol(&gEfiGraphicsOutputProtocolGuid, NULL, (VOID **)&Gop);77 78 if (Gop)79 {80 UINT32 mode = 2;81 GetVmVariable(EFI_INFO_INDEX_GOP_MODE, (CHAR8 *)&mode, sizeof(UINT32));82 r = Gop->SetMode(Gop, mode);83 }84 else if (Uga)85 {86 UINT32 H = 1027;87 UINT32 V = 768;88 GetVmVariable(EFI_INFO_INDEX_UGA_HORIZONTAL_RESOLUTION, (CHAR8 *)&H, sizeof(UINT32));89 GetVmVariable(EFI_INFO_INDEX_UGA_VERTICAL_RESOLUTION, (CHAR8 *)&V, sizeof(UINT32));90 r = Uga->SetMode(Uga, H, V, 32, 60);91 }92 93 if(EFI_ERROR(r))94 goto done;95 96 r = TextOutputProtocol->SetMode(TextOutputProtocol, TextOutputProtocol->Mode->MaxMode);97 if(EFI_ERROR(r))98 goto done;99 done:100 gBS->RestoreTPL (OldTpl);101 return;102 }103 104 EFI_STATUS105 EFIAPI106 VBoxConsoleInit()107 {108 EFI_EVENT event;109 110 gBS->CreateEventEx(EVT_NOTIFY_SIGNAL, TPL_NOTIFY, VBoxConsoleSwitchMode, NULL, &gEfiEventReadyToBootGuid, &event);111 return EFI_SUCCESS;112 }113 #endif /* VBOX */114 115 33 116 34 // … … 1386 1304 } 1387 1305 } 1388 #ifdef VBOX1389 VBoxConsoleInit();1390 #endif1391 1306 1392 1307 // -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgIa32.dsc
r58786 r58836 545 545 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf 546 546 VBoxPkg/VBoxVgaMiniPortDxe/VBoxVgaMiniPortDxe.inf 547 VBoxPkg/VBoxVgaDxe/VBoxVgaDxe.inf 547 VBoxPkg/VBoxVgaDxe/VBoxVgaDxe.inf { 548 <LibraryClasses> 549 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 550 } 548 551 VBoxPkg/VBoxFsDxe/VBoxIso9660.inf 549 552 VBoxPkg/VBoxFsDxe/VBoxHfs.inf -
trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/OvmfPkgX64.dsc
r58786 r58836 549 549 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf 550 550 VBoxPkg/VBoxVgaMiniPortDxe/VBoxVgaMiniPortDxe.inf 551 VBoxPkg/VBoxVgaDxe/VBoxVgaDxe.inf 551 VBoxPkg/VBoxVgaDxe/VBoxVgaDxe.inf { 552 <LibraryClasses> 553 PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf 554 } 552 555 VBoxPkg/VBoxFsDxe/VBoxIso9660.inf 553 556 VBoxPkg/VBoxFsDxe/VBoxHfs.inf -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVga.c
r56292 r58836 230 230 NULL 231 231 }; 232 233 234 /* 235 * @todo move this function to the library. 236 */ 237 UINT32 VBoxVgaGetVmVariable(UINT32 Variable, CHAR8* Buffer, UINT32 Size) 238 { 239 UINT32 VarLen, i; 240 241 ASMOutU32(EFI_INFO_PORT, Variable); 242 VarLen = ASMInU32(EFI_INFO_PORT); 243 244 for (i = 0; i < VarLen && i < Size; i++) 245 Buffer[i] = ASMInU8(EFI_INFO_PORT); 246 247 return VarLen; 248 } 249 232 250 233 251 /** -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVga.h
r56292 r58836 72 72 73 73 #include "VBoxPkg.h" 74 #include "DevEFI.h" 75 #include "iprt/asm.h" 76 74 77 // 75 78 // Cirrus Logic 5430 PCI Configuration Header values … … 447 450 ); 448 451 452 UINT32 VBoxVgaGetVmVariable(UINT32 Variable, CHAR8* Buffer, UINT32 Size); 453 449 454 #endif -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaDxe.inf
r56292 r58836 90 90 [Packages] 91 91 MdePkg/MdePkg.dec 92 MdeModulePkg/MdeModulePkg.dec 92 93 VBoxPkg/VBoxPkg.dec 93 94 … … 119 120 [Pcd] 120 121 gVBoxVgaPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion 122 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution ## PRODUCES 123 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution ## PRODUCES -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaGraphicsOutput.c
r56292 r58836 444 444 EFI_STATUS Status; 445 445 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; 446 446 UINT32 GopMode = 2; 447 447 448 448 GraphicsOutput = &Private->GraphicsOutput; … … 478 478 // Initialize the hardware 479 479 // 480 GraphicsOutput->SetMode (GraphicsOutput, 2); 480 VBoxVgaGetVmVariable(EFI_INFO_INDEX_GOP_MODE, (CHAR8 *)&GopMode, sizeof(GopMode)); 481 GraphicsOutput->SetMode (GraphicsOutput, GopMode); 481 482 DrawLogo ( 482 483 Private, … … 484 485 Private->ModeData[Private->GraphicsOutput.Mode->Mode].VerticalResolution 485 486 ); 487 PcdSet32(PcdVideoHorizontalResolution, Private->ModeData[Private->GraphicsOutput.Mode->Mode].HorizontalResolution); 488 PcdSet32(PcdVideoVerticalResolution, Private->ModeData[Private->GraphicsOutput.Mode->Mode].VerticalResolution); 486 489 487 490 return EFI_SUCCESS; -
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/VBoxVgaDxe/VBoxVgaUgaDraw.c
r56292 r58836 333 333 { 334 334 EFI_UGA_DRAW_PROTOCOL *UgaDraw; 335 UINT32 HorizontalResolution = 1027; 336 UINT32 VerticalResolution = 768; 335 337 336 338 // … … 353 355 // Initialize the hardware 354 356 // 357 VBoxVgaGetVmVariable(EFI_INFO_INDEX_UGA_HORIZONTAL_RESOLUTION, (CHAR8 *)&HorizontalResolution, 358 sizeof(HorizontalResolution)); 359 VBoxVgaGetVmVariable(EFI_INFO_INDEX_UGA_VERTICAL_RESOLUTION, (CHAR8 *)&VerticalResolution, 360 sizeof(VerticalResolution)); 361 355 362 UgaDraw->SetMode ( 356 363 UgaDraw, … … 365 372 Private->ModeData[Private->CurrentMode].VerticalResolution 366 373 ); 374 PcdSet32(PcdVideoHorizontalResolution, HorizontalResolution); 375 PcdSet32(PcdVideoVerticalResolution, VerticalResolution); 367 376 368 377 return EFI_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.