entry/uefi: Abort if loaded above 4GiB. Fix #206

This commit is contained in:
mintsuki 2022-08-25 21:50:37 +02:00
parent a89b843673
commit ed0c32f20a

View File

@ -26,6 +26,8 @@
void stage3_common(void);
#if uefi == 1
extern symbol __image_base;
noreturn void uefi_entry(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) {
gST = SystemTable;
gBS = SystemTable->BootServices;
@ -49,6 +51,10 @@ noreturn void uefi_entry(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
init_gdt();
#endif
if ((uintptr_t)__image_base > 0x100000000) {
panic(false, "Limine does not support being loaded above 4GiB");
}
disk_create_index();
boot_volume = NULL;