diff options
Diffstat (limited to 'Lessons/Lesson_53/UefiLessonsPkg')
6 files changed, 380 insertions, 0 deletions
diff --git a/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.c b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.c new file mode 100644 index 0000000..6ddab88 --- /dev/null +++ b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.c @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> + * + * SPDX-License-Identifier: MIT + */ + +#include <Library/UefiBootServicesTableLib.h> +#include <Library/UefiLib.h> + +#include <Library/HiiLib.h> +#include <Library/MemoryAllocationLib.h> +#include <Library/BaseMemoryLib.h> + + +extern EFI_WIDE_GLYPH gSimpleFontWideGlyphData[]; +extern UINT32 gSimpleFontWideBytes; +extern EFI_NARROW_GLYPH gSimpleFontNarrowGlyphData[]; +extern UINT32 gSimpleFontNarrowBytes; + + +UINT8* CreateSimpleFontPkg(EFI_WIDE_GLYPH* WideGlyph, + UINT32 WideGlyphSizeInBytes, + EFI_NARROW_GLYPH* NarrowGlyph, + UINT32 NarrowGlyphSizeInBytes) +{ + UINT32 PackageLen = sizeof(EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + WideGlyphSizeInBytes + NarrowGlyphSizeInBytes + 4; + UINT8* FontPackage = (UINT8*)AllocateZeroPool (PackageLen); + *(UINT32*)FontPackage = PackageLen; + + EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFont; + SimpleFont = (EFI_HII_SIMPLE_FONT_PACKAGE_HDR*)(FontPackage + 4); + SimpleFont->Header.Length = (UINT32)(PackageLen - 4); + SimpleFont->Header.Type = EFI_HII_PACKAGE_SIMPLE_FONTS; + SimpleFont->NumberOfNarrowGlyphs = (UINT16)(NarrowGlyphSizeInBytes / sizeof(EFI_NARROW_GLYPH)); + SimpleFont->NumberOfWideGlyphs = (UINT16)(WideGlyphSizeInBytes / sizeof(EFI_WIDE_GLYPH)); + + UINT8* Location = (UINT8*)(&SimpleFont->NumberOfWideGlyphs + 1); + CopyMem(Location, NarrowGlyph, NarrowGlyphSizeInBytes); + CopyMem(Location + NarrowGlyphSizeInBytes, WideGlyph, WideGlyphSizeInBytes); + + return FontPackage; +} + + +EFI_STATUS +EFIAPI +UefiMain ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + Print(L"Привет!\n"); + + UINT8* FontPackage = CreateSimpleFontPkg(gSimpleFontWideGlyphData, + gSimpleFontWideBytes, + gSimpleFontNarrowGlyphData, + gSimpleFontNarrowBytes); + + EFI_HII_HANDLE Handle = HiiAddPackages(&gHIIAddRussianFontGuid, + NULL, + FontPackage, + HIIAddRussianFontStrings, + NULL); + + FreePool(FontPackage); + + if (Handle == NULL) + { + Print(L"Error! Can't perform HiiAddPackages\n"); + return EFI_INVALID_PARAMETER; + } + + Print(L"en-US ID=1: %s\n", HiiGetString(Handle, 1, "en-US")); + Print(L"en-US ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "en-US")); + Print(L"en-US ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "en-US")); + Print(L"en-US ID=4: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_ALPHABET_UPPERCASE), "en-US")); + Print(L"en-US ID=5: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_ALPHABET_LOWERCASE), "en-US")); + Print(L"fr-FR ID=1: %s\n", HiiGetString(Handle, 1, "fr-FR")); + Print(L"fr-FR ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "fr-FR")); + Print(L"fr-FR ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "fr-FR")); + Print(L"fr-FR ID=4: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_ALPHABET_UPPERCASE), "fr-FR")); + Print(L"fr-FR ID=5: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_ALPHABET_LOWERCASE), "fr-FR")); + Print(L"ru-RU ID=1: %s\n", HiiGetString(Handle, 1, "ru-RU")); + Print(L"ru-RU ID=2: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_HELLO), "ru-RU")); + Print(L"ru-RU ID=3: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_BYE), "ru-RU")); + Print(L"ru-RU ID=4: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_ALPHABET_UPPERCASE), "ru-RU")); + Print(L"ru-RU ID=5: %s\n", HiiGetString(Handle, STRING_TOKEN(STR_ALPHABET_LOWERCASE), "ru-RU")); + + Print(L"Привет!\n"); + + return EFI_SUCCESS; +} + diff --git a/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.inf b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.inf new file mode 100644 index 0000000..a49a9cb --- /dev/null +++ b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.inf @@ -0,0 +1,31 @@ +## +# Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> +# +# SPDX-License-Identifier: MIT +## + +[Defines] + INF_VERSION = 1.25 + BASE_NAME = HIIAddRussianFont + FILE_GUID = 52a77b9c-cb4b-4e63-8293-d9686a2d7105 + MODULE_TYPE = UEFI_APPLICATION + VERSION_STRING = 1.0 + ENTRY_POINT = UefiMain + +[Sources] + HIIAddRussianFont.c + RussianFont.c + Strings.uni + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiLessonsPkg/UefiLessonsPkg.dec + +[LibraryClasses] + UefiApplicationEntryPoint + UefiLib + HiiLib + +[Guids] + gHIIAddRussianFontGuid diff --git a/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/RussianFont.c b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/RussianFont.c new file mode 100644 index 0000000..957467d --- /dev/null +++ b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/RussianFont.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> + * + * SPDX-License-Identifier: MIT + */ + +EFI_WIDE_GLYPH gSimpleFontWideGlyphData[] = { +{ 0x00, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} +}; +UINT32 gSimpleFontWideBytes = sizeof(gSimpleFontWideGlyphData); + +EFI_NARROW_GLYPH gSimpleFontNarrowGlyphData[] = { +{ 0x400, 0x00, { 0x60,0x30,0x00,0xfe,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00}}, +{ 0x401, 0x00, { 0x66,0x66,0x00,0xfe,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00}}, +{ 0x402, 0x00, { 0x00,0x00,0x00,0xfc,0x64,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0x66,0xe6,0x0c,0x00,0x00,0x00}}, +{ 0x403, 0x00, { 0x0c,0x18,0x00,0xfe,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00}}, +{ 0x404, 0x00, { 0x00,0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc8,0xf8,0xc8,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x405, 0x00, { 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc0,0x60,0x38,0x0c,0x06,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x406, 0x00, { 0x00,0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x407, 0x00, { 0x66,0x66,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x408, 0x00, { 0x00,0x00,0x00,0x0f,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x409, 0x00, { 0x00,0x00,0x00,0xfc,0xd8,0xd8,0xd8,0xd8,0xdc,0xda,0xda,0xda,0xda,0xda,0xdc,0x00,0x00,0x00,0x00}}, +{ 0x40a, 0x00, { 0x00,0x00,0x00,0xd8,0xd8,0xd8,0xd8,0xd8,0xfc,0xda,0xda,0xda,0xda,0xda,0xdc,0x00,0x00,0x00,0x00}}, +{ 0x40b, 0x00, { 0x00,0x00,0x00,0xfc,0x64,0x60,0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x40c, 0x00, { 0x0c,0x18,0x00,0xe6,0x66,0x66,0x6c,0x6c,0x78,0x78,0x6c,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x40d, 0x00, { 0x0c,0x18,0x00,0xc6,0xc6,0xce,0xce,0xde,0xde,0xf6,0xf6,0xe6,0xe6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x40e, 0x00, { 0x6c,0x38,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x40f, 0x00, { 0x00,0x00,0x00,0xee,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0xfe,0x10,0x10,0x00,0x00}}, +{ 0x410, 0x00, { 0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x411, 0x00, { 0x00,0x00,0x00,0xfe,0x66,0x62,0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00}}, +{ 0x412, 0x00, { 0x00,0x00,0x00,0xfc,0x66,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00}}, +{ 0x413, 0x00, { 0x00,0x00,0x00,0xfe,0x66,0x62,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00}}, +{ 0x414, 0x00, { 0x00,0x00,0x00,0x1e,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xff,0xc3,0x81,0x00,0x00}}, +{ 0x415, 0x00, { 0x00,0x00,0x00,0xfe,0x66,0x62,0x68,0x68,0x78,0x68,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00}}, +{ 0x416, 0x00, { 0x00,0x00,0x00,0xd6,0xd6,0xd6,0xd6,0x7c,0x38,0x38,0x7c,0xd6,0xd6,0xd6,0xd6,0x00,0x00,0x00,0x00}}, +{ 0x417, 0x00, { 0x00,0x00,0x00,0x7c,0xc6,0x86,0x06,0x06,0x3c,0x06,0x06,0x06,0x86,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x418, 0x00, { 0x00,0x00,0x00,0xc6,0xc6,0xce,0xce,0xde,0xde,0xf6,0xf6,0xe6,0xe6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x419, 0x00, { 0x6c,0x38,0x00,0xc6,0xc6,0xce,0xce,0xde,0xde,0xf6,0xf6,0xe6,0xe6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x41a, 0x00, { 0x00,0x00,0x00,0xe6,0x66,0x66,0x6c,0x6c,0x78,0x78,0x6c,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x41b, 0x00, { 0x00,0x00,0x00,0x1e,0x36,0x36,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x41c, 0x00, { 0x00,0x00,0x00,0xc6,0xee,0xfe,0xfe,0xd6,0xd6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x41d, 0x00, { 0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x41e, 0x00, { 0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00}}, +{ 0x41f, 0x00, { 0x00,0x00,0x00,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x420, 0x00, { 0x00,0x00,0x00,0xfc,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00}}, +{ 0x421, 0x00, { 0x00,0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x422, 0x00, { 0x00,0x00,0x00,0x7e,0x7e,0x5a,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x423, 0x00, { 0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x424, 0x00, { 0x00,0x00,0x00,0x38,0x10,0x7c,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0x7c,0x10,0x38,0x00,0x00,0x00,0x00}}, +{ 0x425, 0x00, { 0x00,0x00,0x00,0xc6,0xc6,0xc6,0x6c,0x6c,0x38,0x38,0x6c,0x6c,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x426, 0x00, { 0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xfe,0x06,0x02,0x00,0x00}}, +{ 0x427, 0x00, { 0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00}}, +{ 0x428, 0x00, { 0x00,0x00,0x00,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xfe,0x00,0x00,0x00,0x00}}, +{ 0x429, 0x00, { 0x00,0x00,0x00,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xff,0x03,0x01,0x00,0x00}}, +{ 0x42a, 0x00, { 0x00,0x00,0x00,0xf0,0xb0,0xb0,0x30,0x30,0x3c,0x36,0x36,0x36,0x36,0x36,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x42b, 0x00, { 0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xe6,0xd6,0xd6,0xd6,0xd6,0xd6,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x42c, 0x00, { 0x00,0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x7c,0x66,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00}}, +{ 0x42d, 0x00, { 0x00,0x00,0x00,0x78,0xcc,0x86,0x06,0x26,0x3e,0x26,0x06,0x06,0x86,0xcc,0x78,0x00,0x00,0x00,0x00}}, +{ 0x42e, 0x00, { 0x00,0x00,0x00,0xcc,0xd6,0xd6,0xd6,0xd6,0xf6,0xd6,0xd6,0xd6,0xd6,0xd6,0xcc,0x00,0x00,0x00,0x00}}, +{ 0x42f, 0x00, { 0x00,0x00,0x00,0x7e,0xcc,0xcc,0xcc,0xcc,0x7c,0x6c,0x6c,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00}}, +{ 0x430, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00}}, +{ 0x431, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x0c,0x78,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x432, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x66,0x66,0x7c,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00}}, +{ 0x433, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x66,0x62,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00}}, +{ 0x434, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x6c,0x6c,0xcc,0xcc,0xcc,0xfe,0xc6,0x82,0x00,0x00}}, +{ 0x435, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x436, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0xd6,0x7c,0x7c,0xd6,0xd6,0xd6,0x00,0x00,0x00,0x00}}, +{ 0x437, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x06,0x1c,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x438, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x439, 0x00, { 0x00,0x00,0x00,0x00,0x6c,0x38,0x00,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x43a, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe6,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x43b, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x36,0x66,0x66,0x66,0x66,0x66,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x43c, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xee,0xfe,0xd6,0xd6,0xd6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x43d, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x43e, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x43f, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x440, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00}}, +{ 0x441, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x442, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x5a,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x443, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x0c,0xf8,0x00}}, +{ 0x444, 0x00, { 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x7c,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0x7c,0x10,0x10,0x10,0x00}}, +{ 0x445, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0x6c,0x38,0x38,0x6c,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x446, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xfe,0x06,0x02,0x00,0x00}}, +{ 0x447, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x00,0x00,0x00,0x00}}, +{ 0x448, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xfe,0x00,0x00,0x00,0x00}}, +{ 0x449, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xd6,0xff,0x03,0x01,0x00,0x00}}, +{ 0x44a, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xb0,0x30,0x3c,0x36,0x36,0x36,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x44b, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xe6,0xd6,0xd6,0xd6,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x44c, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x30,0x30,0x3c,0x36,0x36,0x36,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x44d, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x06,0x1e,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x44e, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xcc,0xd6,0xd6,0xf6,0xf6,0xd6,0xd6,0xcc,0x00,0x00,0x00,0x00}}, +{ 0x44f, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x66,0x66,0x66,0x3e,0x36,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x450, 0x00, { 0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x451, 0x00, { 0x00,0x00,0x00,0x00,0xcc,0xcc,0x00,0x7c,0xc6,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x452, 0x00, { 0x00,0x00,0x00,0x60,0x60,0xf8,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0x66,0xe6,0x06,0x06,0x1c,0x00}}, +{ 0x453, 0x00, { 0x00,0x00,0x00,0x0c,0x18,0x30,0x00,0xfe,0x66,0x62,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00}}, +{ 0x454, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xf0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x455, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00}}, +{ 0x456, 0x00, { 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x457, 0x00, { 0x00,0x00,0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00}}, +{ 0x458, 0x00, { 0x00,0x00,0x00,0x06,0x06,0x00,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00}}, +{ 0x459, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xd8,0xd8,0xdc,0xda,0xda,0xda,0xdc,0x00,0x00,0x00,0x00}}, +{ 0x45a, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0xd8,0xd8,0xfc,0xda,0xda,0xda,0xdc,0x00,0x00,0x00,0x00}}, +{ 0x45b, 0x00, { 0x00,0x00,0x00,0x60,0x60,0xf8,0x60,0x7c,0x66,0x66,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x45c, 0x00, { 0x00,0x00,0x00,0x0c,0x18,0x30,0x00,0xe6,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00}}, +{ 0x45d, 0x00, { 0x00,0x00,0x00,0x60,0x30,0x18,0x00,0xc6,0xc6,0xce,0xde,0xf6,0xe6,0xc6,0xc6,0x00,0x00,0x00,0x00}}, +{ 0x45e, 0x00, { 0x00,0x00,0x00,0x00,0x6c,0x38,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x0c,0xf8,0x00}}, +{ 0x45f, 0x00, { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0xfe,0x10,0x10,0x00,0x00}}, +}; +UINT32 gSimpleFontNarrowBytes = sizeof(gSimpleFontNarrowGlyphData);
\ No newline at end of file diff --git a/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/Strings.uni b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/Strings.uni new file mode 100644 index 0000000..07ca8cf --- /dev/null +++ b/Lessons/Lesson_53/UefiLessonsPkg/HIIAddRussianFont/Strings.uni @@ -0,0 +1,25 @@ +// +// Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> +// +// SPDX-License-Identifier: MIT +// + +#langdef en-US "English" +#langdef fr-FR "Francais" +#langdef ru-RU "Russian" + +#string STR_HELLO #language en-US "Hello!" + #language fr-FR "Bonjour!" + #language ru-RU "Привет!" + +#string STR_BYE #language en-US "Bye!" + #language fr-FR "Au revoir!" + #language ru-RU "До свидания!" + +#string STR_ALPHABET_UPPERCASE #language en-US "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + #language fr-FR "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÈÙÉÂÊÎÔÛËÏÜŸÆŒÇ" + #language ru-RU "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЪЭЮЯ" + +#string STR_ALPHABET_LOWERCASE #language en-US "abcdefghijklmnopqrstuvwxyz" + #language fr-FR "abcdefghijklmnopqrstuvwxyzàèùéâêîôûëïüÿæœç" + #language ru-RU "абвгдеёжзийклмнопрстуфхцчшщьъэюя" diff --git a/Lessons/Lesson_53/UefiLessonsPkg/UefiLessonsPkg.dec b/Lessons/Lesson_53/UefiLessonsPkg/UefiLessonsPkg.dec new file mode 100644 index 0000000..40b351c --- /dev/null +++ b/Lessons/Lesson_53/UefiLessonsPkg/UefiLessonsPkg.dec @@ -0,0 +1,45 @@ +## +# Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> +# +# SPDX-License-Identifier: MIT +## + +[Defines]
+ DEC_SPECIFICATION = 0x00010005
+ PACKAGE_NAME = UefiLessonsPkg
+ PACKAGE_GUID = 7e7edbba-ca2c-4177-a3f0-d3371358773a
+ PACKAGE_VERSION = 1.01
+
+[Includes]
+ Include
+
+[Guids]
+ # FILE_GUID as defined in UefiLessonsPkg/HelloWorld/HelloWorld.inf
+ gHelloWorldFileGuid = {0x2e55fa38, 0xf148, 0x42d3, {0xaf, 0x90, 0x1b, 0xe2, 0x47, 0x32, 0x3e, 0x30}}
+ gUefiLessonsPkgTokenSpaceGuid = {0x150cab53, 0xad47, 0x4385, {0xb5, 0xdd, 0xbc, 0xfc, 0x76, 0xba, 0xca, 0xf0}}
+ gHIIStringsCGuid = { 0x8e0b8ed3, 0x14f7, 0x499d, { 0xa2, 0x24, 0xae, 0xe8, 0x9d, 0xc9, 0x7f, 0xa3 }}
+ gHIIStringsUNIGuid = { 0x6ee19058, 0x0fe2, 0x44ed, { 0x89, 0x1c, 0xa5, 0xd7, 0xe1, 0x08, 0xee, 0x1a }}
+ gHIIStringsUNIRCGuid = { 0x785693b4, 0x623e, 0x40fa, { 0x9a, 0x45, 0x68, 0xda, 0x38, 0x30, 0x89, 0xdd }}
+ gHIIAddRussianFontGuid = { 0x9fe2f616, 0x323c, 0x45a7, { 0x87, 0xa2, 0xdf, 0xef, 0xf5, 0x17, 0xcc, 0x66 }}
+
+[Protocols]
+ gSimpleClassProtocolGuid = { 0xb5510eea, 0x6f11, 0x4e4b, { 0xad, 0x0f, 0x35, 0xce, 0x17, 0xbd, 0x7a, 0x67 }}
+
+[PcdsFixedAtBuild]
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32|42|UINT32|0x00000001
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32_1|42|UINT32|0x00000002
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32_2|42|UINT32|0x00000003
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyVarBool|FALSE|BOOLEAN|0x00000004
+
+[PcdsPatchableInModule]
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyPatchableVar32|0x31313131|UINT32|0x10000001
+
+[PcdsFeatureFlag]
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyFeatureFlagVar|FALSE|BOOLEAN|0x20000001
+
+[PcdsDynamic]
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyDynamicVar32|0x38323232|UINT32|0x30000001
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyDynamicVar32_1|42|UINT32|0x30000002
+
+[PcdsDynamicEx]
+ gUefiLessonsPkgTokenSpaceGuid.PcdMyDynamicExVar32|0x38333333|UINT32|0x40000001
diff --git a/Lessons/Lesson_53/UefiLessonsPkg/UefiLessonsPkg.dsc b/Lessons/Lesson_53/UefiLessonsPkg/UefiLessonsPkg.dsc new file mode 100644 index 0000000..4ddf8ff --- /dev/null +++ b/Lessons/Lesson_53/UefiLessonsPkg/UefiLessonsPkg.dsc @@ -0,0 +1,76 @@ +## +# Copyright (c) 2021, Konstantin Aladyshev <aladyshev22@gmail.com> +# +# SPDX-License-Identifier: MIT +## + +[Defines] + DSC_SPECIFICATION = 0x0001001C + PLATFORM_GUID = 3db7270f-ffac-4139-90a4-0ae68f3f8167 + PLATFORM_VERSION = 0.01 + PLATFORM_NAME = UefiLessonsPkg + SKUID_IDENTIFIER = DEFAULT + SUPPORTED_ARCHITECTURES = X64 + BUILD_TARGETS = RELEASE + + +[LibraryClasses] + UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + #PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf + SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + #SimpleLibrary|UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.inf + #SimpleLibrary|UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf + SimpleLibrary|UefiLessonsPkg/Library/SimpleLibraryWithConstructorAndDestructor/SimpleLibraryWithConstructorAndDestructor.inf + +[Components] + UefiLessonsPkg/SimplestApp/SimplestApp.inf + UefiLessonsPkg/HelloWorld/HelloWorld.inf + UefiLessonsPkg/ImageHandle/ImageHandle.inf + UefiLessonsPkg/ImageInfo/ImageInfo.inf + UefiLessonsPkg/MemoryInfo/MemoryInfo.inf + UefiLessonsPkg/SimpleShellApp/SimpleShellApp.inf + UefiLessonsPkg/ListVariables/ListVariables.inf + UefiLessonsPkg/ShowBootVariables/ShowBootVariables.inf + UefiLessonsPkg/InteractiveApp/InteractiveApp.inf + UefiLessonsPkg/PCDLesson/PCDLesson.inf + UefiLessonsPkg/SmbiosInfo/SmbiosInfo.inf + UefiLessonsPkg/ShowTables/ShowTables.inf + UefiLessonsPkg/AcpiInfo/AcpiInfo.inf + UefiLessonsPkg/SaveBGRT/SaveBGRT.inf + UefiLessonsPkg/ListPCI/ListPCI.inf + UefiLessonsPkg/SimpleDriver/SimpleDriver.inf + UefiLessonsPkg/PCIRomInfo/PCIRomInfo.inf + UefiLessonsPkg/Library/SimpleLibrary/SimpleLibrary.inf + UefiLessonsPkg/Library/SimpleLibraryWithConstructor/SimpleLibraryWithConstructor.inf + UefiLessonsPkg/SimpleLibraryUser/SimpleLibraryUser.inf + UefiLessonsPkg/SimpleClassProtocol/SimpleClassProtocol.inf + UefiLessonsPkg/SimpleClassUser/SimpleClassUser.inf + UefiLessonsPkg/HotKeyDriver/HotKeyDriver.inf + UefiLessonsPkg/ShowHII/ShowHII.inf + UefiLessonsPkg/HIIStringsC/HIIStringsC.inf + UefiLessonsPkg/HIIStringsUNI/HIIStringsUNI.inf + UefiLessonsPkg/HIIStringsUNIRC/HIIStringsUNIRC.inf + UefiLessonsPkg/HIIStringsMan/HIIStringsMan.inf + UefiLessonsPkg/HIIAddRussianFont/HIIAddRussianFont.inf + +[PcdsFixedAtBuild] + gUefiLessonsPkgTokenSpaceGuid.PcdMyVar32_2|44 + |