VirtualBox

Changeset 26109 in vbox for trunk/src/VBox/Devices/EFI


Ignore:
Timestamp:
Jan 31, 2010 10:29:08 AM (15 years ago)
Author:
vboxsync
Message:

EFI: allow passing boot args via extradata

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

Legend:

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

    r25790 r26109  
    107107    /** I/O-APIC enabled? */
    108108    uint8_t         u8IOAPIC;
     109
     110    /* Boot parameters passed to the firmware */
     111    char           pszBootArgs[256];
    109112} DEVEFI;
    110113typedef DEVEFI *PDEVEFI;
     
    126129static uint32_t efiInfoSize(PDEVEFI pThis)
    127130{
    128     /* So far, everything is 4 bytes, as we only support 32-bit EFI */
    129131    switch (pThis->iInfoSelector)
    130132    {
     
    136138        case EFI_INFO_INDEX_STACK_SIZE:
    137139            return 4;
     140         case EFI_INFO_INDEX_BOOT_ARGS:
     141             return RTStrNLen(pThis->pszBootArgs, sizeof pThis->pszBootArgs) + 1;
    138142    }
    139143    Assert(false);
     
    165169            iValue = 128*1024; /* 128 K */
    166170            break;
     171        case EFI_INFO_INDEX_BOOT_ARGS:
     172            return pThis->pszBootArgs[pThis->iInfoPosition];
    167173        default:
    168174            Assert(false);
     
    893899#endif
    894900                              "64BitEntry\0"
     901                              "BootArgs\0"
    895902                              ))
    896903        return PDMDEV_SET_ERROR(pDevIns, VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES,
     
    964971        pThis->pszEfiRomFile = NULL;
    965972    }
     973
     974     /*
     975     * Get boot args.
     976     */
     977    rc = CFGMR3QueryString(pCfgHandle, "BootArgs",
     978                           pThis->pszBootArgs, sizeof pThis->pszBootArgs);
     979    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     980    {
     981        strcpy(pThis->pszBootArgs, "");
     982        rc = VINF_SUCCESS;
     983    }
     984    if (RT_FAILURE(rc))
     985        return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,
     986                                   N_("Configuration error: Querying \"BootArgs\" as a string failed"));
     987
     988    LogRel(("EFI boot args: %s\n", pThis->pszBootArgs));
    966989
    967990#ifdef DEVEFI_WITH_VBOXDBG_SCRIPT
  • trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/Include/DevEFI.h

    r24798 r26109  
    5454    EFI_INFO_INDEX_STACK_BASE,
    5555    EFI_INFO_INDEX_STACK_SIZE,
     56    EFI_INFO_INDEX_BOOT_ARGS,
    5657    EFI_INFO_INDEX_END
    5758} EfiInfoIndex;
     
    143144
    144145#endif
    145 
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