aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2021-10-25 11:54:30 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2021-10-25 11:54:30 +0300
commiteca7b5976d9d7f8c5afc578aaf1beb0b7aacb2fe (patch)
tree46b8fa5033fc04e2a6f206775f6cffeb565ec084
parentd9be77329582a864993eb0b3ab49bec19e3972cf (diff)
downloadUEFI-Lessons-eca7b5976d9d7f8c5afc578aaf1beb0b7aacb2fe.tar.gz
UEFI-Lessons-eca7b5976d9d7f8c5afc578aaf1beb0b7aacb2fe.tar.bz2
UEFI-Lessons-eca7b5976d9d7f8c5afc578aaf1beb0b7aacb2fe.zip
Add lesson 49
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
-rw-r--r--Lessons/Lesson_49/README.md93
-rw-r--r--README.md1
2 files changed, 94 insertions, 0 deletions
diff --git a/Lessons/Lesson_49/README.md b/Lessons/Lesson_49/README.md
new file mode 100644
index 0000000..8b4c2a3
--- /dev/null
+++ b/Lessons/Lesson_49/README.md
@@ -0,0 +1,93 @@
+In the last lesson we've declared our UNI strings file under the `Sources` section of the application INF file:
+```
+[Sources]
+ ...
+ Strings.uni
+```
+But within the EDKII codebase you could encounter couple of other methods for including UNI files:
+- as the value for the `MODULE_UNI_FILE` key within the INF file,
+- under the `[UserExtensions.TianoCore."ExtraFiles"]` section of the INF file,
+- as the value for the `PACKAGE_UNI_FILE` key within the DEC file,
+- under the `[UserExtensions.TianoCore."ExtraFiles"]` section of the DEC file.
+
+The most important thing that UNI files included with these methods aren't processed by EDKII build tools! It is the files associated with the UEFI Packaging Specification (https://uefi.org/sites/default/files/resources/Dist_Package_Spec_1_1.pdf). They are used only by the `The Intel(R) UEFI Packaging Tool`. If you don't use it to distribute your packages, you can ignore all these files.
+
+As I don't use it myself, I won't go into the details, but here are the examples how these files look like.
+
+# MODULE_UNI_FILE/[UserExtensions.TianoCore."ExtraFiles"] within the INF file:
+
+Let's look at the https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf
+```
+[Defines]
+ ...
+ MODULE_UNI_FILE = ResetSystemPei.uni
+
+...
+
+[UserExtensions.TianoCore."ExtraFiles"]
+ ResetSystemPeiExtra.uni
+```
+Usually UNI file under the `MODULE_UNI_FILE` key has the same name as the INF file.
+
+And such file contains only 2 strings: `STR_MODULE_ABSTRACT` and `STR_MODULE_DESCRIPTION`.
+Example: https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.uni
+```
+#string STR_MODULE_ABSTRACT #language en-US "Implements Reset2, ResetFilter and ResetHandler PPIs"
+
+#string STR_MODULE_DESCRIPTION #language en-US "This driver implements Reset2, ResetFilter and ResetHandler PPIs."
+```
+
+UNI file under the `[UserExtensions.TianoCore."ExtraFiles"]` section usually has the same name as the INF file plus `Extra` postfix.
+
+And such file contains only 1 string: `STR_PROPERTIES_MODULE_NAME`.
+Example: https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/ResetSystemPei/ResetSystemPeiExtra.uni
+```
+#string STR_PROPERTIES_MODULE_NAME
+#language en-US
+"Reset System PEIM"
+```
+
+# PACKAGE_UNI_FILE/[UserExtensions.TianoCore."ExtraFiles"] within the DEC file:
+
+For the example you could look at the https://github.com/tianocore/edk2/blob/master/MdeModulePkg/MdeModulePkg.dec:
+```
+[Defines]
+ PACKAGE_UNI_FILE = MdeModulePkg.uni
+
+...
+
+[UserExtensions.TianoCore."ExtraFiles"]
+ MdeModulePkgExtra.uni
+```
+Here you can see that the naming scheme is similar to the one that was used in the INF files:
+- the file declared as the value of the `PACKAGE_UNI_FILE` key is named exactly like the DEC file,
+- the file declared under the `[UserExtensions.TianoCore."ExtraFiles"]` is named the same plus the `Extra` postfix
+
+Content of these files is also similar to the INF files. The only difference that `<MODULE>` is changed to `<PACKAGE>` in all the string token names:
+
+- MdeModulePkg.uni (https://github.com/tianocore/edk2/blob/master/MdeModulePkg/MdeModulePkg.uni)
+```
+#string STR_PACKAGE_ABSTRACT #language en-US "Provides the modules that conform to UEFI/PI Industry standards"
+
+#string STR_PACKAGE_DESCRIPTION #language en-US "It also provides the definitions (including PPIs/PROTOCOLs/GUIDs and library classes) and libraries instances, which are used for those modules."
+```
+- MdeModulePkgExtra.uni (https://github.com/tianocore/edk2/blob/master/MdeModulePkg/MdeModulePkgExtra.uni)
+```
+#string STR_PROPERTIES_PACKAGE_NAME
+#language en-US
+"MdeModule package"
+```
+
+Besides of that you can observe some doc strings for the PCDs in the MdeModulePkg.uni:
+```
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdProgressCodeOsLoaderLoad_PROMPT #language en-US "Progress Code for OS Loader LoadImage start."
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdProgressCodeOsLoaderLoad_HELP #language en-US "Progress Code for OS Loader LoadImage start.<BR><BR>\n"
+ "PROGRESS_CODE_OS_LOADER_LOAD = (EFI_SOFTWARE_DXE_BS_DRIVER | (EFI_OEM_SPECIFIC | 0x00000000)) = 0x03058000<BR>"
+
+#string STR_gEfiMdeModulePkgTokenSpaceGuid_ERR_80000003 #language en-US "Incorrect progress code provided."
+```
+
+# Conclusion
+
+Again, all these UNI files are irrelevant to the build tools. But these files are present all over the EDKII codebase, so you should at least be familiar with these concepts.
diff --git a/README.md b/README.md
index 18119a1..346feaf 100644
--- a/README.md
+++ b/README.md
@@ -52,6 +52,7 @@ These series of lessons are intendend to get you started with UEFI programming i
- [Lesson 46](Lessons/Lesson_46): Use `NewPackageList` from the `EFI_HII_DATABASE_PROTOCOL` directly to publish HII Package list with Strings packages. Part 2: String Packages data generation
- [Lesson 47](Lessons/Lesson_47): Use `NewPackageList` from the `EFI_HII_DATABASE_PROTOCOL` directly to publish HII Package list with Strings packages. Part 3: Combine everything together. Use `NewPackageList` and `GetString` protocol functions
- [Lesson 48](Lessons/Lesson_48): Use `UNI` files and `HiiLib` to publish and work with HII String packages
+- [Lesson 49](Lessons/Lesson_49): UNI files declared with the help of `MODULE_UNI_FILE`/`PACKAGE_UNI_FILE`/`[UserExtensions.TianoCore."ExtraFiles"]`
_____