2 This sample application bases on HelloWorld PCD setting
3 to print "UEFI Hello World!" to the UEFI Console.
5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/PcdLib.h>
12 #include <Library/UefiLib.h>
13 #include <Library/UefiApplicationEntryPoint.h>
16 // String token ID of help message text.
17 // Shell supports to find help message in the resource section of an application image if
18 // .MAN file is not found. This global variable is added to make build tool recognizes
19 // that the help string is consumed by user and then build tool will add the string into
20 // the resource section. Thus the application can use '-?' option to show help message in
23 GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId
= STRING_TOKEN (STR_HELLO_WORLD_HELP_INFORMATION
);
26 The user Entry Point for Application. The user code starts with this function
27 as the real entry point for the application.
29 @param[in] ImageHandle The firmware allocated handle for the EFI image.
30 @param[in] SystemTable A pointer to the EFI System Table.
32 @retval EFI_SUCCESS The entry point is executed successfully.
33 @retval other Some error occurs when executing this entry point.
39 IN EFI_HANDLE ImageHandle
,
40 IN EFI_SYSTEM_TABLE
*SystemTable
48 // Three PCD type (FeatureFlag, UINT32 and String) are used as the sample.
50 if (FeaturePcdGet (PcdHelloWorldPrintEnable
)) {
51 for (Index
= 0; Index
< PcdGet32 (PcdHelloWorldPrintTimes
); Index
++) {
53 // Use UefiLib Print API to print string to UEFI console
55 Print ((CHAR16
*)PcdGetPtr (PcdHelloWorldPrintString
));