Hello World UEFI Application

Overview

The Hello World application is the first standalone UEFI application in this project.

It demonstrates the basic structure of a UEFI executable, how firmware starts an application, and how an application interacts with the UEFI environment.


Goal

The goal of this application is to create the smallest possible UEFI application using C and GNU-EFI.

The application runs directly inside the UEFI firmware environment without an operating system.


What it demonstrates

  • Creating a .efi executable
  • Using GNU-EFI
  • Receiving the UEFI System Table
  • Writing output through UEFI services
  • Running an application in QEMU with OVMF firmware

UEFI Application Lifecycle

A simplified execution flow:

UEFI Firmware
      v
Load EFI application
      v
efi_main()
      v
Print output
      v
Return EFI_STATUS
      v
Application exits

Unlike a boot loader, the application does not take control of the system. It runs on top of the existing firmware environment.

Implementation

The application entry point is:

EFI_STATUS
efi_main(
    EFI_HANDLE ImageHandle,
    EFI_SYSTEM_TABLE *SystemTable
)

The firmware provides:

  • The image handle of the application

  • The system table containing access to UEFI services

The system table provides access to:

  • Console output
  • Boot Services
  • Runtime Services
  • Configuration Tables

Running the Application

Build the project:

make

Start QEMU with OVMF:

make run

From the UEFI shell:

fs0:
hello.efi

The application will print its message to the UEFI console.

Next Steps

After understanding the basic application structure, the next step is exploring firmware memory management:

Memory Map Viewer

Return to: Applications Overview


This site uses Just the Docs, a documentation theme for Jekyll.