The project has moved to GitLab and contributions go into standard MRs.
Check the following file

https://gitlab.freedesktop.org/gnu-grub/grub/-/blob/master/CONTRIBUTING

Leo



On Wed, Nov 11, 2026 at 11:34 AM Ondrej Zary via Grub-devel <
[email protected]> wrote:

> Synology DS411+II BIOS breaks when get_diskinfo_int13_extensions is called
> 16 times. All subsequent int13 disk accesses will fail.
>
> As GRUB opens and closes disks multiple times, biosdisk calls that function
> repeatedly, resulting in failure before loading normal.mod.
>
> Call the function only once for each hard drive and cache the output.
>
> Signed-off-by: Ondrej Zary <[email protected]>
> ---
>  grub-core/disk/i386/pc/biosdisk.c | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/disk/i386/pc/biosdisk.c
> b/grub-core/disk/i386/pc/biosdisk.c
> index 4b9bae0d1..a8d1ce8c5 100644
> --- a/grub-core/disk/i386/pc/biosdisk.c
> +++ b/grub-core/disk/i386/pc/biosdisk.c
> @@ -34,6 +34,16 @@ GRUB_MOD_LICENSE ("GPLv3+");
>  static int cd_drive = 0;
>  static int grub_biosdisk_rw_int13_extensions (int ah, int drive, void
> *dap);
>
> +/* Synology DS411+II BIOS breaks when get_diskinfo_int13_extensions is
> called
> +   16 times. Call it only once for each hard drive and cache the output
> here. */
> +struct hdd_params_cache_entry
> +{
> +  grub_uint64_t total_sectors;
> +  grub_uint16_t bytes_per_sector;
> +};
> +/* for drives 0x80..0x8f */
> +static struct hdd_params_cache_entry hdd_params_cache[16];
> +
>  static int grub_biosdisk_get_num_floppies (void)
>  {
>    struct grub_bios_int_registers regs;
> @@ -366,13 +376,21 @@ grub_biosdisk_open (const char *name, grub_disk_t
> disk)
>        version = grub_biosdisk_check_int13_extensions (drive);
>        if (version)
>         {
> +         struct hdd_params_cache_entry *cached = NULL;
>           struct grub_biosdisk_drp *drp
>             = (struct grub_biosdisk_drp *) grub_absolute_pointer
> (GRUB_MEMORY_MACHINE_SCRATCH_ADDR);
>
>           /* Clear out the DRP.  */
>           grub_memset (drp, 0, sizeof (*drp));
>           drp->size = sizeof (*drp);
> -         if (! grub_biosdisk_get_diskinfo_int13_extensions (drive, drp))
> +         /* Use cached data if cache entry is valid */
> +         if (drive >= 0x80 && drive < 0x90 && hdd_params_cache[drive -
> 0x80].total_sectors)
> +           {
> +             cached = &hdd_params_cache[drive - 0x80];
> +             drp->total_sectors = cached->total_sectors;
> +             drp->bytes_per_sector = cached->bytes_per_sector;
> +           }
> +         if (cached || ! grub_biosdisk_get_diskinfo_int13_extensions
> (drive, drp))
>             {
>               data->flags = GRUB_BIOSDISK_FLAG_LBA;
>
> @@ -389,6 +407,13 @@ grub_biosdisk_open (const char *name, grub_disk_t
> disk)
>                   && drp->bytes_per_sector >= 512
>                   && drp->bytes_per_sector <= 16384)
>                 disk->log_sector_size = grub_log2ull
> (drp->bytes_per_sector);
> +             /* Cache the data */
> +             if (drive >= 0x80 && drive < 0x90)
> +               {
> +                 cached = &hdd_params_cache[drive - 0x80];
> +                 cached->total_sectors = total_sectors;
> +                 cached->bytes_per_sector = 1 << disk->log_sector_size;
> +               }
>             }
>         }
>      }
> @@ -686,6 +711,8 @@ GRUB_MOD_INIT(biosdisk)
>    if (boot_drive >= 0x90)
>      cd_drive = boot_drive;
>
> +  grub_memset (hdd_params_cache, 0, sizeof (hdd_params_cache));
> +
>    grub_disk_dev_register (&grub_biosdisk_dev);
>  }
>
> --
> 2.47.3
>
>
> _______________________________________________
> Grub-devel mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to