Changeset 43712 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Oct 23, 2012 2:02:24 PM (12 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r41284 r43712 96 96 uint64_t cbAbove4GB; 97 97 98 uint64_t cbRam; 99 100 uint64_t cbRamHole; 101 98 uint64_t cbRam; 99 100 uint64_t cbRamHole; 101 102 /** The size of the DMI tables */ 103 uint16_t cbDmiTables; 102 104 /** The DMI tables. */ 103 105 uint8_t au8DMIPage[0x1000]; … … 113 115 114 116 /* Device properties buffer */ 115 uint8_t* 117 uint8_t* pu8DeviceProps; 116 118 /* Device properties buffer size */ 117 uint32_t 119 uint32_t u32DevicePropsLen; 118 120 119 121 /* Virtual machine front side bus frequency */ … … 474 476 * Plan some structures in RAM. 475 477 */ 476 FwCommonPlantSmbiosAndDmiHdrs(pDevIns );478 FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->cbDmiTables); 477 479 if (pThis->u8IOAPIC) 478 480 FwCommonPlantMpsFloatPtr(pDevIns); … … 1018 1020 "UUID\0" 1019 1021 "IOAPIC\0" 1020 "DmiBIOS Vendor\0"1021 "DmiBIOS Version\0"1022 "DmiBIOSFirmwareMajor\0" 1023 "DmiBIOSFirmwareMinor\0" 1022 1024 "DmiBIOSReleaseDate\0" 1023 1025 "DmiBIOSReleaseMajor\0" 1024 1026 "DmiBIOSReleaseMinor\0" 1025 "DmiBIOSFirmwareMajor\0" 1026 "DmiBIOSFirmwareMinor\0" 1027 "DmiSystemSKU\0" 1027 "DmiBIOSVendor\0" 1028 "DmiBIOSVersion\0" 1028 1029 "DmiSystemFamily\0" 1029 1030 "DmiSystemProduct\0" 1030 1031 "DmiSystemSerial\0" 1032 "DmiSystemSKU\0" 1031 1033 "DmiSystemUuid\0" 1032 1034 "DmiSystemVendor\0" 1033 1035 "DmiSystemVersion\0" 1036 "DmiBoardAssetTag\0" 1037 "DmiBoardBoardType\0" 1038 "DmiBoardLocInChass\0" 1039 "DmiBoardProduct\0" 1040 "DmiBoardSerial\0" 1041 "DmiBoardVendor\0" 1042 "DmiBoardVersion\0" 1043 "DmiChassisAssetTag\0" 1044 "DmiChassisSerial\0" 1034 1045 "DmiChassisVendor\0" 1035 1046 "DmiChassisVersion\0" 1036 "DmiChassisSerial\0" 1037 "DmiChassisAssetTag\0" 1038 #ifdef VBOX_WITH_DMI_OEMSTRINGS 1047 "DmiProcManufacturer\0" 1048 "DmiProcVersion\0" 1039 1049 "DmiOEMVBoxVer\0" 1040 1050 "DmiOEMVBoxRev\0" 1041 #endif1042 1051 "DmiUseHostInfo\0" 1043 1052 "DmiExposeMemoryTable\0" … … 1227 1236 * XXX I wonder if we really need these tables as there is no SMBIOS header... 1228 1237 */ 1229 uint16_t cbDmiTablesDummy;1230 1238 rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &pThis->aUuid, 1231 pDevIns->pCfg, pThis->cCpus, & cbDmiTablesDummy);1239 pDevIns->pCfg, pThis->cCpus, &pThis->cbDmiTables); 1232 1240 AssertRCReturn(rc, rc); 1233 1241 if (pThis->u8IOAPIC) -
trunk/src/VBox/Devices/EFI/DevOVMF.cpp
r43209 r43712 124 124 uint64_t cbAbove4GB; 125 125 126 uint64_t cbRam; 127 128 uint64_t cbRamHole; 129 126 uint64_t cbRam; 127 128 uint64_t cbRamHole; 129 130 /** The size of the DMI tables */ 131 uint16_t cbDmiTables; 130 132 /** The DMI tables. */ 131 133 uint8_t au8DMIPage[0x1000]; … … 141 143 142 144 /* Device properties buffer */ 143 uint8_t* 145 uint8_t* pu8DeviceProps; 144 146 /* Device properties buffer size */ 145 uint32_t 147 uint32_t u32DevicePropsLen; 146 148 147 149 /* Virtual machine front side bus frequency */ … … 157 159 uint32_t u32UgaVertical; 158 160 NVRAMDESC NVRAM; 159 struct { 161 struct 162 { 160 163 PPDMIBASE pDrvBase; 161 164 PDMIBASE IBase; … … 906 909 * Plan some structures in RAM. 907 910 */ 908 FwCommonPlantSmbiosAndDmiHdrs(pDevIns );911 FwCommonPlantSmbiosAndDmiHdrs(pDevIns, pThis->cbDmiTables); 909 912 if (pThis->u8IOAPIC) 910 913 FwCommonPlantMpsFloatPtr(pDevIns); … … 1219 1222 "UUID\0" 1220 1223 "IOAPIC\0" 1221 "DmiBIOS Vendor\0"1222 "DmiBIOS Version\0"1224 "DmiBIOSFirmwareMajor\0" 1225 "DmiBIOSFirmwareMinor\0" 1223 1226 "DmiBIOSReleaseDate\0" 1224 1227 "DmiBIOSReleaseMajor\0" 1225 1228 "DmiBIOSReleaseMinor\0" 1226 "DmiBIOSFirmwareMajor\0" 1227 "DmiBIOSFirmwareMinor\0" 1228 "DmiSystemSKU\0" 1229 "DmiBIOSVendor\0" 1230 "DmiBIOSVersion\0" 1229 1231 "DmiSystemFamily\0" 1230 1232 "DmiSystemProduct\0" 1231 1233 "DmiSystemSerial\0" 1234 "DmiSystemSKU\0" 1232 1235 "DmiSystemUuid\0" 1233 1236 "DmiSystemVendor\0" 1234 1237 "DmiSystemVersion\0" 1238 "DmiBoardAssetTag\0" 1239 "DmiBoardBoardType\0" 1240 "DmiBoardLocInChass\0" 1241 "DmiBoardProduct\0" 1242 "DmiBoardSerial\0" 1243 "DmiBoardVendor\0" 1244 "DmiBoardVersion\0" 1245 "DmiChassisAssetTag\0" 1246 "DmiChassisSerial\0" 1235 1247 "DmiChassisVendor\0" 1236 1248 "DmiChassisVersion\0" 1237 "DmiChassisSerial\0" 1238 "DmiChassisAssetTag\0" 1239 #ifdef VBOX_WITH_DMI_OEMSTRINGS 1249 "DmiProcManufacturer\0" 1250 "DmiProcVersion\0" 1240 1251 "DmiOEMVBoxVer\0" 1241 1252 "DmiOEMVBoxRev\0" 1242 #endif1243 1253 "DmiUseHostInfo\0" 1244 1254 "DmiExposeMemoryTable\0" … … 1447 1457 uint16_t cbDmiTablesDummy; 1448 1458 rc = FwCommonPlantDMITable(pDevIns, pThis->au8DMIPage, VBOX_DMI_TABLE_SIZE, &pThis->aUuid, 1449 pDevIns->pCfg, pThis->cCpus, & cbDmiTablesDummy);1459 pDevIns->pCfg, pThis->cCpus, &pThis->cbDmiTables); 1450 1460 AssertRCReturn(rc, rc); 1451 1461 if (pThis->u8IOAPIC) -
trunk/src/VBox/Devices/PC/BIOS/orgs.asm
r43473 r43712 1790 1790 1791 1791 end 1792 -
trunk/src/VBox/Devices/PC/BIOS/smidmi.inc
r43117 r43712 64 64 db '_DMI_' ; signature 65 65 db 0 ; checksum (set by biossums) 66 dw VBOX_DMI_TABLE_SIZE ; DMI tables length67 dd VBOX_DMI_TABLE_BASE 68 dw VBOX_DMI_TABLE_ENTR 69 db VBOX_DMI_TABLE_VER 66 dw 0 ; DMI tables length (set by DevPcBios) 67 dd VBOX_DMI_TABLE_BASE ; DMI tables base 68 dw VBOX_DMI_TABLE_ENTR ; DMI tables entries 69 db VBOX_DMI_TABLE_VER ; DMI version 70 70 db 0 ; Just for alignment (16 bytes total) -
trunk/src/VBox/Devices/PC/BIOS/vbdmismi.inc
r38699 r43712 3 3 VBOX_DMI_TABLE_BASE equ 0E1000h 4 4 VBOX_DMI_TABLE_VER equ 25h 5 VBOX_DMI_TABLE_ENTR equ 55 VBOX_DMI_TABLE_ENTR equ 9 6 6 VBOX_DMI_TABLE_SIZE equ 352 7 7 -
trunk/src/VBox/Devices/PC/DevFwCommon.cpp
r40277 r43712 631 631 CHECKSIZE(sizeof(*pSystemInf)); 632 632 START_STRUCT(pSystemInf); 633 iStrNr = 1;634 633 pSystemInf->header.u8Type = 1; /* System Information */ 635 634 pSystemInf->header.u8Length = sizeof(*pSystemInf); … … 671 670 PDMIBOARDINF pBoardInf = (PDMIBOARDINF)pszStr; 672 671 CHECKSIZE(sizeof(*pBoardInf)); 673 pszStr = (char *)(pBoardInf + 1); 674 iStrNr = 1; 672 START_STRUCT(pBoardInf); 675 673 int iDmiBoardBoardType; 676 674 pBoardInf->header.u8Type = 2; /* Board Information */ … … 737 735 CHECKSIZE(sizeof(*pProcessorInf)); 738 736 START_STRUCT(pProcessorInf); 739 iStrNr = 1;740 737 if (fDmiExposeProcessorInf) 741 738 pProcessorInf->header.u8Type = 4; /* Processor Information */ … … 855 852 CHECKSIZE(sizeof(*pOEMStrings)); 856 853 START_STRUCT(pOEMStrings); 857 iStrNr = 1;858 854 #ifdef VBOX_WITH_DMI_OEMSTRINGS 859 855 pOEMStrings->header.u8Type = 0xb; /* OEM Strings */ … … 900 896 * @param pDevIns The device instance data. 901 897 */ 902 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns )898 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables) 903 899 { 904 900 struct … … 906 902 struct SMBIOSHDR smbios; 907 903 struct DMIMAINHDR dmi; 908 } aBiosHeaders = 904 } 905 aBiosHeaders = 909 906 { 910 907 // The SMBIOS header … … 923 920 { 0x5f, 0x44, 0x4d, 0x49, 0x5f }, // "_DMI_" signature 924 921 0x00, // checksum 925 VBOX_DMI_TABLE_SIZE,// DMI tables length922 0, // DMI tables length 926 923 VBOX_DMI_TABLE_BASE, // DMI tables base 927 924 VBOX_DMI_TABLE_ENTR, // DMI tables entries … … 930 927 }; 931 928 932 aBiosHeaders.smbios.u8Checksum = fwCommonChecksum((uint8_t*)&aBiosHeaders.smbios, sizeof(aBiosHeaders.smbios)); 933 aBiosHeaders.dmi.u8Checksum = fwCommonChecksum((uint8_t*)&aBiosHeaders.dmi, sizeof(aBiosHeaders.dmi)); 929 aBiosHeaders.dmi.u16TablesLength = cbDmiTables; 930 aBiosHeaders.smbios.u8Checksum = fwCommonChecksum((uint8_t*)&aBiosHeaders.smbios, sizeof(aBiosHeaders.smbios)); 931 aBiosHeaders.dmi.u8Checksum = fwCommonChecksum((uint8_t*)&aBiosHeaders.dmi, sizeof(aBiosHeaders.dmi)); 934 932 935 933 PDMDevHlpPhysWrite(pDevIns, 0xfe300, &aBiosHeaders, sizeof(aBiosHeaders)); -
trunk/src/VBox/Devices/PC/DevFwCommon.h
r40277 r43712 29 29 /* Plant DMI table */ 30 30 int FwCommonPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PCRTUUID pUuid, PCFGMNODE pCfg, uint16_t cCpus, uint16_t *pcbDmiTables); 31 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns );31 void FwCommonPlantSmbiosAndDmiHdrs(PPDMDEVINS pDevIns, uint16_t cbDmiTables); 32 32 33 33 /* Plant MPS table */ -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r41599 r43712 1171 1171 } 1172 1172 1173 const uint8_t *pu8PcBiosBinary;1174 uint32_t cbPcBiosBinary;1175 1173 if (pThis->pszPcBiosFile) 1176 1174 { … … 1242 1240 g_cbPcBiosBinary); 1243 1241 } 1244 pu8PcBiosBinary = pThis->pu8PcBios;1245 cbPcBiosBinary = pThis->cbPcBios;1242 const uint8_t *pu8PcBiosBinary = pThis->pu8PcBios; 1243 uint32_t cbPcBiosBinary = pThis->cbPcBios; 1246 1244 1247 1245 /* … … 1264 1262 return rc; 1265 1263 1266 /* If the DMI table is located at the expected place, patch the DMI table length and the checksum. */ 1267 if ( pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x00] == '_' 1268 && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x01] == 'D' 1269 && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x02] == 'M' 1270 && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x03] == 'I' 1271 && pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x04] == '_') 1272 { 1273 *(uint16_t*)&pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x06] = cbDmiTables; 1274 uint8_t u8Sum = 0; 1275 for (unsigned i = 0; i < pThis->cbPcBios; i++) 1276 if (i != VBOX_DMI_TABLE_OFFSET + 0x05) 1277 u8Sum += pThis->pu8PcBios[i]; 1278 pThis->pu8PcBios[VBOX_DMI_TABLE_OFFSET + 0x05] = -u8Sum; 1264 for (unsigned i = 0; i < pThis->cbPcBios; i += 16) 1265 { 1266 /* If the DMI table is located at the expected place, patch the DMI table length and the checksum. */ 1267 if ( pThis->pu8PcBios[i + 0x00] == '_' 1268 && pThis->pu8PcBios[i + 0x01] == 'D' 1269 && pThis->pu8PcBios[i + 0x02] == 'M' 1270 && pThis->pu8PcBios[i + 0x03] == 'I' 1271 && pThis->pu8PcBios[i + 0x04] == '_' 1272 && *(uint16_t*)&pThis->pu8PcBios[i + 0x06] == 0) 1273 { 1274 *(uint16_t*)&pThis->pu8PcBios[i + 0x06] = cbDmiTables; 1275 uint8_t u8Sum = 0; 1276 for (unsigned j = 0; j < pThis->cbPcBios; j++) 1277 if (j != i + 0x05) 1278 u8Sum += pThis->pu8PcBios[j]; 1279 pThis->pu8PcBios[i + 0x05] = -u8Sum; 1280 break; 1281 } 1279 1282 } 1280 1283 -
trunk/src/VBox/Devices/PC/DevPcBios.h
r40277 r43712 28 28 */ 29 29 #define VBOX_DMI_TABLE_ENTR 9 30 #define VBOX_DMI_TABLE_OFFSET 0xff4031 30 32 31 /** def VBOX_DMI_TABLE_SIZE
Note:
See TracChangeset
for help on using the changeset viewer.