From 017025fae202ad8c75cf3679751d85814e6620aa Mon Sep 17 00:00:00 2001 From: TomAwezome Date: Sat, 27 Aug 2022 16:44:01 -0400 Subject: [PATCH] Correctly set sys_boot_src in zealbooter based on media type. --- zealbooter/zealbooter.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zealbooter/zealbooter.c b/zealbooter/zealbooter.c index e99337ea..9f02cd54 100644 --- a/zealbooter/zealbooter.c +++ b/zealbooter/zealbooter.c @@ -139,6 +139,8 @@ struct CKernel { } __attribute__((packed)); #define BOOT_SRC_RAM 2 +#define BOOT_SRC_HDD 3 +#define BOOT_SRC_DVD 4 #define RLF_16BIT 0b01 #define RLF_VESA 0b10 @@ -222,7 +224,12 @@ void _start(void) { CORE0_32BIT_INIT -= (uintptr_t)kernel->address; CORE0_32BIT_INIT += final_address; - CKernel->boot_src = BOOT_SRC_RAM; + if (kernel->media_type == LIMINE_MEDIA_TYPE_OPTICAL) + CKernel->boot_src = BOOT_SRC_DVD; + else if (kernel->media_type == LIMINE_MEDIA_TYPE_GENERIC) + CKernel->boot_src = BOOT_SRC_HDD; + else + CKernel->boot_src = BOOT_SRC_RAM; CKernel->boot_blk = 0; CKernel->boot_patch_table_base = (uintptr_t)CKernel + CKernel->h.patch_table_offset; CKernel->boot_patch_table_base -= (uintptr_t)kernel->address;