]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Optimization for Linux vDisk boot in Legacy BIOS mode
authorlongpanda <admin@ventoy.net>
Wed, 21 Oct 2020 09:45:44 +0000 (17:45 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 21 Oct 2020 09:45:44 +0000 (17:45 +0800)
INSTALL/grub/grub.cfg
IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/core/ventoy_vdisk.c
IPXE/ipxe_mod_code/ipxe-3fe683e/src/arch/x86/interface/pcbios/ventoy_int13.c
IPXE/ipxe_mod_code/ipxe-3fe683e/src/include/ventoy.h

index 51a2ee65d605bcc2aa96ccdfcc67bc1d4f4f5998..4025f35d0e1ca9717c6dcb4acca39fcee829ee58 100644 (file)
@@ -1046,7 +1046,7 @@ function vtoyboot_common_func {
         if [ -n "$vtoy_chain_mem_addr" ]; then  
             if [ "$grub_platform" = "pc" ]; then
                 vt_acpi_param ${vtoy_chain_mem_addr} 512
-                linux16 $vtoy_path/ipxe.krn ${vtdebug_flag}  sector512  mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}   
+                linux16 $vtoy_path/ipxe.krn ${vtdebug_flag} bios80  sector512  mem:${vtoy_chain_mem_addr}:size:${vtoy_chain_mem_size}   
                 boot
             else
                 ventoy_acpi_param ${vtoy_chain_mem_addr} 512
index 14c6cb0628745b12bade8998be3cde3c7078fb25..0224b8aba0ddf785d25f6c8ecca71a12512e40e2 100644 (file)
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 int g_debug = 0;
 int g_hddmode = 0;
+int g_bios_disk80 = 0;
 char *g_cmdline_copy;
 void *g_initrd_addr;
 size_t g_initrd_len;
@@ -697,6 +698,11 @@ int ventoy_boot_vdisk(void *data)
     {
         g_hddmode = 1;
     }
+    
+    if (strstr(g_cmdline_copy, "bios80"))
+    {
+        g_bios_disk80 = 1;
+    }
 
     g_chain = (ventoy_chain_head *)g_initrd_addr;
     g_chunk = (ventoy_img_chunk *)((char *)g_chain + g_chain->img_chunk_offset);
index cf6fc95bd311a682407c433210d4411ffccf3a87..75960c2b5f19f0c699f2f3098476b7f560d712c8 100644 (file)
@@ -1425,7 +1425,7 @@ unsigned int ventoy_int13_hook (ventoy_chain_head *chain)
     
        if (g_hddmode)
     {
-        natural_drive = num_drives | 0x80;
+        natural_drive = g_bios_disk80 ? 0x80 : (num_drives | 0x80);
     }
     else
     {
index 9bb1b3fa217ddf63bfb8a1d8208266614ce00dee..b10534d4a93b1e9edf5125baa324d5d4419ed22d 100644 (file)
@@ -187,6 +187,7 @@ typedef struct ventoy_sector_flag
 
 extern int g_debug;
 extern int g_hddmode;
+extern int g_bios_disk80;
 extern char *g_cmdline_copy;
 extern void *g_initrd_addr;
 extern size_t g_initrd_len;