This will break systems that have a bug of mapping only 4GiB of RAM. This
code is a workaround for that bug. Which system do you use? Is it an x64?
If so I see a solution in having a code that would check paging table and
then decide on maximum usable memory

Regards
Vladimir 'phcoder' Serbinenko

Le mer. 16 avr. 2025, 23:00, Paymon MARANDI <pay...@encs.concordia.ca> a
écrit :

> this basically comes down to this in the specs:
>
> - Allocation requests of Type AllocateMaxAddress allocate any available
> range
>   of pages whose uppermost address is less than or equal to the address
> pointed
>   to by Memory on input. (this returns EFI_OUT_OF_RESOURCEST on loading
>   slightly large, 710MB, kernel images)
>
> + Allocation requests of Type AllocateAnyPages allocate any available
> range of
>   pages that satisfies the request. On input, the address pointed to by
> Memory
>   is ignored.
>
> Signed-off-by: Paymon MARANDI <pay...@encs.concordia.ca>
> ---
>  grub-core/kern/efi/mm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
> index df238b165..782b08099 100644
> --- a/grub-core/kern/efi/mm.c
> +++ b/grub-core/kern/efi/mm.c
> @@ -169,7 +169,7 @@ void *
>  grub_efi_allocate_any_pages (grub_efi_uintn_t pages)
>  {
>    return grub_efi_allocate_pages_real (GRUB_EFI_MAX_USABLE_ADDRESS,
> -                                      pages,
> GRUB_EFI_ALLOCATE_MAX_ADDRESS,
> +                                      pages, GRUB_EFI_ALLOCATE_ANY_PAGES,
>                                        GRUB_EFI_LOADER_DATA);
>  }
>
> --
> 2.49.0
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to