UEFI Shell - Graphics Output Protocol
Make use of GOP to write a GUI application under UEFI shell.
#include <Uefi.h>
#include <Protocol/GraphicsOutput.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
EFI_STATUS Init() {
EFI_STATUS status;
UINTN handleCount;
EFI_HANDLE *handleBuffer;
status = gBS->LocateHandleBuffer(
ByProtocol,
&gEfiGraphicsOutputProtocolGuid,
NULL,
&handleCount,
&handleBuffer);
if (EFI_ERROR(status)) return status;
status = gBS->HandleProtocol(
handleBuffer[0], // TODO
&gEfiGraphicsOutputProtocolGuid,
(VOID **)&(Gop));
if (EFI_ERROR(status)) return status;
FreePool(handleBuffer);
return status;
}
Written by John Smith
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#