17. 부팅 옵션에 WaitForEvent 함수 추가
Shell> exit


Last updated
Shell> exit


Last updated
EFI_BOOT_SERVICES.WaitForEvent()
Summary
Stops execution until an event is signaled.
Prototype
typedef
EFI_STATUS
(EFIAPI *EFI_WAIT_FOR_EVENT) (
IN UINTN NumberOfEvents,
IN EFI_EVENT *Event,
OUT UINTN *Index
);
Parameters
NumberOfEvents The number of events in the Event array.
Event An array of EFI_EVENT.
Index Pointer to the index of the event which satisfied the wait condition.typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
EFI_INPUT_RESET Reset;
EFI_INPUT_READ_KEY ReadKeyStroke;
EFI_EVENT WaitForKey;
} EFI_SIMPLE_TEXT_INPUT_PROTOCOL;UINTN Index;
gBS->WaitForEvent(1, &(gST->ConIn->WaitForKey), &Index);build --platform=OvmfPkg/OvmfPkgX64.dsc --arch=X64 --buildtarget=RELEASE --tagname=GCC5EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset()
Summary:
Resets the input device hardware.
Prototype:
typedef
EFI_STATUS
(EFIAPI *EFI_INPUT_RESET) (
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
);
Parameters:
This A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL instance.
ExtendedVerification Indicates that the driver may perform a more exhaustive verification
operation of the device during reset.
Description:
The Reset() function resets the input device hardware.
The implementation of Reset is required to clear the contents of any input queues resident in memory
used for buffering keystroke data and put the input stream in a known empty stategST->ConIn->Reset(gST->ConIn, FALSE);#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
EFI_STATUS
EFIAPI
UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Hello World!\n");
gST->ConOut->OutputString(gST->ConOut, L"Hello again!\n");
Print(L"Bye!\n");
UINTN Index;
gBS->WaitForEvent(1, &(gST->ConIn->WaitForKey), &Index);
gST->ConIn->Reset(gST->ConIn, FALSE);
return EFI_SUCCESS;
}