TianoCore EDK2 master
Loading...
Searching...
No Matches
BootManager.c File Reference
#include "BootManager.h"

Go to the source code of this file.

Functions

EFI_STATUS BmSetConsoleMode (BOOLEAN IsSetupMode)
 
VOID BmSetupResetReminder (VOID)
 
VOID GroupMultipleLegacyBootOption4SameType (VOID)
 
CHAR16 * BmDevicePathToStr (IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
 
VOID UpdateBootManager (VOID)
 
EFI_STATUS EFIAPI BootManagerExtractConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
 
EFI_STATUS EFIAPI BootManagerRouteConfig (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
 
VOID BmInitialBootModeInfo (VOID)
 
EFI_STATUS EFIAPI BootManagerCallback (IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
 
EFI_STATUS EFIAPI BootManagerUiLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI BootManagerUiLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

UINT16 mKeyInput
 
EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID
 
UINT32 mBmBootHorizontalResolution = 0
 
UINT32 mBmBootVerticalResolution = 0
 
UINT32 mBmBootTextModeColumn = 0
 
UINT32 mBmBootTextModeRow = 0
 
UINT32 mBmSetupTextModeColumn = 0
 
UINT32 mBmSetupTextModeRow = 0
 
UINT32 mBmSetupHorizontalResolution = 0
 
UINT32 mBmSetupVerticalResolution = 0
 
BOOLEAN mBmModeInitialized = FALSE
 
CHAR16 * mDeviceTypeStr []
 
HII_VENDOR_DEVICE_PATH mBootManagerHiiVendorDevicePath
 
BOOT_MANAGER_CALLBACK_DATA gBootManagerPrivate
 

Detailed Description

The boot manager reference implementation

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file BootManager.c.

Function Documentation

◆ BmDevicePathToStr()

CHAR16 * BmDevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL DevPath)

This function converts an input device structure to a Unicode string.

Parameters
DevPathA pointer to the device path structure.
Returns
A new allocated Unicode string that represents the device path.

Definition at line 441 of file BootManager.c.

◆ BmInitialBootModeInfo()

VOID BmInitialBootModeInfo ( VOID  )

Initial the boot mode related parameters.

Definition at line 703 of file BootManager.c.

◆ BmSetConsoleMode()

EFI_STATUS BmSetConsoleMode ( BOOLEAN  IsSetupMode)

This function will change video resolution and text mode according to defined setup mode or defined boot mode

Parameters
IsSetupModeIndicate mode is changed to setup mode or boot mode.
Return values
EFI_SUCCESSMode is changed successfully.
OthersMode failed to be changed.

Definition at line 89 of file BootManager.c.

◆ BmSetupResetReminder()

VOID BmSetupResetReminder ( VOID  )

Check whether a reset is needed,if reset is needed, Popup a menu to notice user.

Definition at line 303 of file BootManager.c.

◆ BootManagerCallback()

EFI_STATUS EFIAPI BootManagerCallback ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN EFI_BROWSER_ACTION  Action,
IN EFI_QUESTION_ID  QuestionId,
IN UINT8  Type,
IN EFI_IFR_TYPE_VALUE Value,
OUT EFI_BROWSER_ACTION_REQUEST *  ActionRequest 
)

This call back function is registered with Boot Manager formset. When user selects a boot option, this call back function will be triggered. The boot option is saved for later processing.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ActionSpecifies the type of action taken by the browser.
QuestionIdA unique value which is sent to the original exporting driver so that it can identify the type of data to expect.
TypeThe type of value for the question.
ValueA pointer to the data being sent to the original exporting driver.
ActionRequestOn return, points to the action requested by the callback function.
Return values
EFI_SUCCESSThe callback successfully handled the action.
EFI_INVALID_PARAMETERThe setup browser call this function with invalid parameters.

Definition at line 789 of file BootManager.c.

◆ BootManagerExtractConfig()

EFI_STATUS EFIAPI BootManagerExtractConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Request,
OUT EFI_STRING *  Progress,
OUT EFI_STRING *  Results 
)

This function allows a caller to extract the current configuration for one or more named elements from the target driver.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
RequestA null-terminated Unicode string in <ConfigRequest> format.
ProgressOn return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not successful.
ResultsA null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function.
Return values
EFI_SUCCESSThe Results is filled with the requested values.
EFI_OUT_OF_RESOURCESNot enough memory to store the results.
EFI_INVALID_PARAMETERRequest is illegal syntax, or unknown name.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 650 of file BootManager.c.

◆ BootManagerRouteConfig()

EFI_STATUS EFIAPI BootManagerRouteConfig ( IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL This,
IN CONST EFI_STRING  Configuration,
OUT EFI_STRING *  Progress 
)

This function processes the results of changes in configuration.

Parameters
ThisPoints to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
ConfigurationA null-terminated Unicode string in <ConfigResp> format.
ProgressA pointer to a string filled in with the offset of the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) or the terminating NULL if all was successful.
Return values
EFI_SUCCESSThe Results is processed successfully.
EFI_INVALID_PARAMETERConfiguration is NULL.
EFI_NOT_FOUNDRouting data doesn't match any storage in this driver.

Definition at line 683 of file BootManager.c.

◆ BootManagerUiLibConstructor()

EFI_STATUS EFIAPI BootManagerUiLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Install Boot Manager Menu driver.

