VirtualBox

Changeset 26601 in vbox


Ignore:
Timestamp:
Feb 17, 2010 11:25:00 AM (15 years ago)
Author:
vboxsync
Message:

host DMI info support

Location:
trunk/src/VBox/Devices
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r26591 r26601  
    10221022                              "DmiOEMVBoxRev\0"
    10231023#endif
     1024                              "DmiUseHostInfo\0"
    10241025                              "64BitEntry\0"
    10251026                              "BootArgs\0"
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r26173 r26601  
    3636#include <iprt/string.h>
    3737#include <iprt/uuid.h>
     38#include <iprt/system.h>
    3839
    3940#include "../Builtins.h"
     
    5859static const char   *s_szDefDmiBIOSReleaseDate  = "12/01/2006";
    5960static const char   *s_szDefDmiSystemVendor     = "innotek GmbH";
    60 static const char   *s_szDefDmiSystemProduct    = "VirtualBox";
    61 static const char   *s_szDefDmiSystemVersion    = "1.2";
     61static       char    s_szDefDmiSystemProduct[13]  = "VirtualBox";
     62static       char    s_szDefDmiSystemVersion[4]   = "1.2";
    6263static const char   *s_szDefDmiSystemSerial     = "0";
    6364static const char   *s_szDefDmiSystemFamily     = "Virtual Machine";
     
    296297}
    297298
    298 static bool sharedfwChecksumOk(const uint8_t * const au8Data, uint32_t u32Length)
     299static bool fwCommonChecksumOk(const uint8_t * const au8Data, uint32_t u32Length)
    299300{
    300301    uint8_t u8Sum = 0;
     
    303304    return (u8Sum == 0);
    304305}
    305 
     306/*
     307 * Macmini2,1 - matches Mac Mini
     308 */
     309static void fwCommonUseHostDMIStrings(void)
     310{
     311    int rc;
     312
     313    rc = RTSystemQueryDmiString(RTSYSDMISTR_PRODUCT_NAME,
     314                                s_szDefDmiSystemProduct,
     315                                sizeof s_szDefDmiSystemProduct);
     316    if (RT_FAILURE(rc))
     317    {
     318        // ignore rc?
     319    }
     320
     321    rc = RTSystemQueryDmiString(RTSYSDMISTR_PRODUCT_VERSION,
     322                                s_szDefDmiSystemVersion,
     323                                sizeof s_szDefDmiSystemVersion);
     324    if (RT_FAILURE(rc))
     325    {
     326        // ignore rc?
     327    }
     328}
    306329
    307330/**
     
    407430#endif
    408431
     432    uint8_t fDmiUseHostInfo;
     433    int rc = CFGMR3QueryU8Def(pCfg, "DmiUseHostInfo", &fDmiUseHostInfo, 1);
     434    if (RT_FAILURE (rc))
     435        return PDMDEV_SET_ERROR(pDevIns, rc,
     436                                N_("Configuration error: Failed to read \"DmiUseHostInfo\""));
     437
     438    /* Sync up with host default DMI values */
     439    if (fDmiUseHostInfo)
     440        fwCommonUseHostDMIStrings();
     441
    409442    for  (;; fForceDefault = true, fHideErrors = false)
    410443    {
    411444        int  iStrNr;
    412         int  rc;
    413445        char szBuf[256];
    414446        char *pszStr = (char *)pTable;
  • trunk/src/VBox/Devices/PC/DevPcBios.cpp

    r26173 r26601  
    925925                              "DmiOEMVBoxRev\0"
    926926#endif
     927                              "DmiUseHostInfo\0"
    927928                              ))
    928929        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette