grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can the grub2.02 improve the limit of initrd size in 64-bit system?


From: Lennart Sorensen
Subject: Re: Can the grub2.02 improve the limit of initrd size in 64-bit system?
Date: Wed, 31 Jul 2019 10:59:39 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Jul 30, 2019 at 10:50:23AM +0800, 电子科技大学-张旭霞 wrote:
> Hi All,
> 
> environment : X86-64 , kernel 3.16.0(64-bit support),grub2.02
> 
> I compile the grub2.02 by default. And the grub boots the linux kernel with 
> 32-bit boot protocol.(Documents/X86/boot.txt)
> 
> I want to use the initrd as big as possible, but it is limited as follows.
> 
> But when I make a image-initrd that size is 1.75G(no compression), the grub 
> can boot linux normal .
> 
> It seems good for initrd size between 0x37feffff-0x3fffffff.But the grub 
> seems it is against that.
> 
> So I have some questions:
> 
> 1、Why it is necessary to make sure that ADDR_MAX does not exceed 0x3fffffff ? 
> Has it a relationship about the 32-bit kernel?
> 
> 2、Can I  set addr_max=0x3fFFFFFF when (grub_le_to_cpu16 
> (linux_params.version) >= 0x0203?
> 
> include/grub/i386/linux.h
> 
> #define GRUB_LINUX_INITRD_MAX_ADDRESS   0x37FFFFFF

Interesting that on arm the address offset is allowed to be 32GB on 64bit
arm.  x86 does not appear to have any special handling for 64 bit yet.

So 32 bit arm requires kernel + initrd less than 512MB, 64 bit
arm requires kernel + inirrd less than 32GB.  If I read the code
correctly, booting x86 in efi mode the max initrd file allocation is 1GB
(0x3fffffff).  Seems the code is shared for 32 and 64 bit EFI and doesn't
allow anything more on 64 bit than 32 bit.  Of course no normal system
would ever need more so no point implementing it.

A 1GB ramdisk would be plenty to start a system that could then load more
ramdisks if it really wanted to.  Could any sensible use case exist for
loading an initrd that large?

-- 
Len Sorensen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]