forked from pbatard/uefi-simple
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
36 lines (31 loc) · 1.19 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* UEFI:SIMPLE - UEFI development made easy
* Copyright © 2014-2016 Pete Batard <[email protected]> - Public Domain
* See COPYING for the full licensing terms.
*/
#include <efi.h>
#include <efilib.h>
// Application entrypoint (must be set to 'efi_main' for gnu-efi crt0 compatibility)
EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
EFI_INPUT_KEY Key;
InitializeLib(ImageHandle, SystemTable);
/*
* In addition to the standard %-based flags, Print() supports the following:
* %N Set output attribute to normal
* %H Set output attribute to highlight
* %E Set output attribute to error
* %B Set output attribute to blue color
* %V Set output attribute to green color
* %r Human readable version of a status code
*/
Print(L"\n%H*** UEFI:SIMPLE ***%N\n\n");
Print(L"%EPress any key to exit.%N\n");
SystemTable->ConIn->Reset(SystemTable->ConIn, FALSE);
while (SystemTable->ConIn->ReadKeyStroke(SystemTable->ConIn, &Key) == EFI_NOT_READY);
#if defined(_DEBUG)
// If running in debug mode, use the EFI shut down call to close QEMU
RT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
#endif
return EFI_SUCCESS;
}