VirtualBox

Changeset 24858 in vbox


Ignore:
Timestamp:
Nov 23, 2009 9:56:20 AM (15 years ago)
Author:
vboxsync
Message:

EFI: more bitness work

Location:
trunk
Files:
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.kmk

    r24831 r24858  
    299299buildserver-efifw_MODE = 0644
    300300buildserver-efifw_SOURCES = \
    301         $(buildserver-efifw_0_OUTDIR)/FV/VBOX.fd=>vboxefi.fv \
    302         $(buildserver-efifw_0_OUTDIR)/FV/VBOX64.fd=>vboxefi64.fv
     301        $(buildserver-efifw_0_OUTDIR)/FV/VBOX.fd=>VBoxEFI32.fd \
     302        $(buildserver-efifw_0_OUTDIR)/FV/VBOX64.fd=>VBoxEFI64.fd
    303303buildserver-efifw_CLEANS = \
    304304        $(buildserver-efifw_0_OUTDIR)/FV/VBOX.fd \
     
    338338local-efifw_MODE = 0644
    339339local-efifw_SOURCES = \
    340         $(PATH_ROOT)/src/VBox/Devices/EFI/FirmwareBin/vboxefi.fv=>vboxefi.fv \
    341         $(PATH_ROOT)/src/VBox/Devices/EFI/FirmwareBin/vboxefi64.fv=>vboxefi64.fv
     340        $(PATH_ROOT)/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd=>VBoxEFI32.fd \
     341        $(PATH_ROOT)/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd=>VBoxEFI64.fd
    342342endif # VBOX_WITH_EFIFW_FROM_BUILD_SERVER
    343343
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r24827 r24858  
    145145                 "                            [--accelerate2dvideo <on|off>]\n"
    146146#endif
    147                  "                            [--firmware bios|efi|efi64]\n"
     147                 "                            [--firmware bios|efi|efi32|efi64]\n"
    148148                 "                            [--bioslogofadein on|off]\n"
    149149                 "                            [--bioslogofadeout on|off]\n"
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r24856 r24858  
    302302            case MODIFYVM_FIRMWARE:
    303303            {
    304                 if (!strcmp(ValueUnion.psz, "efi") || !strcmp(ValueUnion.psz, "efi32"))
     304                if (!strcmp(ValueUnion.psz, "efi"))
    305305                {
    306306                    CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI));
     307                }
     308                else if (!strcmp(ValueUnion.psz, "efi32"))
     309                {
     310                    CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI32));
    307311                }
    308312                else if (!strcmp(ValueUnion.psz, "efi64"))
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r24840 r24858  
    133133#endif
    134134
    135 static int findEfiRom(FirmwareType_T aFirmwareType, Utf8Str& aEfiRomFile)
     135static int findEfiRom(IVirtualBox* vbox, FirmwareType_T aFirmwareType, Utf8Str& aEfiRomFile)
    136136{
    137     /** @todo: combine with similar table in VirtualBox::CheckFirmwarePresent */
    138     static const struct {
    139         FirmwareType_T type;
    140         const char*    fileName;
    141     } firmwareDesc[] = {
    142         {
    143             /* compiled-in firmware */
    144             FirmwareType_BIOS,    NULL,
    145         },
    146         {
    147             FirmwareType_EFI,     "vboxefi.fv"
    148         },
    149         {
    150             FirmwareType_EFI64,   "vboxefi64.fv"
    151         },
    152         {
    153             FirmwareType_EFIDUAL, "vboxefidual.fv"
    154         }
    155     };
    156 
    157 
    158      for (size_t i = 0; i < sizeof(firmwareDesc) / sizeof(firmwareDesc[0]); i++)
    159     {
    160         if (aFirmwareType != firmwareDesc[i].type)
    161             continue;
    162 
    163         AssertRCReturn(firmwareDesc[i].fileName != NULL, E_INVALIDARG);
    164 
    165         /* Search in ~/.VirtualBox/Firmware and RTPathAppPrivateArch() */
    166         char pszVBoxPath[RTPATH_MAX];
    167         int rc;
    168 
    169         rc = com::GetVBoxUserHomeDirectory(pszVBoxPath, sizeof(pszVBoxPath)); AssertRCReturn(rc, rc);
    170         aEfiRomFile = Utf8StrFmt("%s%cFirmware%c%s",
    171                                  pszVBoxPath,
    172                                  RTPATH_DELIMITER,
    173                                  RTPATH_DELIMITER,
    174                                  firmwareDesc[i].fileName);
    175         if (RTFileExists(aEfiRomFile.raw()))
    176             return S_OK;
    177 
    178         rc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); AssertRCReturn(rc, rc);
    179         aEfiRomFile = Utf8StrFmt("%s%c%s",
    180                               pszVBoxPath,
    181                               RTPATH_DELIMITER,
    182                               firmwareDesc[i].fileName);
    183 
    184         if (RTFileExists(aEfiRomFile.raw()))
    185             return S_OK;
    186 
    187         aEfiRomFile = "";
     137    int rc;
     138    BOOL fPresent = FALSE;
     139    Bstr aFilePath, empty;
     140   
     141    rc = vbox->CheckFirmwarePresent(aFirmwareType, empty,
     142                                    empty.asOutParam(), aFilePath.asOutParam(), &fPresent);
     143    if (RT_FAILURE(rc))
     144        AssertComRCReturn (rc, VERR_FILE_NOT_FOUND);
     145
     146    if (!fPresent)
    188147        return VERR_FILE_NOT_FOUND;
    189     }
    190 
    191      return E_INVALIDARG;
     148
     149    aEfiRomFile = Utf8Str(aFilePath);
     150
     151    return S_OK;
    192152}
    193153
     
    825785    else
    826786    {
    827         Utf8Str efiRomFile;
    828         /** @todo: which entry point to use for dual firmware, depend on guest? */
    829         bool f64BitEntry = fIs64BitGuest;
    830         //eFwType = f64BitEntry? FirmwareType_EFI64: FirmwareType_EFI;
    831         rc = findEfiRom(f64BitEntry? FirmwareType_EFI64: FirmwareType_EFI, efiRomFile);                  RC_CHECK();
     787        Utf8Str efiRomFile;       
     788       
     789        /* Autodetect firmware type, basing on guest type */
     790        if (eFwType == FirmwareType_EFI)
     791        {
     792            eFwType =
     793                    fIs64BitGuest ?
     794                    (FirmwareType_T)FirmwareType_EFI64
     795                    :
     796                    (FirmwareType_T)FirmwareType_EFI32;
     797        }
     798
     799        rc = findEfiRom(virtualBox, eFwType, efiRomFile);                                                                                                                          RC_CHECK();
     800        bool f64BitEntry = eFwType == FirmwareType_EFI64;
    832801        /*
    833802         * EFI.
     
    835804        rc = CFGMR3InsertNode(pDevices, "efi", &pDev);                              RC_CHECK();
    836805        rc = CFGMR3InsertNode(pDev,     "0", &pInst);                               RC_CHECK();
    837         rc = CFGMR3InsertInteger(pInst, "Trusted", 1);              /* boolean */   RC_CHECK();       
     806        rc = CFGMR3InsertInteger(pInst, "Trusted", 1);              /* boolean */   RC_CHECK();
    838807        rc = CFGMR3InsertNode(pInst,    "Config", &pCfg);                           RC_CHECK();
    839808        rc = CFGMR3InsertInteger(pCfg,  "RamSize",          cbRam);                 RC_CHECK();
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r24841 r24858  
    934934                                 IN_BSTR        aVersion,
    935935                                 BSTR           *aUrl,
     936                                 BSTR           *aFile,
    936937                                 BOOL           *aResult)
    937938{
     
    953954        },
    954955        {
    955             FirmwareType_EFI,     "vboxefi.fv",     "http://virtualbox.org/firmware/32/vboxefi.fv"
     956            FirmwareType_EFI32,   "VBoxEFI32.fd",   "http://virtualbox.org/firmware/VBoxEFI32.fd"
    956957        },
    957958        {
    958             FirmwareType_EFI64,   "vboxefi64.fv",   "http://virtualbox.org/firmware/64/vboxefi.fv"
     959            FirmwareType_EFI64,   "VBoxEFI64.fd",   "http://virtualbox.org/firmware/VBoxEFI64.fd"
    959960        },
    960961        {
    961             FirmwareType_EFIDUAL, "vboxefidual.fv", "http://virtualbox.org/firmware/dual/vboxefi.fv"
     962            FirmwareType_EFIDUAL, "VBoxEFIDual.fd", "http://virtualbox.org/firmware/VBoxEFIDual.fd"
    962963        }
    963964    };
     
    985986        {
    986987            *aResult = TRUE;
     988             if (aFile)
     989                Utf8Str(fullName).cloneTo(aFile);
    987990            break;
    988991        }
     
    9971000        {
    9981001            *aResult = TRUE;
     1002            if (aFile)
     1003                Utf8Str(fullName).cloneTo(aFile);
    9991004            break;
    10001005        }
    10011006
     1007       
    10021008        url = firmwareDesc[i].url;
    10031009        /** @todo: account for version in the URL */
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r24786 r24858  
    11031103      Firmware type.
    11041104    </desc>
    1105     <const name="BIOS"            value="1">
     1105    <const name="BIOS"           value="1">
    11061106      <desc>BIOS Firmware.</desc>
    11071107    </const>
    1108     <const name="EFI"             value="2">
     1108    <const name="EFI"            value="2">
     1109      <desc>EFI Firmware, bitness detetced basing on OS type.</desc>
     1110    </const>
     1111    <const name="EFI32"          value="3">
    11091112      <desc>Efi firmware, 32-bit.</desc>
    11101113    </const>
    1111     <const name="EFI64"           value="3">
     1114    <const name="EFI64"          value="4">
    11121115      <desc>Efi firmware, 64-bit.</desc>
    11131116    </const>
    1114     <const name="EFIDUAL"         value="4">
     1117    <const name="EFIDUAL"        value="5">
    11151118      <desc>Efi firmware, combined 32 and 64-bit.</desc>
    11161119    </const>
     
    30313034        </desc>
    30323035      </param>
     3036
     3037      <param name="file" type="wstring" dir="out">
     3038        <desc>
     3039          Filename of firmware, only valid if result == TRUE.
     3040        </desc>
     3041      </param>
     3042
    30333043      <param name="result" type="boolean" dir="return">
    30343044        <desc>If firmware of this type and version is available.</desc>
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r24599 r24858  
    177177    STDMETHOD(FindDHCPServerByNetworkName) (IN_BSTR aName, IDHCPServer ** aServer);
    178178    STDMETHOD(RemoveDHCPServer) (IDHCPServer * aServer);
    179     STDMETHOD(CheckFirmwarePresent)(FirmwareType_T aFirmwareType, IN_BSTR aVersion, 
    180                                     BSTR * aUrl, BOOL * aResult);
     179    STDMETHOD(CheckFirmwarePresent)(FirmwareType_T aFirmwareType, IN_BSTR aVersion,
     180                                    BSTR * aUrl, BSTR * aFile, BOOL * aResult);
    181181
    182182    /* public methods only for internal purposes */
     
    311311
    312312#endif // ____H_VIRTUALBOXIMPL
    313 
  • trunk/src/VBox/Main/xml/Settings.cpp

    r24599 r24858  
    15921592                        )
    15931593                    hw.firmwareType = FirmwareType_EFI;
     1594                else if (    strFirmwareType == "EFI32")
     1595                    hw.firmwareType = FirmwareType_EFI32;
    15941596                else if (    strFirmwareType == "EFI64")
    15951597                    hw.firmwareType = FirmwareType_EFI64;
     
    24882490         {
    24892491            case FirmwareType_EFI:      pcszFirmware = "EFI";   break;
     2492            case FirmwareType_EFI32:    pcszFirmware = "EFI32"; break;
    24902493            case FirmwareType_EFI64:    pcszFirmware = "EFI64"; break;
    24912494            case FirmwareType_EFIDUAL:  pcszFirmware = "EFIDUAL"; break;
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