[feat] Use gnu-efi

This commit is contained in:
2026-05-09 20:35:21 +08:00
Unverified
parent 06fd67c1d2
commit 37fafd9431
5 changed files with 20 additions and 28 deletions
+7 -20
View File
@@ -1,22 +1,9 @@
#define ull unsigned long long
#include <efi.h>
#include <efilib.h>
struct EFI_SYSTEM_TABLE {
char _buf[60];
struct EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
ull _buf;
ull (*OutputString)(
struct EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
unsigned short *String);
ull _buf2[4];
ull (*ClearScreen)(
struct EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This);
} *ConOut;
};
void efi_main(void *ImageHandle __attribute__ ((unused)), struct EFI_SYSTEM_TABLE *SystemTable)
{
SystemTable->ConOut->ClearScreen(SystemTable->ConOut);
SystemTable->ConOut->OutputString(SystemTable->ConOut, L"Hello UEFI!\n");
EFI_STATUS EFIAPI efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) {
InitializeLib(ImageHandle, SystemTable);
Print(L"Hello, world!\n");
while (1);
}
return EFI_SUCCESS;
}