VirtualBox

Changeset 24822 in vbox


Ignore:
Timestamp:
Nov 20, 2009 1:34:44 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55046
Message:

EFI: correct 64-bit entry points

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r24790 r24822  
    763763static int efiLoadThunk(PDEVEFI pThis, PCFGMNODE pCfgHandle)
    764764{
     765    uint8_t f64BitEntry = 0;
     766    int rc;
     767
     768    rc = CFGMR3QueryU8Def(pCfgHandle, "64BitEntry", &f64BitEntry, 0);
     769    if (RT_FAILURE (rc))
     770        return PDMDEV_SET_ERROR(pThis->pDevIns, rc,
     771                                N_("Configuration error: Failed to read \"64BitEntry\""));
     772
    765773    /*
    766774     * Make a copy of the page and set the values of the DEVEFIINFO structure
    767775     * found at the beginning of it.
    768776     */
     777   
     778    if (f64BitEntry)
     779        LogRel(("Using 64-bit EFI firmware\n"));
    769780
    770781    /* Duplicate the page so we can change it. */
     
    785796    pEfiInfo->cbBelow4GB    = pThis->cbBelow4GB;
    786797    pEfiInfo->cbAbove4GB    = pThis->cbAbove4GB;
    787     pEfiInfo->fFlags        = 0; /* todo 0 bit makes 64-bit fw to boot need some knitting with GUI */
     798    /* zeroth bit controls use of 64-bit entry point in fw */
     799    pEfiInfo->fFlags        = f64BitEntry ? 1 : 0;
    788800    pEfiInfo->cCpus         = pThis->cCpus;
    789801    pEfiInfo->pfnPeiEP      = (uint32_t)pThis->GCEntryPoint1;
     
    791803
    792804    /* Register the page as a ROM (data will be copied). */
    793     int rc = PDMDevHlpROMRegister(pThis->pDevIns, UINT32_C(0xfffff000), PAGE_SIZE,
    794                                   pThis->pu8EfiThunk,
    795                                   PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "EFI Thunk");
     805    rc = PDMDevHlpROMRegister(pThis->pDevIns, UINT32_C(0xfffff000), PAGE_SIZE,
     806                              pThis->pu8EfiThunk,
     807                              PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "EFI Thunk");
    796808    if (RT_FAILURE(rc))
    797809        return rc;
     
    870882                              "DmiOEMVBoxRev\0"
    871883#endif
     884                              "64BitEntry\0"
    872885                              ))
    873886        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
  • trunk/src/VBox/Frontends/VBoxShell/vboxshell.py

    r24697 r24822  
    497497        return "Unknown"
    498498
     499def getFirmwareType(type):
     500    if type == 0:
     501        return "invalid"
     502    elif type == 1:
     503        return "bios"
     504    elif type == 2:
     505        return "efi"
     506    elif type == 3:
     507        return "efi64"
     508    elif type == 4:
     509        return "efidual"
     510    else:
     511        return "Unknown"
     512
     513
    499514def infoCmd(ctx,args):
    500515    if (len(args) < 2):
     
    509524    print "  ID [n/a]: %s" %(mach.id)
    510525    print "  OS Type [n/a]: %s" %(os.description)
    511     print "  Firmware [firmwareType]: %s" %(mach.firmwareType)
     526    print "  Firmware [firmwareType]: %s (%s)" %(getFirmwareType(mach.firmwareType),mach.firmwareType)
    512527    print
    513528    print "  CPUs [CPUCount]: %d" %(mach.CPUCount)
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r24706 r24822  
    826826    {
    827827        Utf8Str efiRomFile;
     828        /** @todo: which entry point to use for dual firmware, depend on guest? */
     829        bool f64BitEntry = eFwType == FirmwareType_EFI64;
    828830
    829831        rc = findEfiRom(eFwType, efiRomFile);                                       RC_CHECK();
     
    833835        rc = CFGMR3InsertNode(pDevices, "efi", &pDev);                              RC_CHECK();
    834836        rc = CFGMR3InsertNode(pDev,     "0", &pInst);                               RC_CHECK();
    835         rc = CFGMR3InsertInteger(pInst, "Trusted", 1);              /* boolean */   RC_CHECK();
     837        rc = CFGMR3InsertInteger(pInst, "Trusted", 1);              /* boolean */   RC_CHECK();       
    836838        rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                           RC_CHECK();
    837839        rc = CFGMR3InsertInteger(pCfg,  "RamSize",          cbRam);                 RC_CHECK();
     
    841843        rc = CFGMR3InsertInteger(pCfg,  "IOAPIC",               fIOAPIC);           RC_CHECK();
    842844        rc = CFGMR3InsertBytes(pCfg,    "UUID", &HardwareUuid,sizeof(HardwareUuid));RC_CHECK();
     845        rc = CFGMR3InsertInteger(pCfg,  "64BitEntry", f64BitEntry); /* boolean */   RC_CHECK();
    843846    }
    844847
Note: See TracChangeset for help on using the changeset viewer.

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