-
Notifications
You must be signed in to change notification settings - Fork 0
/
augerxenith.c
43 lines (29 loc) · 1.4 KB
/
augerxenith.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
37
38
39
40
41
42
43
#include "efi.h"
EFI_STATUS EFIAPI efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
{
// Cast the argiument to void, to avoid a compiler warning.
(void)ImageHandle;
// TEXT ATTR: FG = GREEN, BG = RED
SystemTable->ConOut->SetAttribute(SystemTable->ConOut, EFI_TEXT_ATTR(EFI_GREEN, EFI_BLACK));
// CLEAR SCREEN TO BG
SystemTable->ConOut->ClearScreen(SystemTable->ConOut);
// HELLO THE WORLD
SystemTable->ConOut->OutputString(SystemTable->ConOut, u"HELLO WORLD OF EFI HAHAHA!\n");
// TEXT ATTR: FG = YELLOW, BG = BLACK
SystemTable->ConOut->SetAttribute(SystemTable->ConOut, EFI_TEXT_ATTR(EFI_YELLOW, EFI_BLACK));
// PRINT THE MESSAGE
SystemTable->ConOut->OutputString(SystemTable->ConOut, u"Press the 'ANY' key to shutdown\n");
// TEXT ATTR: FG = RED, BG = BLACK
SystemTable->ConOut->SetAttribute(SystemTable->ConOut, EFI_TEXT_ATTR(EFI_RED, EFI_BLACK));
// PRINT THE COOLER MESSAGE
SystemTable->ConOut->OutputString(SystemTable->ConOut, u"yes. the 'ANY' key. you heard me.\n");
// TEXT ATTR: FG = CYAN, BG = BLACK
SystemTable->ConOut->SetAttribute(SystemTable->ConOut, EFI_TEXT_ATTR(EFI_CYAN, EFI_BLACK));
// WAIT FOR KEYPRESS
EFI_INPUT_KEY key;
while (SystemTable->ConIn->ReadKeyStroke(SystemTable->ConIn, &key) != EFI_SUCCESS);
// SHUTDOWN
SystemTable->RuntimeServices->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
// NEVER REACHED BUT NEEDED
return EFI_SUCCESS;
}