VirtualBox

Changeset 25025 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Nov 26, 2009 5:06:38 PM (15 years ago)
Author:
vboxsync
Message:

EFI: system tables work (device side)

Location:
trunk/src/VBox/Devices/PC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevFwCommon.cpp

    r24964 r25025  
    4242
    4343#pragma pack(1)
     44
     45typedef struct SMBIOSHDR
     46{
     47    uint8_t         au8Signature[4];
     48    uint8_t         u8Checksum;
     49    uint8_t         u8Eps;
     50    uint8_t         u8VersionMajor;
     51    uint8_t         u8VersionMinor;
     52    uint16_t        u16MaxStructureSize;
     53    uint8_t         u8EntryPointRevision;
     54    uint8_t         u8Pad[5];
     55} *SMBIOSHDRPTR;
     56AssertCompileSize(SMBIOSHDR, 16);
     57
     58typedef struct DMIMAINHDR
     59{
     60    uint8_t         au8Signature[5];
     61    uint8_t         u8Checksum;
     62    uint16_t        u16TablesLength;
     63    uint32_t        u32TableBase;
     64    uint16_t        u16TableEntries;
     65    uint16_t        u8TableVersion;
     66    uint8_t         u8Pad;
     67} *DMIMAINHDRPTR;
    4468
    4569/** DMI header */
     
    253277 * @param   pCfgHandle  The handle to our config node.
    254278 */
    255 int sharedfwPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PRTUUID pUuid, PCFGMNODE pCfgHandle)
     279int sharedfwPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PRTUUID pUuid, PCFGMNODE pCfgHandle, bool fPutSmbiosHeaders)
    256280{
    257281    char *pszStr = (char *)pTable;
     
    497521    MMR3HeapFree(pszDmiOEMVBoxRev);
    498522
     523    if (fPutSmbiosHeaders)
     524    {
     525        struct {
     526            struct SMBIOSHDR     smbios;
     527            struct DMIMAINHDR    dmi;
     528        } aBiosHeaders =
     529        {
     530            // The SMBIOS header
     531            {
     532                { 0x5f, 0x53, 0x4d, 0x5f},         // "_SM_" signature
     533                0x00,                              // checksum
     534                0x1f,                              // EPS length, defined by standard
     535                VBOX_SMBIOS_MAJOR_VER,             // SMBIOS major version
     536                VBOX_SMBIOS_MINOR_VER,             // SMBIOS minor version
     537                VBOX_SMBIOS_MAXSS,                 // Maximum structure size
     538                0x00,                              // Entry point revision
     539                { 0x00, 0x00, 0x00, 0x00, 0x00 }   // padding
     540            },
     541            // The DMI header
     542            {
     543                { 0x5f, 0x44, 0x4d, 0x49, 0x5f },  // "_DMI_" signature
     544                0x00,                              // checksum
     545                VBOX_DMI_TABLE_SIZE,               // DMI tables length
     546                VBOX_DMI_TABLE_BASE,               // DMI tables base
     547                VBOX_DMI_TABLE_ENTR,               // DMI tables entries
     548                VBOX_DMI_TABLE_VER,                // DMI version
     549                0x00
     550            }
     551        };
     552
     553        aBiosHeaders.smbios.u8Checksum = sharedfwChecksum((uint8_t*)&aBiosHeaders.smbios, sizeof(aBiosHeaders.smbios));
     554        aBiosHeaders.dmi.u8Checksum = sharedfwChecksum((uint8_t*)&aBiosHeaders.dmi, sizeof(aBiosHeaders.dmi));
     555
     556        //Log(("Write SMBIOS\n"));
     557        PDMDevHlpPhysWrite (pDevIns, 0xff30, &aBiosHeaders, sizeof(aBiosHeaders));
     558    }
     559
    499560    return VINF_SUCCESS;
    500561}
  • trunk/src/VBox/Devices/PC/DevFwCommon.h

    r24706 r25025  
    11/* $Id$ */
    22/** @file
    3  * DevFwCommon - shared header for code common between different firmware types (EFI, BIOS).   
     3 * DevFwCommon - shared header for code common between different firmware types (EFI, BIOS).
    44 */
    55
     
    3232
    3333/* Plant DMI table */
    34 int sharedfwPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PRTUUID pUuid, PCFGMNODE pCfgHandle);
     34int sharedfwPlantDMITable(PPDMDEVINS pDevIns, uint8_t *pTable, unsigned cbMax, PRTUUID pUuid, PCFGMNODE pCfgHandle, bool fPutSmbiosHeaders = false);
    3535
    3636/* Plant MPS table */
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