Changeset 26464 in vbox for trunk/src/VBox/Devices/EFI
- Timestamp:
- Feb 12, 2010 2:21:27 PM (15 years ago)
- Location:
- trunk/src/VBox/Devices/EFI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r26289 r26464 125 125 /* Virtual machine CPU frequency */ 126 126 uint64_t u64CpuFrequency; 127 /* GOP mode */ 128 uint32_t u32GopMode; 129 /* Uga mode resolutions */ 130 uint32_t u32UgaHorisontal; 131 uint32_t u32UgaVertical; 127 132 } DEVEFI; 128 133 typedef DEVEFI *PDEVEFI; … … 152 157 case EFI_INFO_INDEX_STACK_BASE: 153 158 case EFI_INFO_INDEX_STACK_SIZE: 159 case EFI_INFO_INDEX_GOP_MODE: 160 case EFI_INFO_INDEX_UGA_VERTICAL_RESOLUTION: 161 case EFI_INFO_INDEX_UGA_HORISONTAL_RESOLUTION: 154 162 return 4; 155 163 case EFI_INFO_INDEX_BOOT_ARGS: … … 209 217 case EFI_INFO_INDEX_DEVICE_PROPS: 210 218 return pThis->pu8DeviceProps[pThis->iInfoPosition]; 219 case EFI_INFO_INDEX_GOP_MODE: 220 value.u32 = pThis->u32GopMode; 221 break; 222 case EFI_INFO_INDEX_UGA_HORISONTAL_RESOLUTION: 223 value.u32 = pThis->u32UgaHorisontal; 224 break; 225 case EFI_INFO_INDEX_UGA_VERTICAL_RESOLUTION: 226 value.u32 = pThis->u32UgaVertical; 227 break; 211 228 default: 212 229 Assert(false); … … 1002 1019 "BootArgs\0" 1003 1020 "DeviceProps\0" 1021 "GopMode\0" 1022 "UgaHorizontalResolution\0" 1023 "UgaVerticalResolution\0" 1004 1024 )) 1005 1025 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, … … 1115 1135 pThis->u64TscFrequency = pThis->u64FsbFrequency * 3; 1116 1136 pThis->u64CpuFrequency = pThis->u64TscFrequency; 1117 1137 /* 1138 * GOP graphics 1139 */ 1140 rc = CFGMR3QueryU32(pCfg, "GopMode", &pThis->u32GopMode); 1141 AssertRC(rc); 1142 if (pThis->u32GopMode == UINT32_MAX) 1143 { 1144 pThis->u32GopMode = 2; /* 1024x768 */ 1145 } 1146 /* 1147 * Uga graphics 1148 */ 1149 rc = CFGMR3QueryU32(pCfg, "UgaHorizontalResolution", &pThis->u32UgaHorisontal); 1150 AssertRC(rc); 1151 if (pThis->u32UgaHorisontal == 0) 1152 { 1153 pThis->u32UgaHorisontal = 1024; /* 1024x768 */ 1154 } 1155 rc = CFGMR3QueryU32(pCfg, "UgaVerticalResolution", &pThis->u32UgaVertical); 1156 AssertRC(rc); 1157 if (pThis->u32UgaVertical == 0) 1158 { 1159 pThis->u32UgaVertical = 768; /* 1024x768 */ 1160 } 1118 1161 1119 1162 #ifdef DEVEFI_WITH_VBOXDBG_SCRIPT -
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Include/DevEFI.h
r26203 r26464 59 59 EFI_INFO_INDEX_CPU_FREQUENCY, 60 60 EFI_INFO_INDEX_TSC_FREQUENCY, 61 EFI_INFO_INDEX_GOP_MODE, 62 EFI_INFO_INDEX_UGA_HORISONTAL_RESOLUTION, 63 EFI_INFO_INDEX_UGA_VERTICAL_RESOLUTION, 61 64 EFI_INFO_INDEX_END 62 65 } EfiInfoIndex; -
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxConsoleDxe/VBoxConsole.c
r26441 r26464 21 21 22 22 #include "VBoxConsole.h" 23 #include "VBoxPkg.h" 24 #include "DevEFI.h" 25 #include "iprt/asm.h" 23 26 24 27 /* @todo understand the reasons why TextOutputProtocol.SetMode isn't enough to switch mode. */ … … 30 33 static EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop; 31 34 static EFI_UGA_DRAW_PROTOCOL *Uga; 35 36 /* 37 * @todo move this function to the library. 38 */ 39 static UINT32 40 GetVmVariable(UINT32 Variable, CHAR8* Buffer, UINT32 Size ) 41 { 42 UINT32 VarLen, i; 43 44 45 ASMOutU32(EFI_INFO_PORT, Variable); 46 VarLen = ASMInU32(EFI_INFO_PORT); 47 48 for (i=0; i < VarLen && i < Size; i++) 49 { 50 Buffer[i] = ASMInU8(EFI_INFO_PORT); 51 } 52 53 return VarLen; 54 } 32 55 33 56 static VOID … … 43 66 DEBUG((DEBUG_INFO, "%a:%d - SwitchMode\n", __FILE__, __LINE__)); 44 67 if (Gop) 45 r = Gop->SetMode(Gop, 2); 46 if (Uga) 47 r = Uga->SetMode(Uga, 1024, 768, 32, 60); 68 { 69 UINT32 mode = 2; 70 GetVmVariable(EFI_INFO_INDEX_GOP_MODE, (CHAR8 *)&mode, sizeof(UINT32)); 71 r = Gop->SetMode(Gop, mode); 72 } 73 else if (Uga) 74 { 75 UINT32 H = 1027; 76 UINT32 V = 768; 77 GetVmVariable(EFI_INFO_INDEX_UGA_HORISONTAL_RESOLUTION, (CHAR8 *)&H, sizeof(UINT32)); 78 GetVmVariable(EFI_INFO_INDEX_UGA_VERTICAL_RESOLUTION, (CHAR8 *)&V, sizeof(UINT32)); 79 r = Uga->SetMode(Uga, H, V, 32, 60); 80 } 48 81 if(EFI_ERROR(r)) 49 82 {
Note:
See TracChangeset
for help on using the changeset viewer.