Hello world UEFI app in D using uefi-d library

This commit is contained in:
josh committed 2022-03-09 09:46:43 -05:00
commit 216ef2d654
6 files changed
+111

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import uefi;
extern (C) void * _tls_index = null;
void write_string(EFI_SYSTEM_TABLE * st, const(wchar)[] str)
{
st.ConOut.OutputString(st.ConOut, cast(CHAR16 *)str.ptr);
}
extern (C) EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * st)
{
write_string(st, "Hello, D UEFI world!\r\n"w);
write_string(st, "Press any key...\r\n"w);
st.ConIn.Reset(st.ConIn, FALSE);
EFI_INPUT_KEY key;
while (st.ConIn.ReadKeyStroke(st.ConIn, &key) == EFI_NOT_READY)
{
}
return EFI_SUCCESS;
}