Advance: osbook_day02a

This commit is contained in:
yude 2021-05-04 10:46:03 +09:00
parent e0f96b4a22
commit 8eec0b146c
Signed by: yude
GPG Key ID: EB0FE5D925C4A968
4 changed files with 69 additions and 0 deletions

23
LoaderPkg/Loader.inf Normal file
View File

@ -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]

5
LoaderPkg/LoaderPkg.dec Normal file
View File

@ -0,0 +1,5 @@
[Defines]
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = LoaderPkg
PACKAGE_GUID = 452eae8e-71e9-11e8-a243-df3f1ffdebe1
PACKAGE_VERSION = 0.1

31
LoaderPkg/LoaderPkg.dsc Normal file
View File

@ -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)

10
LoaderPkg/Main.c Normal file
View File

@ -0,0 +1,10 @@
#include <Uefi.h>
#include <Library/UefiLib.h>
EFI_STATUS EFIAPI UefiMain(
EFI_HANDLE image_handle,
EFI_SYSTEM_TABLE *system_table) {
Print(L"Welcome to Firmament.\n");
while (1);
return EFI_SUCCESS;
}