# 43. HII 데이터베이스 개념 및 출력

이번 장에서는 HII(Human Interface Infrastructure)에 대해 학습한다.

모든 BIOS는 사용자와 어떤 형태로든 상호 작용이 있다. 예로 부팅 시 표시되는 이미지, 부팅 시 특수 키를 통해 BIOS 설정을 제어하는 메뉴 선택으로의 진입 등이다. 이러한 형식의 텍스트는 사용자 지정 글꼴을 적용할 수 있다. 그리고 BIOS에서 언어 설정을 변경할 경우 인터페이스의 모든 문자열이 변경된 언어로 번역되어야 한다.

HII의 주요 목표는 이러한 휴먼 인터페이스의 부분을 쉽게 검색하고 확장하기 위해 표준화 된 인터페이스를 제공하는 것이다. HII의 외부 드라이버/애플리케이션을 사용해 새로운 요소(예: 글꼴, 문자열, 이미지 또는 양식)를 플랫폼에 쉽게 설치하거나 존재하는 요소를 내부에 반영할 수 있다.

이는 모든 HII 데이터가 전체 플랫폼의 중앙 저장소 역할을 하는 특수 데이터베이스인 HII 데이터베이스에 저장되기 때문에 가능하다.

결국 `Form Browser` 는 HII 데이터베이스를 사용하여 사용자 인터페이스를 표시하고 사용자와 상호 작용하는 것이다.

HII 데이터베이스 콘텐츠를 탐색하는 애플리케이션을 만들어보자.

