diff --git a/src/Kernel/KStart16.ZC b/src/Kernel/KStart16.ZC index 858b9dde..8d94dd88 100755 --- a/src/Kernel/KStart16.ZC +++ b/src/Kernel/KStart16.ZC @@ -62,6 +62,8 @@ SYS_DISK_UUID:: DU64 0, 0; SYS_BOOT_STACK:: DU32 BOOT_RAM_LIMIT; +SYS_IS_UEFI_BOOTED:: DU8 0; + #assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE) REQUESTED_SCREEN_WIDTH: DU16 1024; diff --git a/src/Kernel/KernelA.HH b/src/Kernel/KernelA.HH index 6add4936..fb81866b 100755 --- a/src/Kernel/KernelA.HH +++ b/src/Kernel/KernelA.HH @@ -564,6 +564,7 @@ class CKernel U64 sys_smbios_entry; U64 sys_disk_uuid[2]; U32 sys_boot_stack; + Bool sys_is_uefi_booted; }; //Run-Levels diff --git a/src/Kernel/KernelB.HH b/src/Kernel/KernelB.HH index 4955427e..01887d79 100755 --- a/src/Kernel/KernelB.HH +++ b/src/Kernel/KernelB.HH @@ -253,6 +253,8 @@ public _extern SYS_FRAMEBUFFER_BPP U8 sys_framebuffer_bpp; #help_index "Processor/SMBIOS" public _extern SYS_SMBIOS_ENTRY U8 *sys_smbios_entry; +#help_index "" public _extern SYS_DISK_UUID U64 sys_disk_uuid[2]; +public _extern SYS_IS_UEFI_BOOTED Bool sys_is_uefi_booted; #help_index "" diff --git a/zealbooter/zealbooter.c b/zealbooter/zealbooter.c index e17cfe9a..513a7e4d 100644 --- a/zealbooter/zealbooter.c +++ b/zealbooter/zealbooter.c @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -28,6 +29,11 @@ static volatile struct limine_smbios_request smbios_request = { .revision = 0 }; +static volatile struct limine_efi_system_table_request efi_request = { + .id = LIMINE_EFI_SYSTEM_TABLE_REQUEST, + .revision = 0 +}; + struct CZXE { uint16_t jmp; uint8_t module_align_bits; @@ -109,6 +115,7 @@ struct CKernel { uint16_t sys_disk_uuid_c; uint8_t sys_disk_uuid_d[8]; uint32_t sys_boot_stack; + uint8_t sys_is_uefi_booted; } __attribute__((packed)); #define BOOT_SRC_RAM 2 @@ -320,6 +327,11 @@ void _start(void) { kernel->sys_boot_stack = boot_stack; + if (efi_request.response) + { + kernel->sys_is_uefi_booted = true; + } + memcpy(trampoline_phys, trampoline, trampoline_size); memcpy((void *)final_address, kernel, module_kernel->size);