[Top][All Lists]

[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: Zhang
Subject: Re: Can the grub2.02 improve the limit of initrd size in 64-bit system?
Date: Fri, 2 Aug 2019 14:45:04 +0800 (CST)

Yes,I want to an initrd  as big as possible on  the service where ram size is large. Maybe the initrd can include files > 1GB.

I am sorry that I have a mistake.The right is as follows:
It seems good for initrd size between 0x37feffff-0x7fffffff(2GB).But the grub 
seems it is against that.

1、BIOS in legacy mode :
I can load a 1.75G image-initrd in the x86_64 system and the linux boot normal.  In my experiment,  the image-initrd of size is n 0x37feffff-0x7fffffff(2GB)
which can boot normal.

The limit value 0x7fffffff is that grub_read_file uses the len is signed int (<2GB)when I use the  BIOS in legacy mode to boot linux.
I see that 0x37ffffff(896M) is a line between the normal zone and highmem zone in the 32-bit system.  The grub is 32-bit mode and the linux changes the 32-bit to 64-bit. So is the reason that the grub sets GRUB_LINUX_INITRD_MAX_ADDRESS =0x37FFFFFF  because grub and kernel need 32-bit mode?
I know I have enough ram size  and 64-bit kernel , so can I set GRUB_LINUX_INITRD_MAX_ADDRESS =0x7FFFFFFF ?

  if (grub_le_to_cpu16 (linux_params.version) >= 0x0203)
      addr_max = grub_cpu_to_le32 (linux_params.initrd_addr_max);
      /* XXX in reality, Linux specifies a bogus value, so
         it is necessary to make sure that ADDR_MAX does not exceed
         0x3fffffff.  */
     if (addr_max > GRUB_LINUX_INITRD_MAX_ADDRESS)
              addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS;
  if (linux_mem_size != 0 && linux_mem_size < addr_max)
    addr_max = linux_mem_size;

  /* Linux 2.3.xx has a bug in the memory range check, so avoid
     the last page.
     Linux 2.2.xx has a bug in the memory range check, which is
     worse than that of Linux 2.3.xx, so avoid the last 64kb.  */
  addr_max -= 0x10000;

32-bit system:
DMA zone 0-16M
Normal zone:16M-896M
highmenm zone :896M-1G

2、Does EFI support the 64-bit boot protocol?
UEFI  boot:
It seems that the grub2.02 is 64-bit because the grub supports 64-bit data. The function of grub_read_file can read the file above 2GB.
when I use a 2G image-initrd ,it boots normal. But when I use a 3G image-initrd, it shows "error: out of memory".
So is it a limit in malloc_in_rang function?




reply via email to

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