Beyond BIOS: Implementing the Unified Extensible Firmware Interface with Intel's Framework

Chapter 4: Protocols You Should Know

Common sense ain't common.
Will Rogers

Overview

This chapter describes protocols that everyone who is working with the Extensible Firmware Interface, whether creating device drivers, EFI pre-OS applications, or platform firmware, should know. The protocols are illustrated by a few examples, beginning with the most common exercise from any programming text, namely "Hello world." The test application listed here is the simplest possible application that can be written. It does not depend upon any EFI Library functions, so the EFI Library is not linked into the executable that is generated. This test application uses the SystemTable that is passed into the entry point to get access to the EFI console devices. The console output device is used to display a message using the OutputString() function of the SIMPLE_TEXT_OUTPUT_INTERFACE protocol, and the application waits for a keystroke from the user on the console input device using the WaitForEvent() service with the WaitForKey event in the SIMPLE_INPUT_INTERFACE protocol. Once a key is pressed, the application exits.

/*++Module Name:helloworld.cAbstract:This is a simple module to display behavior of a basic<a name="166"></a><a name="IDX-58"></a>EFI application.Author:WaldoRevision History--*/#include "efi.h"EFI_STATUSInitializeHelloApplication (    IN EFI_HANDLE           ImageHandle,    IN EFI_SYSTEM_TABLE     *SystemTable    ){    UINTN Index;    //    // Send a message to the ConsoleOut device.    //    SystemTable->ConOut->OutputString (  ...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: NVRAM
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.