From 8eec0b146cb9254b08501dc861cecc54641c994a Mon Sep 17 00:00:00 2001 From: yudejp Date: Tue, 4 May 2021 10:46:03 +0900 Subject: [PATCH] Advance: osbook_day02a --- LoaderPkg/Loader.inf | 23 +++++++++++++++++++++++ LoaderPkg/LoaderPkg.dec | 5 +++++ LoaderPkg/LoaderPkg.dsc | 31 +++++++++++++++++++++++++++++++ LoaderPkg/Main.c | 10 ++++++++++ 4 files changed, 69 insertions(+) create mode 100644 LoaderPkg/Loader.inf create mode 100644 LoaderPkg/LoaderPkg.dec create mode 100644 LoaderPkg/LoaderPkg.dsc create mode 100644 LoaderPkg/Main.c diff --git a/LoaderPkg/Loader.inf b/LoaderPkg/Loader.inf new file mode 100644 index 0000000..b7450ee --- /dev/null +++ b/LoaderPkg/Loader.inf @@ -0,0 +1,23 @@ +[Defines] + INF_VERSION = 0x00010006 + BASE_NAME = Loader + FILE_GUID = c9d0d202-71e9-11e8-9e52-cfbfd0063fbf + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 0.1 + ENTRY_POINT = UefiMain + +# VALID_ARCHITECTURES = X64 + +[Sources] + Main.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + UefiLib + UefiApplicationEntryPoint + +[Guids] + +[Protocols] diff --git a/LoaderPkg/LoaderPkg.dec b/LoaderPkg/LoaderPkg.dec new file mode 100644 index 0000000..539c877 --- /dev/null +++ b/LoaderPkg/LoaderPkg.dec @@ -0,0 +1,5 @@ +[Defines] + DEC_SPECIFICATION = 0x00010005 + PACKAGE_NAME = LoaderPkg + PACKAGE_GUID = 452eae8e-71e9-11e8-a243-df3f1ffdebe1 + PACKAGE_VERSION = 0.1 diff --git a/LoaderPkg/LoaderPkg.dsc b/LoaderPkg/LoaderPkg.dsc new file mode 100644 index 0000000..89a720a --- /dev/null +++ b/LoaderPkg/LoaderPkg.dsc @@ -0,0 +1,31 @@ +#@range_begin(defines) +[Defines] + PLATFORM_NAME = LoaderPkg + PLATFORM_GUID = d3f11f4e-71e9-11e8-a7e1-33fd4f7d5a3e + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/Loader$(ARCH) + SUPPORTED_ARCHITECTURES = X64 + BUILD_TARGETS = DEBUG|RELEASE|NOOPT +#@range_end(defines) + +#@range_begin(library_classes) +[LibraryClasses] + UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf +#@range_end(library_classes) + + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + +#@range_begin(components) +[Components] + firmament/LoaderPkg/Loader.inf +#@range_end(components) diff --git a/LoaderPkg/Main.c b/LoaderPkg/Main.c new file mode 100644 index 0000000..3c4c5cf --- /dev/null +++ b/LoaderPkg/Main.c @@ -0,0 +1,10 @@ +#include +#include + +EFI_STATUS EFIAPI UefiMain( + EFI_HANDLE image_handle, + EFI_SYSTEM_TABLE *system_table) { + Print(L"Welcome to Firmament.\n"); + while (1); + return EFI_SUCCESS; +}