Parameters
ImageHandleThe image handle.
SystemTableThe system table.
Return values
EFI_SUCEESSInstall Boot manager menu success.
OtherReturn error status.

Definition at line 871 of file BootManager.c.

◆ BootManagerUiLibDestructor()

EFI_STATUS EFIAPI BootManagerUiLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Unloads the application and its installed protocol.

Parameters
[in]ImageHandleHandle that identifies the image to be unloaded.
[in]SystemTableSystem Table
Return values
EFI_SUCCESSThe image has been unloaded.

Definition at line 919 of file BootManager.c.

◆ GroupMultipleLegacyBootOption4SameType()

VOID GroupMultipleLegacyBootOption4SameType ( VOID  )

Group the legacy boot options in the BootOption.

The routine assumes the boot options in the beginning that covers all the device types are ordered properly and re-position the following boot options just after the corresponding boot options with the same device type. For example:

  1. Input = [Harddisk1 CdRom2 Efi1 Harddisk0 CdRom0 CdRom1 Harddisk2 Efi0] Assuming [Harddisk1 CdRom2 Efi1] is ordered properly Output = [Harddisk1 Harddisk0 Harddisk2 CdRom2 CdRom0 CdRom1 Efi1 Efi0]
  2. Input = [Efi1 Efi0 CdRom1 Harddisk0 Harddisk1 Harddisk2 CdRom0 CdRom2] Assuming [Efi1 Efi0 CdRom1 Harddisk0] is ordered properly Output = [Efi1 Efi0 CdRom1 CdRom0 CdRom2 Harddisk0 Harddisk1 Harddisk2]

Definition at line 358 of file BootManager.c.

◆ UpdateBootManager()

VOID UpdateBootManager ( VOID  )

This function invokes Boot Manager. It then enumerate all boot options. If a boot option from the Boot Manager page is selected, Boot Manager will boot from this boot option.

Definition at line 475 of file BootManager.c.

Variable Documentation

◆ gBootManagerPrivate

BOOT_MANAGER_CALLBACK_DATA gBootManagerPrivate
Initial value:
= {
BOOT_MANAGER_CALLBACK_DATA_SIGNATURE,
{
}
}
EFI_STATUS EFIAPI BootManagerCallback(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
Definition: BootManager.c:789
EFI_STATUS EFIAPI BootManagerRouteConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
Definition: BootManager.c:683
EFI_STATUS EFIAPI BootManagerExtractConfig(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
Definition: BootManager.c:650
#define NULL
Definition: Base.h:319

Definition at line 67 of file BootManager.c.

◆ mBmBootHorizontalResolution

UINT32 mBmBootHorizontalResolution = 0

Definition at line 16 of file BootManager.c.

◆ mBmBootTextModeColumn

UINT32 mBmBootTextModeColumn = 0

Definition at line 18 of file BootManager.c.

◆ mBmBootTextModeRow

UINT32 mBmBootTextModeRow = 0

Definition at line 19 of file BootManager.c.

◆ mBmBootVerticalResolution

UINT32 mBmBootVerticalResolution = 0

Definition at line 17 of file BootManager.c.

◆ mBmModeInitialized

BOOLEAN mBmModeInitialized = FALSE

Definition at line 28 of file BootManager.c.

◆ mBmSetupHorizontalResolution

UINT32 mBmSetupHorizontalResolution = 0

Definition at line 25 of file BootManager.c.

◆ mBmSetupTextModeColumn

UINT32 mBmSetupTextModeColumn = 0

Definition at line 23 of file BootManager.c.

◆ mBmSetupTextModeRow

UINT32 mBmSetupTextModeRow = 0

Definition at line 24 of file BootManager.c.

◆ mBmSetupVerticalResolution

UINT32 mBmSetupVerticalResolution = 0

Definition at line 26 of file BootManager.c.

◆ mBootManagerGuid

EFI_GUID mBootManagerGuid = BOOT_MANAGER_FORMSET_GUID

Definition at line 12 of file BootManager.c.

◆ mBootManagerHiiVendorDevicePath

HII_VENDOR_DEVICE_PATH mBootManagerHiiVendorDevicePath
Initial value:
= {
{
{
{
(UINT8)(sizeof (VENDOR_DEVICE_PATH)),
(UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
}
},
{ 0x1dddbe15, 0x481d, 0x4d2b, { 0x82, 0x77, 0xb1, 0x91, 0xea, 0xf6, 0x65, 0x25 }
}
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{
(UINT8)(END_DEVICE_PATH_LENGTH),
(UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
}
}
}
#define HARDWARE_DEVICE_PATH
Definition: DevicePath.h:68
#define HW_VENDOR_DP
Definition: DevicePath.h:133

Definition at line 41 of file BootManager.c.

◆ mDeviceTypeStr

CHAR16* mDeviceTypeStr[]
Initial value:
= {
L"Legacy BEV",
L"Legacy Floppy",
L"Legacy Hard Drive",
L"Legacy CD ROM",
L"Legacy PCMCIA",
L"Legacy USB",
L"Legacy Embedded Network",
L"Legacy Unknown Device"
}

Definition at line 30 of file BootManager.c.

◆ mKeyInput

UINT16 mKeyInput

Definition at line 11 of file BootManager.c.