Data Structures | |
struct | BDS_COMMON_OPTION |
struct | BDS_CONSOLE_CONNECT_ENTRY |
struct | POOL_PRINT |
struct | DEVICE_PATH_STRING_TABLE |
struct | VENDOR_DEVICE_PATH_WITH_DATA |
struct | ISCSI_DEVICE_PATH_WITH_NAME |
Defines | |
#define | VAR_LEGACY_DEV_ORDER L"LegacyDevOrder" |
#define | FRONT_PAGE_QUESTION_ID 0x0000 |
#define | FRONT_PAGE_DATA_WIDTH 0x01 |
#define | CONSOLE_OUT 0x00000001 |
#define | STD_ERROR 0x00000002 |
#define | CONSOLE_IN 0x00000004 |
#define | CONSOLE_ALL (CONSOLE_OUT | CONSOLE_IN | STD_ERROR) |
#define | LOAD_OPTION_ACTIVE 0x00000001 |
#define | LOAD_OPTION_FORCE_RECONNECT 0x00000002 |
#define | LOAD_OPTION_HIDDEN 0x00000008 |
#define | LOAD_OPTION_CATEGORY 0x00001F00 |
#define | LOAD_OPTION_CATEGORY_BOOT 0x00000000 |
#define | LOAD_OPTION_CATEGORY_APP 0x00000100 |
#define | EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001 |
#define | EFI_BOOT_OPTION_SUPPORT_APP 0x00000002 |
#define | IS_LOAD_OPTION_TYPE(_c, _Mask) (BOOLEAN) (((_c) & (_Mask)) != 0) |
#define | MAX_CHAR 480 |
#define | MAX_CHAR_SIZE (MAX_CHAR * 2) |
#define | BOOT_OPTION_MAX_CHAR 10 |
#define | BDS_LOAD_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'C', 'O') |
#define | REFRESH_LEGACY_BOOT_OPTIONS |
#define | BDS_EFI_ACPI_FLOPPY_BOOT 0x0201 |
#define | BDS_EFI_MESSAGE_ATAPI_BOOT 0x0301 |
#define | BDS_EFI_MESSAGE_SCSI_BOOT 0x0302 |
#define | BDS_EFI_MESSAGE_USB_DEVICE_BOOT 0x0305 |
#define | BDS_EFI_MESSAGE_SATA_BOOT 0x0312 |
#define | BDS_EFI_MESSAGE_MAC_BOOT 0x030b |
#define | BDS_EFI_MESSAGE_MISC_BOOT 0x03FF |
#define | BDS_EFI_MEDIA_HD_BOOT 0x0401 |
#define | BDS_EFI_MEDIA_CDROM_BOOT 0x0402 |
#define | BDS_LEGACY_BBS_BOOT 0x0501 |
#define | BDS_EFI_UNSUPPORT 0xFFFF |
Typedefs | |
typedef VOID(* | DEV_PATH_FUNCTION )(IN OUT POOL_PRINT *Str, IN VOID *DevPath) |
Functions | |
VOID EFIAPI | BdsLibBootNext (VOID) |
EFI_STATUS EFIAPI | BdsLibBootViaBootOption (IN BDS_COMMON_OPTION *Option, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData) |
EFI_STATUS EFIAPI | BdsLibEnumerateAllBootOption (IN OUT LIST_ENTRY *BdsBootOptionList) |
VOID EFIAPI | BdsLibBuildOptionFromHandle (IN EFI_HANDLE Handle, IN LIST_ENTRY *BdsBootOptionList, IN CHAR16 *String) |
VOID EFIAPI | BdsLibBuildOptionFromShell (IN EFI_HANDLE Handle, IN OUT LIST_ENTRY *BdsBootOptionList) |
EFI_STATUS EFIAPI | BdsLibGetBootMode (OUT EFI_BOOT_MODE *BootMode) |
VOID EFIAPI | BdsLibLoadDrivers (IN LIST_ENTRY *BdsDriverLists) |
EFI_STATUS EFIAPI | BdsLibBuildOptionFromVar (IN LIST_ENTRY *BdsCommonOptionList, IN CHAR16 *VariableName) |
VOID *EFIAPI | BdsLibGetVariableAndSize (IN CHAR16 *Name, IN EFI_GUID *VendorGuid, OUT UINTN *VariableSize) |
EFI_STATUS EFIAPI | BdsLibOutputStrings (IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut,...) |
BDS_COMMON_OPTION *EFIAPI | BdsLibVariableToOption (IN OUT LIST_ENTRY *BdsCommonOptionList, IN CHAR16 *VariableName) |
EFI_STATUS EFIAPI | BdsLibRegisterNewOption (IN LIST_ENTRY *BdsOptionList, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CHAR16 *String, IN CHAR16 *VariableName) |
VOID EFIAPI | BdsLibConnectAllDriversToAllControllers (VOID) |
VOID EFIAPI | BdsLibConnectAll (VOID) |
EFI_STATUS EFIAPI | BdsLibConnectDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect) |
EFI_STATUS EFIAPI | BdsLibConnectAllEfi (VOID) |
EFI_STATUS EFIAPI | BdsLibDisconnectAllEfi (VOID) |
VOID EFIAPI | BdsLibConnectAllConsoles (VOID) |
EFI_STATUS EFIAPI | BdsLibConnectAllDefaultConsoles (VOID) |
EFI_STATUS EFIAPI | BdsLibConnectAllDefaultConsolesWithOutConIn (VOID) |
EFI_STATUS EFIAPI | BdsLibUpdateConsoleVariable (IN CHAR16 *ConVarName, IN EFI_DEVICE_PATH_PROTOCOL *CustomizedConDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *ExclusiveDevicePath) |
EFI_STATUS EFIAPI | BdsLibConnectConsoleVariable (IN CHAR16 *ConVarName) |
EFI_DEVICE_PATH_PROTOCOL *EFIAPI | BdsLibDelPartMatchInstance (IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single) |
BOOLEAN EFIAPI | BdsLibMatchDevicePaths (IN EFI_DEVICE_PATH_PROTOCOL *Multi, IN EFI_DEVICE_PATH_PROTOCOL *Single) |
CHAR16 *EFIAPI | DevicePathToStr (IN EFI_DEVICE_PATH_PROTOCOL *DevPath) |
EFI_STATUS EFIAPI | BdsDeleteAllInvalidLegacyBootOptions (VOID) |
EFI_STATUS EFIAPI | BdsAddNonExistingLegacyBootOptions (VOID) |
EFI_STATUS EFIAPI | BdsUpdateLegacyDevOrder (VOID) |
EFI_STATUS EFIAPI | BdsRefreshBbsTableForBoot (IN BDS_COMMON_OPTION *Entry) |
EFI_STATUS EFIAPI | BdsDeleteBootOption (IN UINTN OptionNumber, IN OUT UINT16 *BootOrder, IN OUT UINTN *BootOrderSize) |
VOID EFIAPI | EnableResetReminderFeature (VOID) |
VOID EFIAPI | DisableResetReminderFeature (VOID) |
VOID EFIAPI | EnableResetRequired (VOID) |
VOID EFIAPI | DisableResetRequired (VOID) |
BOOLEAN EFIAPI | IsResetReminderFeatureEnable (VOID) |
BOOLEAN EFIAPI | IsResetRequired (VOID) |
VOID EFIAPI | SetupResetReminder (VOID) |
BOOLEAN EFIAPI | MatchPartitionDevicePathNode (IN EFI_DEVICE_PATH_PROTOCOL *BlockIoDevicePath, IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath) |
EFI_DEVICE_PATH_PROTOCOL *EFIAPI | BdsExpandPartitionPartialDevicePathToFull (IN HARDDRIVE_DEVICE_PATH *HardDriveDevicePath) |
EFI_HANDLE EFIAPI | BdsLibGetBootableHandle (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
BOOLEAN EFIAPI | BdsLibIsValidEFIBootOptDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevPath, IN BOOLEAN CheckMedia) |
BOOLEAN EFIAPI | BdsLibIsValidEFIBootOptDevicePathExt (IN EFI_DEVICE_PATH_PROTOCOL *DevPath, IN BOOLEAN CheckMedia, IN CHAR16 *Description) |
UINT32 EFIAPI | BdsGetBootTypeFromDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath) |
VOID EFIAPI | BdsLibSaveMemoryTypeInformation (VOID) |
EFI_STATUS EFIAPI | BdsLibUserIdentify (OUT EFI_USER_PROFILE_HANDLE *User) |
EFI_STATUS EFIAPI | BdsLibUpdateFvFileDevicePath (IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, IN EFI_GUID *FileGuid) |
EFI_STATUS EFIAPI | BdsLibConnectUsbDevByShortFormDP (IN UINT8 HostControllerPI, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath) |
VOID | DevPathVendor (IN OUT POOL_PRINT *Str, IN VOID *DevPath) |
CHAR16 *EFIAPI | CatPrint (IN OUT POOL_PRINT *Str, IN CHAR16 *Fmt,...) |
EFI_STATUS EFIAPI | EnableQuietBoot (IN EFI_GUID *LogoFile) |
EFI_STATUS EFIAPI | DisableQuietBoot (VOID) |
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define BDS_EFI_ACPI_FLOPPY_BOOT 0x0201 |
Define the boot type with which to classify the boot option type. Different boot option types could have different boot behaviors. Use their device path node (Type + SubType) as the type value. The boot type here can be added according to requirements. ACPI boot type. For ACPI devices, using sub-types to distinguish devices is not allowed, so hardcode their values.
#define BDS_EFI_MEDIA_CDROM_BOOT 0x0402 |
#define BDS_EFI_MEDIA_HD_BOOT 0x0401 |
Media boot type If a device path of boot option contains a media node, the boot option is media boot type.
#define BDS_EFI_MESSAGE_ATAPI_BOOT 0x0301 |
Message boot type If a device path of boot option only points to a message node, the boot option is a message boot type.
#define BDS_EFI_MESSAGE_MAC_BOOT 0x030b |
#define BDS_EFI_MESSAGE_MISC_BOOT 0x03FF |
#define BDS_EFI_MESSAGE_SATA_BOOT 0x0312 |
#define BDS_EFI_MESSAGE_SCSI_BOOT 0x0302 |
#define BDS_EFI_MESSAGE_USB_DEVICE_BOOT 0x0305 |
#define BDS_EFI_UNSUPPORT 0xFFFF |
#define BDS_LEGACY_BBS_BOOT 0x0501 |
BBS boot type If a device path of boot option contains a BBS node, the boot option is BBS boot type.
#define BDS_LOAD_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'C', 'O') |
#define BOOT_OPTION_MAX_CHAR 10 |
Define maximum characters for boot option variable "BootXXXX".
#define CONSOLE_ALL (CONSOLE_OUT | CONSOLE_IN | STD_ERROR) |
#define CONSOLE_IN 0x00000004 |
#define CONSOLE_OUT 0x00000001 |
ConnectType
#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002 |
#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001 |
#define FRONT_PAGE_DATA_WIDTH 0x01 |
#define FRONT_PAGE_QUESTION_ID 0x0000 |
Data structures and defines.
#define IS_LOAD_OPTION_TYPE | ( | _c, | |||
_Mask | ) | (BOOLEAN) (((_c) & (_Mask)) != 0) |
#define LOAD_OPTION_ACTIVE 0x00000001 |
Load Option Attributes
#define LOAD_OPTION_CATEGORY 0x00001F00 |
#define LOAD_OPTION_CATEGORY_APP 0x00000100 |
#define LOAD_OPTION_CATEGORY_BOOT 0x00000000 |
#define LOAD_OPTION_FORCE_RECONNECT 0x00000002 |
#define LOAD_OPTION_HIDDEN 0x00000008 |
#define MAX_CHAR 480 |
Define the maximum characters that will be accepted.
#define MAX_CHAR_SIZE (MAX_CHAR * 2) |
#define REFRESH_LEGACY_BOOT_OPTIONS |
#define STD_ERROR 0x00000002 |
#define VAR_LEGACY_DEV_ORDER L"LegacyDevOrder" |
Constants which are variable names used to access variables.
typedef VOID(* DEV_PATH_FUNCTION)(IN OUT POOL_PRINT *Str, IN VOID *DevPath) |
EFI_STATUS EFIAPI BdsAddNonExistingLegacyBootOptions | ( | VOID | ) |
Add the legacy boot options from BBS table if they do not exist.
EFI_SUCCESS | The boot options were added successfully, or they are already in boot options. | |
EFI_NOT_FOUND | No legacy boot options is found. | |
EFI_OUT_OF_RESOURCE | No enough memory. |
EFI_STATUS EFIAPI BdsDeleteAllInvalidLegacyBootOptions | ( | VOID | ) |
Delete all the invalid legacy boot options.
EFI_SUCCESS | All invalid legacy boot options are deleted. | |
EFI_OUT_OF_RESOURCES | Failed to allocate necessary memory. | |
EFI_NOT_FOUND | Failed to retrieve variable of boot order. |
EFI_STATUS EFIAPI BdsDeleteBootOption | ( | IN UINTN | OptionNumber, | |
IN OUT UINT16 * | BootOrder, | |||
IN OUT UINTN * | BootOrderSize | |||
) |
Delete the Boot Option from EFI Variable. The Boot Order Arrray is also updated.
OptionNumber | The number of Boot options wanting to be deleted. | |
BootOrder | The Boot Order array. | |
BootOrderSize | The size of the Boot Order Array. |
EFI_SUCCESS | The Boot Option Variable was found and removed. | |
EFI_UNSUPPORTED | The Boot Option Variable store was inaccessible. | |
EFI_NOT_FOUND | The Boot Option Variable was not found. |
EFI_DEVICE_PATH_PROTOCOL* EFIAPI BdsExpandPartitionPartialDevicePathToFull | ( | IN HARDDRIVE_DEVICE_PATH * | HardDriveDevicePath | ) |
Expand a device path that starts with a hard drive media device path node to be a full device path that includes the full hardware path to the device. This function enables the device to boot. To avoid requiring a connect on every boot, the front match is saved in a variable (the part point to the partition node. E.g. ACPI() /PCI()/ATA()/Partition() ). All successful history device paths that point to the front part of the partition node will be saved.
HardDriveDevicePath | EFI Device Path to boot, if it starts with a hard drive media device path. |
UINT32 EFIAPI BdsGetBootTypeFromDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
For a bootable Device path, return its boot type.
DevicePath | The bootable device Path to check. |
BDS_EFI_MEDIA_HD_BOOT | The given device path contains MEDIA_DEVICE_PATH type device path node, whose subtype is MEDIA_HARDDRIVE_DP. | |
BDS_EFI_MEDIA_CDROM_BOOT | If given device path contains MEDIA_DEVICE_PATH type device path node, whose subtype is MEDIA_CDROM_DP. | |
BDS_EFI_ACPI_FLOPPY_BOOT | A given device path contains ACPI_DEVICE_PATH type device path node, whose HID is floppy device. | |
BDS_EFI_MESSAGE_ATAPI_BOOT | A given device path contains MESSAGING_DEVICE_PATH type device path node, and its last device path node's subtype is MSG_ATAPI_DP. | |
BDS_EFI_MESSAGE_SCSI_BOOT | A given device path contains MESSAGING_DEVICE_PATH type device path node, and its last device path node's subtype is MSG_SCSI_DP. | |
BDS_EFI_MESSAGE_USB_DEVICE_BOOT | A given device path contains MESSAGING_DEVICE_PATH type device path node, and its last device path node's subtype is MSG_USB_DP. | |
BDS_EFI_MESSAGE_MISC_BOOT | The device path does not contain any media device path node, and its last device path node points to a message device path node. | |
BDS_LEGACY_BBS_BOOT | A given device path contains BBS_DEVICE_PATH type device path node. | |
BDS_EFI_UNSUPPORT | An EFI Removable BlockIO device path does not point to a media and message device. |
VOID EFIAPI BdsLibBootNext | ( | VOID | ) |
Boot from the UEFI spec defined "BootNext" variable.
EFI_STATUS EFIAPI BdsLibBootViaBootOption | ( | IN BDS_COMMON_OPTION * | Option, | |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | |||
OUT UINTN * | ExitDataSize, | |||
OUT CHAR16 ** | ExitData | |||
) |
Process the boot option according to the UEFI specification. The legacy boot option device path includes BBS_DEVICE_PATH.
Option | The boot option to be processed. | |
DevicePath | The device path describing where to load the boot image or the legcy BBS device path to boot the legacy OS. | |
ExitDataSize | The size of exit data. | |
ExitData | Data returned when Boot image failed. |
EFI_SUCCESS | Boot from the input boot option succeeded. | |
EFI_NOT_FOUND | The Device Path is not found in the system. |
VOID EFIAPI BdsLibBuildOptionFromHandle | ( | IN EFI_HANDLE | Handle, | |
IN LIST_ENTRY * | BdsBootOptionList, | |||
IN CHAR16 * | String | |||
) |
Build the boot option with the handle parsed in.
Handle | The handle representing the device path for which to create a boot option. | |
BdsBootOptionList | The header of the link list that indexed all current boot options. | |
String | The description of the boot option. |
VOID EFIAPI BdsLibBuildOptionFromShell | ( | IN EFI_HANDLE | Handle, | |
IN OUT LIST_ENTRY * | BdsBootOptionList | |||
) |
Build the on flash shell boot option with the handle parsed in.
Handle | The handle which present the device path to create the on flash shell boot option. | |
BdsBootOptionList | The header of the link list that indexed all current boot options. |
EFI_STATUS EFIAPI BdsLibBuildOptionFromVar | ( | IN LIST_ENTRY * | BdsCommonOptionList, | |
IN CHAR16 * | VariableName | |||
) |
This function processes BootOrder or DriverOrder variables, by calling
BdsLibVariableToOption () for each UINT16 in the variables.
BdsCommonOptionList | The header of the option list base on the variable VariableName. | |
VariableName | An EFI Variable name indicate the BootOrder or DriverOrder. |
EFI_SUCCESS | Successfully created the boot option or driver option list. | |
EFI_OUT_OF_RESOURCES | Failed to get the boot option or the driver option list. |
VOID EFIAPI BdsLibConnectAll | ( | VOID | ) |
This function connects all system drivers to controllers.
VOID EFIAPI BdsLibConnectAllConsoles | ( | VOID | ) |
This function will search every simpletxt device in the current system, and make every simpletxt device a potential console device.
EFI_STATUS EFIAPI BdsLibConnectAllDefaultConsoles | ( | VOID | ) |
This function will connect console device based on the console device variable ConIn, ConOut and ErrOut.
EFI_SUCCESS | At least one of the ConIn and ConOut devices have been connected. | |
EFI_STATUS | Return the status of BdsLibConnectConsoleVariable (). |
EFI_STATUS EFIAPI BdsLibConnectAllDefaultConsolesWithOutConIn | ( | VOID | ) |
This function will connect console device except ConIn base on the console device variable ConOut and ErrOut.
EFI_SUCCESS | At least one of the ConOut device have been connected success. | |
EFI_STATUS | Return the status of BdsLibConnectConsoleVariable (). |
VOID EFIAPI BdsLibConnectAllDriversToAllControllers | ( | VOID | ) |
This function connects all system drivers with the corresponding controllers.
EFI_STATUS EFIAPI BdsLibConnectAllEfi | ( | VOID | ) |
This function will connect all current system handles recursively. gBS->ConnectController() service is invoked for each handle exist in system handler buffer. If the handle is bus type handler, all childrens also will be connected recursively by gBS->ConnectController().
EFI_SUCCESS | All handles and child handles have been connected. | |
EFI_STATUS | Return the status of gBS->LocateHandleBuffer(). |
EFI_STATUS EFIAPI BdsLibConnectConsoleVariable | ( | IN CHAR16 * | ConVarName | ) |
Connect the console device base on the variable ConVarName, if device path of the ConVarName is multi-instance device path and anyone of the instances is connected success, then this function will return success. If the handle associate with one device path node can not be created successfully, then still give chance to do the dispatch, which load the missing drivers if possible.
ConVarName | Console related variable name, ConIn, ConOut, ErrOut. |
EFI_NOT_FOUND | There is not any console devices connected success | |
EFI_SUCCESS | Success connect any one instance of the console device path base on the variable ConVarName. |
EFI_STATUS EFIAPI BdsLibConnectDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePathToConnect | ) |
This function will create all handles associate with every device path node. If the handle associate with one device path node can not be created successfully, then still give chance to do the dispatch, which load the missing drivers if possible.
DevicePathToConnect | The device path to be connected. Can be a multi-instance device path. |
EFI_SUCCESS | All handles associates with every device path node were created. | |
EFI_OUT_OF_RESOURCES | Not enough resources to create new handles. | |
EFI_NOT_FOUND | At least one handle could not be created. |
EFI_STATUS EFIAPI BdsLibConnectUsbDevByShortFormDP | ( | IN UINT8 | HostControllerPI, | |
IN EFI_DEVICE_PATH_PROTOCOL * | RemainingDevicePath | |||
) |
Connect the specific USB device that matches the RemainingDevicePath, and whose bus is determined by Host Controller (Uhci or Ehci).
HostControllerPI | Uhci (0x00) or Ehci (0x20) or Both uhci and ehci (0xFF). | |
RemainingDevicePath | A short-form device path that starts with the first element being a USB WWID or a USB Class device path. |
EFI_SUCCESS | The specific Usb device is connected successfully. | |
EFI_INVALID_PARAMETER | Invalid HostControllerPi (not 0x00, 0x20 or 0xFF) or RemainingDevicePath is not the USB class device path. | |
EFI_NOT_FOUND | The device specified by device path is not found. |
EFI_DEVICE_PATH_PROTOCOL* EFIAPI BdsLibDelPartMatchInstance | ( | IN EFI_DEVICE_PATH_PROTOCOL * | Multi, | |
IN EFI_DEVICE_PATH_PROTOCOL * | Single | |||
) |
Delete the instance in Multi that overlaps with Single.
Multi | A pointer to a multi-instance device path data structure. | |
Single | A pointer to a single-instance device path data structure. |
EFI_STATUS EFIAPI BdsLibDisconnectAllEfi | ( | VOID | ) |
This function will disconnect all current system handles. gBS->DisconnectController() is invoked for each handle exists in system handle buffer. If handle is a bus type handle, all childrens also are disconnected recursively by gBS->DisconnectController().
EFI_SUCCESS | All handles have been disconnected. | |
EFI_STATUS | Error status returned by of gBS->LocateHandleBuffer(). |
EFI_STATUS EFIAPI BdsLibEnumerateAllBootOption | ( | IN OUT LIST_ENTRY * | BdsBootOptionList | ) |
This function will enumerate all possible boot devices in the system, and automatically create boot options for Network, Shell, Removable BlockIo, and Non-BlockIo Simplefile devices.
BDS separates EFI boot options into six types: 1. Network - The boot option points to the SimpleNetworkProtocol device. Bds will try to automatically create this type of boot option during enumeration. 2. Shell - The boot option points to internal flash shell. Bds will try to automatically create this type of boot option during enumeration. 3. Removable BlockIo - The boot option points to a removable media device, such as a USB flash drive or DVD drive. These devices should contain a *removable* blockIo protocol in their device handle. Bds will try to automatically create this type boot option when enumerate. 4. Fixed BlockIo - The boot option points to a Fixed blockIo device, such as a hard disk. These devices should contain a *fixed* blockIo protocol in their device handle. BDS will skip fixed blockIo devices, and not automatically create boot option for them. But BDS will help to delete those fixed blockIo boot options, whose description rules conflict with other auto-created boot options. 5. Non-BlockIo Simplefile - The boot option points to a device whose handle has SimpleFileSystem Protocol, but has no blockio protocol. These devices do not offer blockIo protocol, but BDS still can get the {machinename}.EFI by SimpleFileSystem Protocol. 6. File - The boot option points to a file. These boot options are usually created by the user, either manually or with an OS loader. BDS will not delete or modify these boot options.
This function will enumerate all possible boot devices in the system, and automatically create boot options for Network, Shell, Removable BlockIo, and Non-BlockIo Simplefile devices. It will excute once every boot.
BdsBootOptionList | The header of the linked list that indexed all current boot options. |
EFI_SUCCESS | Finished all the boot device enumerations and created the boot option based on the boot device. | |
EFI_OUT_OF_RESOURCES | Failed to enumerate the boot device and create the boot option list. |
EFI_HANDLE EFIAPI BdsLibGetBootableHandle | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath | ) |
Return the bootable media handle. First, check whether the device is connected. Second, check whether the device path points to a device that supports SimpleFileSystemProtocol. Third, detect the the default boot file in the Media, and return the removable Media handle.
DevicePath | The Device Path to a bootable device. |
EFI_STATUS EFIAPI BdsLibGetBootMode | ( | OUT EFI_BOOT_MODE * | BootMode | ) |
Get boot mode by looking up the configuration table and parsing the HOB list.
BootMode | The boot mode from PEI handoff HOB. |
EFI_SUCCESS | Successfully got boot mode. |
VOID* EFIAPI BdsLibGetVariableAndSize | ( | IN CHAR16 * | Name, | |
IN EFI_GUID * | VendorGuid, | |||
OUT UINTN * | VariableSize | |||
) |
This function reads the EFI variable (VendorGuid/Name) and returns a dynamically allocated buffer and the size of the buffer. If it fails, return NULL.
Name | The string part of the EFI variable name. | |
VendorGuid | The GUID part of the EFI variable name. | |
VariableSize | Returns the size of the EFI variable that was read. |
NULL | The variable was not read. |
BOOLEAN EFIAPI BdsLibIsValidEFIBootOptDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevPath, | |
IN BOOLEAN | CheckMedia | |||
) |
Checks whether the Device path in a boot option points to a valid bootable device, and if the device is ready to boot now.
DevPath | The Device path in a boot option. | |
CheckMedia | If true, check whether the device is ready to boot now. |
TRUE | The Device path is valid. | |
FALSE | The Device path is invalid. |
BOOLEAN EFIAPI BdsLibIsValidEFIBootOptDevicePathExt | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevPath, | |
IN BOOLEAN | CheckMedia, | |||
IN CHAR16 * | Description | |||
) |
Checks whether the Device path in a boot option points to a valid bootable device, and if the device is ready to boot now. If Description is not NULL and the device path points to a fixed BlockIo device, this function checks whether the description conflicts with other auto-created boot options.
DevPath | The Device path in a boot option. | |
CheckMedia | If true, checks if the device is ready to boot now. | |
Description | The description of a boot option. |
TRUE | The Device path is valid. | |
FALSE | The Device path is invalid. |
VOID EFIAPI BdsLibLoadDrivers | ( | IN LIST_ENTRY * | BdsDriverLists | ) |
The function will go through the driver option link list, and then load and start every driver to which the driver option device path points.
BdsDriverLists | The header of the current driver option link list. |
BOOLEAN EFIAPI BdsLibMatchDevicePaths | ( | IN EFI_DEVICE_PATH_PROTOCOL * | Multi, | |
IN EFI_DEVICE_PATH_PROTOCOL * | Single | |||
) |
This function compares a device path data structure to that of all the nodes of a second device path instance.
Multi | A pointer to a multi-instance device path data structure. | |
Single | A pointer to a single-instance device path data structure. |
TRUE | If the Single device path is contained within a Multi device path. | |
FALSE | The Single device path is not contained within a Multi device path. |
EFI_STATUS EFIAPI BdsLibOutputStrings | ( | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * | ConOut, | |
... | ||||
) |
This function prints a series of strings.
ConOut | A pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. | |
... | A variable argument list containing a series of strings, the last string must be NULL. |
EFI_SUCCESS | Successfully printed out the string using ConOut. | |
EFI_STATUS | Return the status of the ConOut->OutputString (). |
EFI_STATUS EFIAPI BdsLibRegisterNewOption | ( | IN LIST_ENTRY * | BdsOptionList, | |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | |||
IN CHAR16 * | String, | |||
IN CHAR16 * | VariableName | |||
) |
This function registers the new boot#### or driver#### option based on the VariableName. The new registered boot#### or driver#### will be linked to BdsOptionList and also update to the VariableName. After the boot#### or driver#### updated, the BootOrder or DriverOrder will also be updated.
BdsOptionList | The header of the boot#### or driver#### link list. | |
DevicePath | The device path that the boot#### or driver#### option present. | |
String | The description of the boot#### or driver####. | |
VariableName | Indicate if the boot#### or driver#### option. |
EFI_SUCCESS | The boot#### or driver#### have been successfully registered. | |
EFI_STATUS | Return the status of gRT->SetVariable (). |
VOID EFIAPI BdsLibSaveMemoryTypeInformation | ( | VOID | ) |
This routine registers a function to adjust the different types of memory page numbers just before booting, and saves the updated info into the variable for the next boot to use.
EFI_STATUS EFIAPI BdsLibUpdateConsoleVariable | ( | IN CHAR16 * | ConVarName, | |
IN EFI_DEVICE_PATH_PROTOCOL * | CustomizedConDevicePath, | |||
IN EFI_DEVICE_PATH_PROTOCOL * | ExclusiveDevicePath | |||
) |
This function updates the console variable based on ConVarName. It can add or remove one specific console device path from the variable
ConVarName | The console-related variable name: ConIn, ConOut, ErrOut. | |
CustomizedConDevicePath | The console device path to be added to the console variable ConVarName. Cannot be multi-instance. | |
ExclusiveDevicePath | The console device path to be removed from the console variable ConVarName. Cannot be multi-instance. |
EFI_UNSUPPORTED | The added device path is the same as a removed one. | |
EFI_SUCCESS | Successfully added or removed the device path from the console variable. |
EFI_STATUS EFIAPI BdsLibUpdateFvFileDevicePath | ( | IN OUT EFI_DEVICE_PATH_PROTOCOL ** | DevicePath, | |
IN EFI_GUID * | FileGuid | |||
) |
This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid, it tries to return the valid device path. FV address maybe changes for memory layout adjust from time to time, use this funciton could promise the Fv file device path is right.
DevicePath | On input, the Fv file device path to check. On output, the updated valid Fv file device path | |
FileGuid | the Fv file GUID. |
EFI_INVALID_PARAMETER | The input DevicePath or FileGuid is invalid. | |
EFI_UNSUPPORTED | The input DevicePath does not contain an Fv file GUID at all. | |
EFI_ALREADY_STARTED | The input DevicePath has pointed to the Fv file and is valid. | |
EFI_SUCCESS | Successfully updated the invalid DevicePath and returned the updated device path in DevicePath. |
EFI_STATUS EFIAPI BdsLibUserIdentify | ( | OUT EFI_USER_PROFILE_HANDLE * | User | ) |
Identify a user and, if authenticated, returns the current user profile handle.
[out] | User | Points to the user profile handle. |
EFI_SUCCESS | The user is successfully identified, or user identification is not supported. | |
EFI_ACCESS_DENIED | The user was not successfully identified. |
BDS_COMMON_OPTION* EFIAPI BdsLibVariableToOption | ( | IN OUT LIST_ENTRY * | BdsCommonOptionList, | |
IN CHAR16 * | VariableName | |||
) |
Build the boot#### or driver#### option from the VariableName. The build boot#### or driver#### will also be linked to BdsCommonOptionList.
BdsCommonOptionList | The header of the boot#### or driver#### option link list. | |
VariableName | EFI Variable name, indicates if it is boot#### or driver####. |
BDS_COMMON_OPTION | The option that was created. | |
NULL | Failed to get the new option. |
EFI_STATUS EFIAPI BdsRefreshBbsTableForBoot | ( | IN BDS_COMMON_OPTION * | Entry | ) |
Refresh the boot priority for BBS entries based on boot option entry and boot order.
Entry | The boot option is to be checked for a refreshed BBS table. |
EFI_SUCCESS | The boot priority for BBS entries refreshed successfully. | |
EFI_NOT_FOUND | BBS entries can't be found. | |
EFI_OUT_OF_RESOURCES | Failed to get the legacy device boot order. |
EFI_STATUS EFIAPI BdsUpdateLegacyDevOrder | ( | VOID | ) |
Add the legacy boot devices from BBS table into the legacy device boot order.
EFI_SUCCESS | The boot devices were added successfully. | |
EFI_NOT_FOUND | The legacy boot devices are not found. | |
EFI_OUT_OF_RESOURCES | Memory or storage is not enough. | |
EFI_DEVICE_ERROR | Failed to add the legacy device boot order into EFI variable because of a hardware error. |
CHAR16* EFIAPI CatPrint | ( | IN OUT POOL_PRINT * | Str, | |
IN CHAR16 * | Fmt, | |||
... | ||||
) |
Concatenates a formatted unicode string to an allocated pool. The caller must free the resulting buffer.
Str | Tracks the allocated pool, size in use, and amount of pool allocated. | |
Fmt | The format string. | |
... | The data will be printed. |
CHAR16* EFIAPI DevicePathToStr | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevPath | ) |
This function converts an input device structure to a Unicode string.
DevPath | A pointer to the device path structure. |
VOID DevPathVendor | ( | IN OUT POOL_PRINT * | Str, | |
IN VOID * | DevPath | |||
) |
Convert Vendor device path to a device name.
Str | The buffer storing device name. | |
DevPath | The pointer to vendor device path. |
EFI_STATUS EFIAPI DisableQuietBoot | ( | VOID | ) |
Use SystemTable ConOut to turn on video based Simple Text Out consoles. The Simple Text Out screens will now be synced up with all non-video output devices.
EFI_SUCCESS | UGA devices are back in text mode and synced up. |
VOID EFIAPI DisableResetReminderFeature | ( | VOID | ) |
Disable the setup browser reset reminder feature. This routine is used in a platform tip. If the platform policy does not want the feature, use the routine to disable it.
VOID EFIAPI DisableResetRequired | ( | VOID | ) |
Record the info that no reset is required. A module boolean variable is used to record whether a reset is required.
EFI_STATUS EFIAPI EnableQuietBoot | ( | IN EFI_GUID * | LogoFile | ) |
Use SystemTable ConOut to stop video based Simple Text Out consoles from going to the video device. Put up LogoFile on every video device that is a console.
[in] | LogoFile | The file name of logo to display on the center of the screen. |
EFI_SUCCESS | ConsoleControl has been flipped to graphics and logo displayed. | |
EFI_UNSUPPORTED | Logo not found. |
VOID EFIAPI EnableResetReminderFeature | ( | VOID | ) |
Enable the setup browser reset reminder feature. This routine is used in a platform tip. If the platform policy needs the feature, use the routine to enable it.
VOID EFIAPI EnableResetRequired | ( | VOID | ) |
Record the info that a reset is required. A module boolean variable is used to record whether a reset is required.
BOOLEAN EFIAPI IsResetReminderFeatureEnable | ( | VOID | ) |
Check whether platform policy enables the reset reminder feature. The default is enabled.
BOOLEAN EFIAPI IsResetRequired | ( | VOID | ) |
Check if the user changed any option setting that needs a system reset to be effective.
BOOLEAN EFIAPI MatchPartitionDevicePathNode | ( | IN EFI_DEVICE_PATH_PROTOCOL * | BlockIoDevicePath, | |
IN HARDDRIVE_DEVICE_PATH * | HardDriveDevicePath | |||
) |
Check whether an instance in BlockIoDevicePath has the same partition node as the HardDriveDevicePath device path.
BlockIoDevicePath | Multi device path instances to check. | |
HardDriveDevicePath | A device path starting with a hard drive media device path. |
TRUE | There is a matched device path instance. | |
FALSE | There is no matched device path instance. |
VOID EFIAPI SetupResetReminder | ( | VOID | ) |
Check whether a reset is needed, and finish the reset reminder feature. If a reset is needed, pop up a menu to notice user, and finish the feature according to the user selection.