What are the UEFI applications actually used for?

I'm interested in programming PC firmware, and I'm just learning the UEFI specification. To my surprise, this is similar to the specification for the entire OS built into the firmware. You can even write UEFI “applications” that run directly using UEFI boot services without any other OS.

I found blog entries showing how to create "Hello World!" An application that can run in a UEFI preboot environment. It is ... interesting and strange at the same time. Thank you, I launched my Hello World programs on a regular OS.

What are some good UEFI applications that are really good? Fancy boot configuration screens? Does any “genuine” commercially available PC firmware use the UEFI application to implement something more than just bootloaders and configuration utilities?

+5
source share
6 answers

Everything that is not the kernel or the PEI / DXE / SMM driver is an application, so any "real" computer has them, because the BIOS Setup program is a UEFI application. Some vendors include various other applications, such as firmware updates, diagnostics and troubleshooting tools, etc. UEFI 2.4 allows you to add your own application with a correctly populated pair of BootXXXX / KeyXXXX variables, and then launch it by pressing a key combination during POST.

Most console applications written in C can be compiled as a UEFI application using the StdLib package of the current EFI Development Kit , and then run in the UEFI shell.

The main examples of useful UEFI applications (of course, besides the bootloaders, the shell and the Linux kernel) are Intel ME System Tools , Read Universal , Python 2.7 and much more.

In the end, when the outdated download is no longer available, all currently useful DOS utilities must be made by UEFI applications or disappear.

+5
source

Despite the many valuable answers here, because I wrote a couple of UEFI applications, I will try to add my 2 cents. First, what is a UEFI application to just make it clear what we're talking about:

UEFI Specificatin v2.5:

Section 2.1.1

The main differences between the types of images are the type of memory that the firmware will download the image, and the action taken when the image entry point exits or returns. The application image is always uploaded when the control returns from the image input point.

Section 2.1.2

When an application returns from its entry point or when it calls the EFI_BOOT_SERVICES.Exit () download service, the application is unloaded from memory and control is returned to the UEFI component that loaded the application.

Groups of applications that make sense in UEFI:

  • Tuning tools - Configuration interface for additional ROMs (i.e. for storage controllers), out-of-band management (i.e. AMT configuration tools), manufacturer performance tuning tools
  • Support Tools - used by administrators to pre-configure a specific BIOS parameter, manually setting all the parameters in the BIOS setting will be ineffective.
  • Diagnostic tools - mainly for tests that cannot be performed on the OS (DRAM tests, full storage checks, R / W storage tests, etc.). In some areas, special diagnostic tools are required in the UEFI BIOS, so they can be sold to the government.
  • Security applications - encryption / decryption of the hard disk, anti-virus scanners and applications to protect against thieves.
  • Improved BIOS features . - Extensions Power Over Ethernet, DRAM detection, correction and modification of system tables (SMBIOS, ACPI).
  • Display tools - for displaying complex animations during operation, displaying a splash screen
  • Bootloaders are a special type of application that can call EFI_BOOT_SERVICES.ExitBootServices() , which will lead to the termination of memory management and transmission control of the operating system.

Please note that a very important feature of the UEFI application is that it can be added to the boot order and run every boot time. In addition, the UEFI application does not have to be delivered with a BIOS image, it can be saved in the memory of the connected device, which is common for Option ROM configuration tools.

+8
source

Here is an example of a fully loaded UEFI preload application;

There are SED SSD / HDD drives. As soon as the SSD / HDD loses its power, it goes into a locked state (hardware encryption). You cannot access the drive data, and all partitions on the disk are no longer visible. Only a small readable section (ShadowMBR) is available. The UEFI firmware loads the UEFI application from this only accessible section (the UEFI application is written on this section during the initialization process and when SED ownership is performed). It authenticates the user reliably, and if the credentials are valid, it unlocks the drive. When the drive is unlocked, Shadow MBR disappears and all partitions on the drive become available. Then the application network downloads the installed OS.

So, if you do not have credentials, you cannot even boot the OS, and you cannot in any way access the data on the disk.

+5
source

Well, there are OS loaders - both heavier (Windows, GRUB, BSD Loader), and the "real menu" (rEFInd, Gummiboot). Shim, which includes the UEFI Secure Boot platforms for Linux, consists of an application, as well as a protocol setup for use by other applications.

Then you have things like the Linux kernel, which when compiled with CONFIG_EFI_STUB becomes a valid UEFI application, with awareness of the load itself.

And firmware updates can also be sent as UEFI applications.

The UEFI shell itself is an application.

Then there are things like utilities for factory performance testing, development diagnostic tools, ...

+3
source

Here are some examples:

+3
source

Windows 7 - 8 has a UEFI installer. I don’t quite understand the details, but I’m sure this new environment gives developers more flexibility than the traditional DVD loading environment.

Some motherboards have “instant” features that allow you to access your desktop screen in seconds. Usually this is the laid-back taste of some kind of Linux, which allows you to access a web browser and play music / video. ASUS have such boards.

+2
source

Source: https://habr.com/ru/post/1206511/


All Articles