이전에 여러 번 새로운 애플리케이션을 만들며 반복적인 작업을 수행해왔다. 그리고 이 작업을 자동화하기 위해 간단한 스크립트를 작성하여 진행할 예정이다.\
[https://github.com/Kostr/UEFI-Lessons/blob/master/scripts/createNewApp.sh](https://github.com/Kostr/UEFI-Lessons/blob/master/scripts/createNewApp.sh)

```
#!/bin/bash
##
# Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com>
#
# SPDX-License-Identifier: MIT
##

# This is a simple script that creates a basic structure for your new UEFI application
# Put this script in your edk2 folder and run it with 1 argument - your new application name

APP_NAME=${1}

UUID=$(uuidgen)

mkdir -p UefiLessonsPkg/${APP_NAME}

cat << EOF > UefiLessonsPkg/${APP_NAME}/${APP_NAME}.inf
[Defines]
  INF_VERSION                    = 1.25
  BASE_NAME                      = ${APP_NAME}
  FILE_GUID                      = ${UUID}
  MODULE_TYPE                    = UEFI_APPLICATION
  VERSION_STRING                 = 1.0
  ENTRY_POINT                    = UefiMain
[Sources]
  ${APP_NAME}.c
[Packages]
  MdePkg/MdePkg.dec
[LibraryClasses]
  UefiApplicationEntryPoint
  UefiLib
EOF

cat << EOF > UefiLessonsPkg/${APP_NAME}/${APP_NAME}.c
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
EFI_STATUS
EFIAPI
UefiMain (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{
  return EFI_SUCCESS;
}
EOF
```

`edk2` 폴더에 해당 스크립트를 작성하고 새 애플리케이션 `ShowHII` 를 생성한다.

```
$ ./createNewApp.sh ShowHII
```

이렇게 하면 `*.inf` 파일 및 `*.c` 을 포함한 `UefiLessonPkg/ShowHII` 폴더가 생성된다. 새로 만들 애플리케이션을 `UefiLessonsPkg/UefiLessonsPkg.dsc` 의components section에 추가한다.

```
[Components]
  ...
  UefiLessonsPkg/ShowHII/ShowHII.inf
```

HII 데이터베이스에 접근하기 위해 `EFI_HII_DATABASE_PROTOCOL` 를 이용해야 한다.

```
EFI_HII_DATABASE_PROTOCOL

Summary:
Database manager for HII-related data structures.

Protocol:
typedef struct _EFI_HII_DATABASE_PROTOCOL {
 EFI_HII_DATABASE_NEW_PACK NewPackageList;
 EFI_HII_DATABASE_REMOVE_PACK RemovePackageList;
 EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList;
 EFI_HII_DATABASE_LIST_PACKS ListPackageLists;
 EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists;
 EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify;
 EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify;
 EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts;
 EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
 EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout;
 EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle;
} EFI_HII_DATABASE_PROTOCOL;
```

해당 프로토콜에서 `ExportPackageLists` 함수를 주목하자.

```
EFI_HII_DATABASE_PROTOCOL.ExportPackageLists()

Summary:
Exports the contents of one or all package lists in the HII database into a buffer.

Prototype:
typedef
EFI_STATUS
(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) (
 IN CONST EFI_HII_DATABASE_PROTOCOL *This,
 IN EFI_HII_HANDLE Handle,
 IN OUT UINTN *BufferSize,
 OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer
 );
 
Parameters:
This		A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
Handle		An EFI_HII_HANDLE that corresponds to the desired package list in the HII
		database to export or NULL to indicate all package lists should be exported.
BufferSize	On input, a pointer to the length of the buffer. On output, the length of the buffer
		that is required for the exported data.
Buffer		A pointer to a buffer that will contain the results of the export function. 
```

HII 데이터베이스의 데이터가 GUID로 식별되는 패키지 목록으로 구성되기 때문에 이 함수를 통해 패키지 목록을 얻을 수 있다. 각 패키지 목록은 서로 다른 유형의 여러 패키지(form/font/strings/...)를 가질 수도 있다.

먼저 작성하는 애플리케이션에 `EFI_HII_DATABASE_PROTOCOL` 를 가져오고 필요한 헤더를 포함시킨다.

```
#include <Protocol/HiiDatabase.h>
...
  EFI_STATUS Status;
  EFI_HII_DATABASE_PROTOCOL* HiiDbProtocol;
  Status = gBS->LocateProtocol(&gEfiHiiDatabaseProtocolGuid,
                               NULL, 
                               (VOID**)&HiiDbProtocol);
  if (EFI_ERROR(Status)) {
    Print(L"ERROR: Could not find HII Database protocol: %r\n", Status);
    return Status;
  }
```

또한 `ShowHII.inf` 파일에 `gEfiHiiDatabaseProtocolGuid` 정보도 작성한다.

```
[Protocols]
  gEfiHiiDatabaseProtocolGuid
```

다음은 프로토콜의 `ExportPackageLists` 함수를 사용하기 위한 정보이다.

* 데이터베이스에서 일부 패키지 목록이 아닌 모든 패키지 목록을 가져오려면 Handle 매개변수에 NULL 값을 사용한다.
* 출력 배열의 크기를 미리 알 수 없기 때문에 표준 UEFI 메커니즘을 이용한다.

1. 먼저 `BufferSize=0` 으로 `ExportPackageLists` 를 호출한다. 반환 값으로 `EFI_BUFFER_TOO_SMALL` 을 받지만 `BufferSize` 을 필요한 크기 값으로 재설정 받을 수 있다.
2. 이후 `gBS->AllocatePool` 의 호출로 필요한 크기의 버퍼를 할당한다.
3. 올바른 버퍼와 크기로 `ExportPackageLists` 를 호출한다.

* 할당된 버퍼를 해제할 경우 `Library/MemoryAllocationLib.h` 에 존재하는 `FreePool` 함수를 사용하면 된다.

```
  UINTN PackageListSize = 0;
  EFI_HII_PACKAGE_LIST_HEADER* PackageList = NULL;

  Status = HiiDbProtocol->ExportPackageLists(HiiDbProtocol,
                                             NULL,             // All package lists
                                             &PackageListSize,
                                             PackageList);
  if (Status != EFI_BUFFER_TOO_SMALL) {
    Print(L"ERROR: Could not obtain package list size\n");
    return Status;
  }

  Status = gBS->AllocatePool(EfiBootServicesData, 
                             PackageListSize, 
                             (VOID**)&PackageList);
  if (EFI_ERROR(Status)) {
    Print(L"ERROR: Could not allocate sufficient memory for package list: %r\n", Status);
    return Status;
  }


  Status = HiiDbProtocol->ExportPackageLists(HiiDbProtocol,
                                             NULL,
                                             &PackageListSize,
                                             PackageList);
  if (EFI_ERROR(Status)) {
    Print(L"ERROR: Could not retrieve the package list: %r\n", Status);
    FreePool(PackageList);
    return Status;
  }

  // <Process data>
  
  FreePool(PackageList);
```

수집한 데이터는 각각 `EFI_HII_PACKAGE_LIST_HEADER` 라는 특별한 헤더가 존재하는 패키지 목록들이다. 해당 데이터를 처리해보자.

```
EFI_HII_PACKAGE_LIST_HEADER
Summary:
The header found at the start of each package list. 

Prototype:
typedef struct {
 EFI_GUID PackageListGuid;
 UINT32 PackagLength;
} EFI_HII_PACKAGE_LIST_HEADER;

Members:
PackageListGuid		The unique identifier applied to the list of packages which follows.
PackageLength 		The size of the package list (in bytes), including the header. 
```

데이터를 파싱하고 패키지 목록에 존재하는 모든 정보를 출력하기 위해서는 반복문이 존재하는 함수를 작성해야 한다.

```
VOID ParseHiiPackageLists(EFI_HII_PACKAGE_LIST_HEADER* HiiDatabase, UINTN HiiDatabaseSize)
{
  EFI_HII_PACKAGE_LIST_HEADER* HiiPackageListHeader;
  HiiPackageListHeader = (EFI_HII_PACKAGE_LIST_HEADER*) HiiDatabase;

  UINTN i=0;
  while ((UINTN) HiiPackageListHeader < ((UINTN) HiiDatabase + HiiDatabaseSize)) {
    UINTN HiiPackageListSize = HiiPackageListHeader->PackageLength;
    if (HiiPackageListSize == 0)
      break;
    Print(L"PackageList[%d]: GUID=%g; size=0x%X\n", i++, HiiPackageListHeader->PackageListGuid, HiiPackageListHeader->PackageLength);

    <...>	// Parse PackageList

    // Go to next PackageList
    HiiPackageListHeader = (EFI_HII_PACKAGE_LIST_HEADER*)((UINTN) HiiPackageListHeader + HiiPackageListSize);
  }
}
```

해당 함수를 다음과 같이 호출하면 된다.

```
ParseHiiPackageLists(PackageList, PackageListSize);
```

작성한 애플리케이션을 빌드하고 실행해보자.

```
FS0:\> ShowHII.efi
PackageList[0]: GUID=A487A478-51EF-48AA-8794-7BEE2A0562F1; size=0x1ADC
PackageList[1]: GUID=19618BCE-55AE-09C6-37E9-4CE04084C7A1; size=0x21E4
PackageList[2]: GUID=2F30DA26-F51B-4B6F-85C4-31873C281BCA; size=0xA93
PackageList[3]: GUID=F74D20EE-37E7-48FC-97F7-9B1047749C69; size=0x2EE9
PackageList[4]: GUID=EBF8ED7C-0DD1-4787-84F1-F48D537DCACF; size=0x46C
PackageList[5]: GUID=FE561596-E6BF-41A6-8376-C72B719874D0; size=0x93F
PackageList[6]: GUID=2A46715F-3581-4A55-8E73-2B769AAA30C5; size=0x6B0
PackageList[7]: GUID=99FDC8FD-849B-4EBA-AD13-FB9699C90A4D; size=0x6FE
PackageList[8]: GUID=E38C1029-E38F-45B9-8F0D-E2E60BC9B262; size=0x15DA
PackageList[9]: GUID=D9DCC5DF-4007-435E-9098-8970935504B2; size=0x855
PackageList[10]: GUID=F5F219D3-7006-4648-AC8D-D61DFB7BC6AD; size=0x14EC
PackageList[11]: GUID=4B47D616-A8D6-4552-9D44-CCAD2E0F4CF9; size=0x6AC8
PackageList[12]: GUID=F95A7CCC-4C55-4426-A7B4-DC8961950BAE; size=0x13909
PackageList[13]: GUID=DEC5DAA4-6781-4820-9C63-A7B0E4F1DB31; size=0x8677
PackageList[14]: GUID=4344558D-4EF9-4725-B1E4-3376E8D6974F; size=0x83BD
PackageList[15]: GUID=0AF0B742-63EC-45BD-8DB6-71AD7F2FE8E8; size=0xCB04
PackageList[16]: GUID=25F200AA-D3CB-470A-BF51-E7D162D22E6F; size=0x1D3D7
PackageList[17]: GUID=5F5F605D-1583-4A2D-A6B2-EB12DAB4A2B6; size=0x3048
PackageList[18]: GUID=F3D301BB-F4A5-45A8-B0B7-FA999C6237AE; size=0x26B5
PackageList[19]: GUID=7C04A583-9E3E-4F1C-AD65-E05268D0B4D1; size=0x5CB
```

다음으로 `PackageLists` 를 살펴보자. 각 `PackageList` 는 `EFI_HII_PACKAGE_LIST_HEADER` 바로 다음에 시작하는 여러 패키지들로 구성되어 있다. 그리고 각 패키지에는 자체 `EFI_HII_PACKAGE_HEADER` 가 존재한다.

```
EFI_HII_PACKAGE_HEADER

Summary:
The header found at the start of each package.

Prototype:
typedef struct {
 UINT32 Length:24;
 UINT32 Type:8;
 UINT8 Data[ … ];
} EFI_HII_PACKAGE_HEADER;

Members:
Length 		The size of the package in bytes.
Type 		The package type. See EFI_HII_PACKAGE_TYPE_x, below.
```

다음은 사용 가능한 일부 패키지 유형에 대한 설명이다.

```
Package Type Description:
#define EFI_HII_PACKAGE_TYPE_ALL     0x00 		// Pseudo-package type used when exporting package lists.
#define EFI_HII_PACKAGE_TYPE_GUID    0x01 		// Package type where the format of the data
												// is specified using a GUID immediately
												// following the package header.
#define EFI_HII_PACKAGE_FORMS        0x02 		// Forms package.
#define EFI_HII_PACKAGE_STRINGS      0x04 		// Strings package
#define EFI_HII_PACKAGE_FONTS        0x05 		// Fonts package.
#define EFI_HII_PACKAGE_IMAGES       0x06 		// Images package.
#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07 		// Simplified (8x19, 16x19) Fonts package
#define EFI_HII_PACKAGE_DEVICE_PATH  0x08 		// Binary-encoded device path.
#define EFI_HII_PACKAGE_ANIMATIONS   0x0A		// Animations package.
#define EFI_HII_PACKAGE_END          0xDF 		// Used to mark the end of a package list.
```

패키지 목록에는 필요한 만큼의 많은 패키지가 있을 수 있으며 모두 연결되어 있다. 패키지 목록의 모든 데이터 패키지 다음에는 패키지 목록의 끝을 표시하는 `EFI_HII_PACKAGE_END` 유형의 패키지가 존재해야 한다.

따라서 이 정보를 이용하여 패키지 목록 내의 모든 패키지 정보를 파싱하는 코드를 추가해보자.

```
EFI_HII_PACKAGE_HEADER* HiiPackageHeader = (EFI_HII_PACKAGE_HEADER*)((UINTN) HiiPackageListHeader + sizeof(EFI_HII_PACKAGE_LIST_HEADER));
UINTN j=0;
while ((UINTN) HiiPackageHeader < ((UINTN) HiiPackageListHeader + HiiPackageListSize)) {
  Print(L"\tPackage[%d]: type=%s; size=0x%X\n", j++, PackageType(HiiPackageHeader->Type), HiiPackageHeader->Length);

  // Go to next Package
  HiiPackageHeader = (EFI_HII_PACKAGE_HEADER*)((UINTN) HiiPackageHeader + HiiPackageHeader->Length);
}
```

그리고 `PackageType` 라는 패키지 유형 값을 출력가능한 문자열로 변환하는 함수를 작성하자.

```
CHAR16* PackageType(UINTN Type)
{
  switch(Type) {
    case EFI_HII_PACKAGE_TYPE_ALL:
      return L"ALL";
    case EFI_HII_PACKAGE_TYPE_GUID:
      return L"GUID";
    case EFI_HII_PACKAGE_FORMS:
      return L"FORMS";
    case EFI_HII_PACKAGE_STRINGS:
      return L"STRINGS";
    case EFI_HII_PACKAGE_FONTS:
      return L"FONTS";
    case EFI_HII_PACKAGE_IMAGES:
      return L"IMAGES";
    case EFI_HII_PACKAGE_SIMPLE_FONTS:
      return L"SIMPLE_FONTS";
    case EFI_HII_PACKAGE_DEVICE_PATH:
      return L"DEVICE_PATH";
    case EFI_HII_PACKAGE_KEYBOARD_LAYOUT:
      return L"KEYBOARD_LAYOUT";
    case EFI_HII_PACKAGE_ANIMATIONS:
      return L"ANIMATIONS";
    case EFI_HII_PACKAGE_END:
      return L"END";
    case EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN:
      return L"SYSTEM_BEGIN";
    case EFI_HII_PACKAGE_TYPE_SYSTEM_END:
      return L"SYSTEM_END";
  }
  return L"UNKNOWN";
}
```

위 두 가지를 추가하여 다시 애플리케이션을 빌드하고 실행하면 다음과 같은 결과를 얻을 수 있다.

```
FS0:\> ShowHII.efi
PackageList[0]: GUID=A487A478-51EF-48AA-8794-7BEE2A0562F1; size=0x1ADC
        Package[0]: type=STRINGS; size=0x1AC4
        Package[1]: type=END; size=0x4
PackageList[1]: GUID=19618BCE-55AE-09C6-37E9-4CE04084C7A1; size=0x21E4
        Package[0]: type=STRINGS; size=0x21CC
        Package[1]: type=END; size=0x4
PackageList[2]: GUID=2F30DA26-F51B-4B6F-85C4-31873C281BCA; size=0xA93
        Package[0]: type=STRINGS; size=0xA7B
        Package[1]: type=END; size=0x4
PackageList[3]: GUID=F74D20EE-37E7-48FC-97F7-9B1047749C69; size=0x2EE9
        Package[0]: type=IMAGES; size=0x2ED1
        Package[1]: type=END; size=0x4
PackageList[4]: GUID=EBF8ED7C-0DD1-4787-84F1-F48D537DCACF; size=0x46C
        Package[0]: type=FORMS; size=0x82
        Package[1]: type=FORMS; size=0x82
        Package[2]: type=STRINGS; size=0x199
        Package[3]: type=STRINGS; size=0x19B
        Package[4]: type=DEVICE_PATH; size=0x1C
        Package[5]: type=END; size=0x4
PackageList[5]: GUID=FE561596-E6BF-41A6-8376-C72B719874D0; size=0x93F
        Package[0]: type=FORMS; size=0xF5
        Package[1]: type=STRINGS; size=0x40A
        Package[2]: type=STRINGS; size=0x40C
        Package[3]: type=DEVICE_PATH; size=0x1C
        Package[4]: type=END; size=0x4
PackageList[6]: GUID=2A46715F-3581-4A55-8E73-2B769AAA30C5; size=0x6B0
        Package[0]: type=FORMS; size=0x143
        Package[1]: type=STRINGS; size=0x539
        Package[2]: type=DEVICE_PATH; size=0x1C
        Package[3]: type=END; size=0x4
PackageList[7]: GUID=99FDC8FD-849B-4EBA-AD13-FB9699C90A4D; size=0x6FE
        Package[0]: type=STRINGS; size=0x340
        Package[1]: type=STRINGS; size=0x3A6
        Package[2]: type=END; size=0x4
PackageList[8]: GUID=E38C1029-E38F-45B9-8F0D-E2E60BC9B262; size=0x15DA
        Package[0]: type=STRINGS; size=0xA88
        Package[1]: type=STRINGS; size=0xB3A
        Package[2]: type=END; size=0x4
PackageList[9]: GUID=D9DCC5DF-4007-435E-9098-8970935504B2; size=0x855
        Package[0]: type=FORMS; size=0x1F6
        Package[1]: type=STRINGS; size=0x62B
        Package[2]: type=DEVICE_PATH; size=0x1C
        Package[3]: type=END; size=0x4
PackageList[10]: GUID=F5F219D3-7006-4648-AC8D-D61DFB7BC6AD; size=0x14EC
        Package[0]: type=SIMPLE_FONTS; size=0x14D4
        Package[1]: type=END; size=0x4
PackageList[11]: GUID=4B47D616-A8D6-4552-9D44-CCAD2E0F4CF9; size=0x6AC8
        Package[0]: type=FORMS; size=0x1030
        Package[1]: type=STRINGS; size=0x3C99
        Package[2]: type=STRINGS; size=0x1DCB
        Package[3]: type=DEVICE_PATH; size=0x1C
        Package[4]: type=END; size=0x4
PackageList[12]: GUID=F95A7CCC-4C55-4426-A7B4-DC8961950BAE; size=0x13909
        Package[0]: type=STRINGS; size=0x138F1
        Package[1]: type=END; size=0x4
PackageList[13]: GUID=DEC5DAA4-6781-4820-9C63-A7B0E4F1DB31; size=0x8677
        Package[0]: type=STRINGS; size=0x865F
        Package[1]: type=END; size=0x4
PackageList[14]: GUID=4344558D-4EF9-4725-B1E4-3376E8D6974F; size=0x83BD
        Package[0]: type=STRINGS; size=0x83A5
        Package[1]: type=END; size=0x4
PackageList[15]: GUID=0AF0B742-63EC-45BD-8DB6-71AD7F2FE8E8; size=0xCB04
        Package[0]: type=STRINGS; size=0xCAEC
        Package[1]: type=END; size=0x4
PackageList[16]: GUID=25F200AA-D3CB-470A-BF51-E7D162D22E6F; size=0x1D3D7
        Package[0]: type=STRINGS; size=0x1D3BF
        Package[1]: type=END; size=0x4
PackageList[17]: GUID=5F5F605D-1583-4A2D-A6B2-EB12DAB4A2B6; size=0x3048
        Package[0]: type=STRINGS; size=0x3030
        Package[1]: type=END; size=0x4
PackageList[18]: GUID=F3D301BB-F4A5-45A8-B0B7-FA999C6237AE; size=0x26B5
        Package[0]: type=STRINGS; size=0x269D
        Package[1]: type=END; size=0x4
PackageList[19]: GUID=7C04A583-9E3E-4F1C-AD65-E05268D0B4D1; size=0x5CB
        Package[0]: type=STRINGS; size=0x5B3
        Package[1]: type=END; size=0x4
```

출력된 GUID에 대한 정보는 다음과 같다.

[https://github.com/tianocore/edk2/blob/master/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf](https://github.com/tianocore/edk2/blob/master/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf)

```
PackageList[0]: GUID=A487A478-51EF-48AA-8794-7BEE2A0562F1; size=0x1ADC
        Package[0]: type=STRINGS; size=0x1AC4
        Package[1]: type=END; size=0x4
```

[https://github.com/tianocore/edk2/blob/master/ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf](https://github.com/tianocore/edk2/blob/master/ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf)

```
PackageList[1]: GUID=19618BCE-55AE-09C6-37E9-4CE04084C7A1; size=0x21E4
        Package[0]: type=STRINGS; size=0x21CC
        Package[1]: type=END; size=0x4
```

[https://github.com/tianocore/edk2/blob/master/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf](https://github.com/tianocore/edk2/blob/master/OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf)

```
PackageList[2]: GUID=2F30DA26-F51B-4B6F-85C4-31873C281BCA; size=0xA93
        Package[0]: type=STRINGS; size=0xA7B
        Package[1]: type=END; size=0x4
```

[https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Logo/LogoDxe.inf](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Logo/LogoDxe.inf)

```
PackageList[3]: GUID=F74D20EE-37E7-48FC-97F7-9B1047749C69; size=0x2EE9
        Package[0]: type=IMAGES; size=0x2ED1
        Package[1]: type=END; size=0x4
```

[https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/DriverHealthManagerDxe/DriverHealthManagerDxe.inf)

```
PackageList[4]: GUID=EBF8ED7C-0DD1-4787-84F1-F48D537DCACF; size=0x46C
        Package[0]: type=FORMS; size=0x82
        Package[1]: type=FORMS; size=0x82
        Package[2]: type=STRINGS; size=0x199
        Package[3]: type=STRINGS; size=0x19B
        Package[4]: type=DEVICE_PATH; size=0x1C
        Package[5]: type=END; size=0x4
```

`EFI_FILE_EXPLORE_FORMSET_GUID` [https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Library/FileExplorerLib/FormGuid.h](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Library/FileExplorerLib/FormGuid.h)

```
PackageList[5]: GUID=FE561596-E6BF-41A6-8376-C72B719874D0; size=0x93F
        Package[0]: type=FORMS; size=0xF5
        Package[1]: type=STRINGS; size=0x40A
        Package[2]: type=STRINGS; size=0x40C
        Package[3]: type=DEVICE_PATH; size=0x1C
        Package[4]: type=END; size=0x4
```

`RAM_DISK_FORM_SET_GUID` `gRamDiskFormSetGuid` [https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Include/Guid/RamDiskHii.h](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Include/Guid/RamDiskHii.h) [https://github.com/tianocore/edk2/blob/master/MdeModulePkg/MdeModulePkg.dec](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/MdeModulePkg.dec)

```
PackageList[6]: GUID=2A46715F-3581-4A55-8E73-2B769AAA30C5; size=0x6B0
        Package[0]: type=FORMS; size=0x143
        Package[1]: type=STRINGS; size=0x539
        Package[2]: type=DEVICE_PATH; size=0x1C
        Package[3]: type=END; size=0x4
```

`gCustomizedDisplayLibGuid` [https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c)

```
PackageList[7]: GUID=99FDC8FD-849B-4EBA-AD13-FB9699C90A4D; size=0x6FE
        Package[0]: type=STRINGS; size=0x340
        Package[1]: type=STRINGS; size=0x3A6
        Package[2]: type=END; size=0x4
```

`gDisplayEngineGuid` [https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c)

```
PackageList[8]: GUID=E38C1029-E38F-45B9-8F0D-E2E60BC9B262; size=0x15DA
        Package[0]: type=STRINGS; size=0xA88
        Package[1]: type=STRINGS; size=0xB3A
        Package[2]: type=END; size=0x4
```

[https://github.com/tianocore/edk2/blob/master/OvmfPkg/PlatformDxe/Platform.inf](https://github.com/tianocore/edk2/blob/master/OvmfPkg/PlatformDxe/Platform.inf)

```
PackageList[9]: GUID=D9DCC5DF-4007-435E-9098-8970935504B2; size=0x855
        Package[0]: type=FORMS; size=0x1F6
        Package[1]: type=STRINGS; size=0x62B
        Package[2]: type=DEVICE_PATH; size=0x1C
        Package[3]: type=END; size=0x4
```

`mFontPackageListGuid` [https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c](https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c)

```
PackageList[10]: GUID=F5F219D3-7006-4648-AC8D-D61DFB7BC6AD; size=0x14EC
        Package[0]: type=SIMPLE_FONTS; size=0x14D4
        Package[1]: type=END; size=0x4
```

`gIScsiConfigGuid` `ISCSI_CONFIG_GUID` [https://github.com/tianocore/edk2/blob/master/NetworkPkg/Include/Guid/IScsiConfigHii.h](https://github.com/tianocore/edk2/blob/master/NetworkPkg/Include/Guid/IScsiConfigHii.h) [https://github.com/tianocore/edk2/blob/master/NetworkPkg/NetworkPkg.dec](https://github.com/tianocore/edk2/blob/master/NetworkPkg/NetworkPkg.dec)

```
PackageList[11]: GUID=4B47D616-A8D6-4552-9D44-CCAD2E0F4CF9; size=0x6AC8
        Package[0]: type=FORMS; size=0x1030
        Package[1]: type=STRINGS; size=0x3C99
        Package[2]: type=STRINGS; size=0x1DCB
        Package[3]: type=DEVICE_PATH; size=0x1C
        Package[4]: type=END; size=0x4
```

`gShellLevel2HiiGuid` `SHELL_LEVEL2_HII_GUID` [https://github.com/tianocore/edk2/blob/master/ShellPkg/Include/Guid/ShellLibHiiGuid.h](https://github.com/tianocore/edk2/blob/master/ShellPkg/Include/Guid/ShellLibHiiGuid.h) [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[12]: GUID=F95A7CCC-4C55-4426-A7B4-DC8961950BAE; size=0x13909
        Package[0]: type=STRINGS; size=0x138F1
        Package[1]: type=END; size=0x4
```

`SHELL_LEVEL1_HII_GUID` `gShellLevel1HiiGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[13]: GUID=DEC5DAA4-6781-4820-9C63-A7B0E4F1DB31; size=0x8677
        Package[0]: type=STRINGS; size=0x865F
        Package[1]: type=END; size=0x4
```

`SHELL_LEVEL3_HII_GUID` `gShellLevel3HiiGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[14]: GUID=4344558D-4EF9-4725-B1E4-3376E8D6974F; size=0x83BD
        Package[0]: type=STRINGS; size=0x83A5
        Package[1]: type=END; size=0x4
```

`SHELL_DRIVER1_HII_GUID` `gShellDriver1HiiGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[15]: GUID=0AF0B742-63EC-45BD-8DB6-71AD7F2FE8E8; size=0xCB04
        Package[0]: type=STRINGS; size=0xCAEC
        Package[1]: type=END; size=0x4
```

`SHELL_DEBUG1_HII_GUID` `gShellDebug1HiiGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[16]: GUID=25F200AA-D3CB-470A-BF51-E7D162D22E6F; size=0x1D3D7
        Package[0]: type=STRINGS; size=0x1D3BF
        Package[1]: type=END; size=0x4
```

`SHELL_BCFG_HII_GUID` `gShellBcfgHiiGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[17]: GUID=5F5F605D-1583-4A2D-A6B2-EB12DAB4A2B6; size=0x3048
        Package[0]: type=STRINGS; size=0x3030
        Package[1]: type=END; size=0x4
```

`SHELL_NETWORK1_HII_GUID` `gShellNetwork1HiiGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[18]: GUID=F3D301BB-F4A5-45A8-B0B7-FA999C6237AE; size=0x26B5
        Package[0]: type=STRINGS; size=0x269D
        Package[1]: type=END; size=0x4
```

`gUefiShellFileGuid` [https://github.com/tianocore/edk2/blob/master/ShellPkg/Application/Shell/Shell.inf](https://github.com/tianocore/edk2/blob/master/ShellPkg/Application/Shell/Shell.inf) [https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec](https://github.com/tianocore/edk2/blob/master/ShellPkg/ShellPkg.dec)

```
PackageList[20]: GUID=7C04A583-9E3E-4F1C-AD65-E05268D0B4D1; size=0x5CB
        Package[0]: type=STRINGS; size=0x5B7
        Package[1]: type=END; size=0x4
```
