I have followed this https://wiki.osdev.org/UEFI_Bare_Bones and I have the hello world example
running in both QEMU and on hardware form a USB, so that is very good.
I would like to extend the example, as suggested, with the WaitForKey.
If I have understood correct the code should look somthing like this:
Code: Select all
/* Now wait until a key becomes available. This is a simple
polling implementation. You could try and use the WaitForKey
event instead if you like */
/* while(Status = ST->ConIn->ReadKeyStroke(ST->ConIn, &Key) == EFI_NOT_READY); */
while (Key.UnicodeChar != 'q')
{
WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
ST->ConIn->ReadKeyStroke(ST->ConIn, &Key);
ST->ConOut->OutputString(ST->ConOut, &Key.UnicodeChar );
}
Code: Select all
/usr/lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/ld: hello.o:hello.c:(.text+0xca): undefined reference to `WaitForSingleEvent'
collect2: error: ld returned 1 exit status
Anyone who can help?