1、edk22/MdeModulePkg/Application/HelloWorld# cat HelloWorld.c
#include <Uefi.h>
#include <Library/PcdLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Print/Print.h>
EFI_STATUS EFIAPI UefiMain (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
{
Print(L"Hello Renqihong jiayou!!!!\r\n");
Print11();
return EFI_SUCCESS;
}
2、edk22/MdeModulePkg/Application/HelloWorld# cat Print/Print.c
#include <Uefi.h>
#include <Print.h>
EFI_STATUS Print11()
{
Print(L"Hello Renqihong jiayou2222!!!!\r\n");
return EFI_SUCCESS;
}
3、edk22/MdeModulePkg/Application/HelloWorld# cat Print/Print.h
EFI_STATUS Print11();
4、edk22/MdeModulePkg/Application/HelloWorld# cat HelloWorld.inf
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = HelloWorld
MODULE_UNI_FILE = HelloWorld.uni
FILE_GUID = 6987936E-ED34-44db-AE97-1FA5E4ED2116
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = UefiMain
UEFI_HII_RESOURCE_SECTION = TRUE
[Sources]
HelloWorld.c
HelloWorldStr.uni
Print/Print.c
Print/Print.h
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
UefiApplicationEntryPoint
UefiLib
PcdLib
5、运行效果: