Add output module for console output routines

This commit is contained in:
josh committed 2022-03-14 13:53:02 -04:00
1 parent d782b59768
commit 0be1b113aa
3 files changed
+29 -3

No files matched your search

+7 -2
View File
@@ -1,11 +1,16 @@
import uefi;
import output;
__gshared EFI_SYSTEM_TABLE * g_st;
extern (C) EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE * st)
{
g_st = st;
st.ConOut.ClearScreen(st.ConOut);
st.ConOut.OutputString(st.ConOut, cast(CHAR16 *)"HOS EFI loader\r\n"w);
st.ConOut.OutputString(st.ConOut, cast(CHAR16 *)"Press any key...\r\n"w);
writeln("HOS EFI loader");
writeln("Press any key...");
st.ConIn.Reset(st.ConIn, FALSE);
EFI_INPUT_KEY key;
+21
View File
@@ -0,0 +1,21 @@
import uefi;
import hel;
void write(string s)
{
__gshared static CHAR16[256] s16;
size_t i = 0u;
while (i < s.length)
{
s16[i] = s[i];
i++;
}
s16[i++] = 0u;
g_st.ConOut.OutputString(g_st.ConOut, &s16[0]);
}
void writeln(string s)
{
write(s);
write("\r\n");
}