mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Splitting out UEFI bootloader code from kernel
Now the bootloader should be responsible for all initial setup, loading the kernel, and then handing off to the kernel with proper data in place.
This commit is contained in:
18
src/boot/utility.c
Normal file
18
src/boot/utility.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <efi.h>
|
||||
|
||||
struct ErrorCode {
|
||||
EFI_STATUS code;
|
||||
const CHAR16 *desc;
|
||||
};
|
||||
|
||||
extern struct ErrorCode ErrorCodeTable[];
|
||||
|
||||
const CHAR16 *util_error_message(EFI_STATUS status) {
|
||||
int32_t i = -1;
|
||||
while (ErrorCodeTable[++i].desc != NULL) {
|
||||
if (ErrorCodeTable[i].code == status)
|
||||
return ErrorCodeTable[i].desc;
|
||||
}
|
||||
|
||||
return L"Unknown";
|
||||
}
|
||||
Reference in New Issue
Block a user