- Timestamp:
- Feb 8, 2008 4:51:00 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/Makefile.kmk
r5999 r6871 62 62 63 63 # 1. precompile rombios.c 64 $(PATH_TARGET)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c $(PATH_SUB_CURRENT)/apmbios.S | $(call DIRDEP,$(TARGET_PATH))64 $(PATH_TARGET)/_rombios_.c: $(PATH_SUB_CURRENT)/rombios.c $(PATH_SUB_CURRENT)/logo.c $(PATH_SUB_CURRENT)/apmbios.S $(PATH_SUB_CURRENT)/../DevPcBios.h | $(call DIRDEP,$(TARGET_PATH)) 65 65 $(call MSG_TOOL,cpp,PcBiosBin,$<,$@) 66 66 $(QUIET)$(TOOL_$(VBOX_GCC_TOOL)_CC) -E -I$(PATH_TARGET) -I$(VBOX_PATH_DEVICES_SRC)/PC -I$(PATH_ROOT)/include -I$(PATH_OUT) -DBX_SMP_PROCESSORS=1 -DVBOX $(addprefix -D,$(DEFS) $(DEFS.$(BUILD_TYPE))) -P -o $@ $< -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r6374 r6871 28 28 #include <iprt/file.h> 29 29 #include <iprt/string.h> 30 #include <iprt/uuid.h> 30 31 #include <VBox/err.h> 31 32 #include <VBox/param.h> … … 827 828 * @param table pointer to DMI table. 828 829 */ 829 #define STRCPY(p, s) do { memcpy (p, s, sizeof(s)); p += sizeof(s); } while (0) 830 static void pcbiosPlantDMITable(uint8_t *pTable, PRTUUID puuid) 830 #define STRCPY(p, s) do { memcpy (p, s, strlen(s)+1); p += strlen(s)+1; } while (0) 831 #define READCFG(name, variable, default_value) \ 832 do { \ 833 rc = CFGMR3QueryStringAlloc(pCfgHandle, name, & variable); \ 834 if (rc == VERR_CFGM_VALUE_NOT_FOUND) \ 835 variable = MMR3HeapStrDup(PDMDevHlpGetVM(pDevIns), MM_TAG_CFGM, default_value); \ 836 else if (VBOX_FAILURE(rc)) \ 837 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, \ 838 N_("Configuration error: Querying \"" name "\" as a string failed")); \ 839 } while (0) 840 841 static int pcbiosPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, PRTUUID puuid, PCFGMNODE pCfgHandle) 831 842 { 832 843 char *pszStr = (char*)pTable; 833 844 int iStrNr; 845 int rc; 846 char *pszDmiVendor, *pszDmiProduct, *pszDmiVersion, *pszDmiRelease, *pszDmiSerial, *pszDmiUuid = NULL, *pszDmiFamily; 847 848 READCFG("DmiVendor", pszDmiVendor, "innotek GmbH"); 849 READCFG("DmiProduct", pszDmiProduct, "VirtualBox"); 850 READCFG("DmiVersion", pszDmiVersion, "1.2"); 851 READCFG("DmiRelease", pszDmiRelease, "12/01/2006"); 852 READCFG("DmiSerial", pszDmiSerial, "0"); 853 rc = CFGMR3QueryStringAlloc(pCfgHandle, "DmiUuid", &pszDmiUuid); 854 if (VBOX_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND) 855 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 856 N_("Configuration error: Querying \"DmiUuid\" as a string failed")); 857 READCFG("DmiFamily", pszDmiFamily, "Virtual Machine"); 834 858 835 859 PDMIBIOSINF pBIOSInf = (PDMIBIOSINF)pszStr; … … 840 864 pBIOSInf->header.u16Handle = 0x0000; 841 865 pBIOSInf->u8Vendor = iStrNr++; 842 STRCPY(pszStr, "innotek GmbH");866 STRCPY(pszStr, pszDmiVendor); 843 867 pBIOSInf->u8Version = iStrNr++; 844 STRCPY(pszStr, "VirtualBox");868 STRCPY(pszStr, pszDmiProduct); 845 869 pBIOSInf->u16Start = 0xE000; 846 870 pBIOSInf->u8Release = iStrNr++; 847 STRCPY(pszStr, "12/01/2006");871 STRCPY(pszStr, pszDmiRelease); 848 872 pBIOSInf->u8ROMSize = 1; /* 128K */ 849 873 pBIOSInf->u64Characteristics = RT_BIT(4) /* ISA is supported */ … … 871 895 pSystemInf->header.u16Handle = 0x0001; 872 896 pSystemInf->u8Manufacturer = iStrNr++; 873 STRCPY(pszStr, "innotek GmbH");897 STRCPY(pszStr, pszDmiVendor); 874 898 pSystemInf->u8ProductName = iStrNr++; 875 STRCPY(pszStr, "VirtualBox");899 STRCPY(pszStr, pszDmiProduct); 876 900 pSystemInf->u8Version = iStrNr++; 877 STRCPY(pszStr, "1.2");901 STRCPY(pszStr, pszDmiVersion); 878 902 pSystemInf->u8SerialNumber = iStrNr++; 879 STRCPY(pszStr, "0"); 903 STRCPY(pszStr, pszDmiSerial); 904 905 RTUUID uuid; 906 if (pszDmiUuid) 907 { 908 int rc = RTUuidFromStr(&uuid, pszDmiUuid); 909 if (VBOX_FAILURE(rc)) 910 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 911 N_("Invalid UUID for DMI tables specified")); 912 uuid.Gen.u32TimeLow = RT_H2BE_U32(uuid.Gen.u32TimeLow); 913 uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid); 914 uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion); 915 puuid = &uuid; 916 } 880 917 memcpy(pSystemInf->au8Uuid, puuid, sizeof(RTUUID)); 918 881 919 pSystemInf->u8WakeupType = 6; /* Power Switch */ 882 920 pSystemInf->u8SKUNumber = 0; 883 921 pSystemInf->u8Family = iStrNr++; 884 STRCPY(pszStr, "Virtual Machine");922 STRCPY(pszStr, pszDmiFamily); 885 923 *pszStr++ = '\0'; 886 924 887 AssertMsg(pszStr - (char*)pTable == VBOX_DMI_TABLE_SIZE, 888 ("VBOX_DMI_TABLE_SIZE=%d, actual DMI table size is %d", 889 VBOX_DMI_TABLE_SIZE, pszStr - (char*)pTable)); 925 MMR3HeapFree(pszDmiVendor); 926 MMR3HeapFree(pszDmiProduct); 927 MMR3HeapFree(pszDmiVersion); 928 MMR3HeapFree(pszDmiRelease); 929 MMR3HeapFree(pszDmiSerial); 930 MMR3HeapFree(pszDmiUuid); 931 MMR3HeapFree(pszDmiFamily); 932 933 if (pszStr - (char*)pTable > VBOX_DMI_TABLE_SIZE) 934 return PDMDevHlpVMSetError(pDevIns, VERR_NO_MEMORY, RT_SRC_POS, 935 N_("DMI table too long (have=%d, max=%d)"), pszStr - (char*)pTable, VBOX_DMI_TABLE_SIZE); 936 937 return VINF_SUCCESS; 890 938 } 939 #undef STRCPY 891 940 AssertCompile(VBOX_DMI_TABLE_ENTR == 2); 892 941 … … 1217 1266 */ 1218 1267 if (!CFGMR3AreValuesValid(pCfgHandle, 1219 "BootDevice0\0" 1220 "BootDevice1\0" 1221 "BootDevice2\0" 1222 "BootDevice3\0" 1223 "RamSize\0" 1224 "HardDiskDevice\0" 1225 "FloppyDevice\0" 1226 "FadeIn\0" 1227 "FadeOut\0" 1228 "LogoTime\0" 1229 "LogoFile\0" 1230 "ShowBootMenu\0" 1231 "DelayBoot\0" 1232 "BiosRom\0" 1233 "LanBootRom\0" 1234 "PXEDebug\0" 1235 "UUID\0" 1236 "IOAPIC\0")) 1268 "BootDevice0\0BootDevice1\0BootDevice2\0BootDevice3\0" 1269 "RamSize\0HardDiskDevice\0FloppyDevice\0FadeIn\0FadeOut\0LogoTime\0LogoFile\0" 1270 "ShowBootMenu\0DelayBoot\0BiosRom\0LanBootRom\0PXEDebug\0UUID\0IOAPIC\0" 1271 "DmiVendor\0DmiProduct\0DmiVersion\0DmiSerial\0DmiUuid\0DmiFamily\0")) 1237 1272 return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES, 1238 1273 N_("Invalid configuraton for device pcbios device")); … … 1298 1333 uuid.Gen.u16TimeMid = RT_H2BE_U16(uuid.Gen.u16TimeMid); 1299 1334 uuid.Gen.u16TimeHiAndVersion = RT_H2BE_U16(uuid.Gen.u16TimeHiAndVersion); 1300 pcbiosPlantDMITable(pData->au8DMIPage, &uuid); 1335 rc = pcbiosPlantDMITable(pDevIns, pData->au8DMIPage, &uuid, pCfgHandle); 1336 if (VBOX_FAILURE(rc)) 1337 return rc; 1301 1338 if (pData->u8IOAPIC) 1302 1339 pcbiosPlantMPStable(pDevIns, pData->au8DMIPage + 0x100); -
trunk/src/VBox/Devices/PC/DevPcBios.h
r5999 r6871 20 20 21 21 #define VBOX_DMI_TABLE_ENTR 2 22 #define VBOX_DMI_TABLE_SIZE 1 3022 #define VBOX_DMI_TABLE_SIZE 180 /* XXX make this variable */ 23 23 #define VBOX_DMI_TABLE_BASE 0xe1000 24 24 #define VBOX_DMI_TABLE_VER 0x23
Note:
See TracChangeset
for help on using the changeset viewer.