ゼロからのOS自作入門 読みメモ 2章 その1
EDK II
GitHub - tianocore/edk2: EDK II
EDK II でハローワールド
パッケージ宣言ファイル(.dec)
[Defines] DEC_SPECIFICATION = 0x0001001b # DECの仕様のバージョンを記述1.27と10進数で書いてもいいらしい PACKAGE_NAME = HogeOS # 名前 PACKAGE_GUID = df15f4c5-fbaa-54f8-979f-f2ff4aef85b1 # パッケージのGUID。配布とかするならちゃんと気をつける PACKAGE_VERSION = 0.1
3.4 [Defines] Section - EDK II DEC Specification
パッケージ記述ファイル(dsc)
[Defines] PLATFORM_NAME = HogeLoaderPkg PLATFORM_GUID = f25be036-706e-570a-ab06-47a2dd0807f1 PLATFORM_VERSION = 0.1 DSC_SPECIFICATION = 0x0001001c OUTPUT_DIRECTORY = Build/HogeLoader$(ARCH) # ARCHにはアーキテクチャの名前が入るようにしている(x64など) SUPPORTED_ARCHITECTURES = X64 # この本ではX64向けのOSを作るのでX64と入力 BUILD_TARGETS = DEBUG|RELEASE|NOOPT
3.5 [Defines] Section - EDK II DSC Specification
[LibraryClasses] UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf UefiLib|MdePkg/Library/UefiLib/UefiLib.inf 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
- LibraryClasses ではUEFIアプリを作成するのに必要なライブラリの名前とファイルへのパスが記述されている
- 本に沿って作るのでよくわかってないけどそのまま記述
3.8 [LibraryClasses] Sections - EDK II DSC Specification
[Components] HogeLoaderPkg/Loader.inf # パッケージを構成するコンポーネントを指定。ここにあるものがビルド対象
3.10 [Components] Sections - EDK II DSC Specification
コンポーネント定義ファイル(Loader.inf)
[Defines] INF_VERSION = 0x0001001b BASE_NAME = Loader # コンポーネントの名前 FILE_GUID = 3dae0f38-42f0-5d17-94f2-2d1722585667 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] gEfiFileInfoGuid gEfiAcpiTableGuid [Protocols] gEfiLoadedImageProtocolGuid gEfiLoadFileProtocolGuid gEfiSimpleFileSystemProtocolGuid gEfiBlockIoProtocolGuid
- ここも本に沿って作成するのでそのまま合わせて記述
EDK II Module Information (INF) File Specification - EDK II INF Specification
- 次はMainファイルを書いていく