wiki:debirf/memoryUsage

grub initramfs size restrictions

18:40 < dkg> quick braindump from reading the grub source:
18:41 < dkg> grub finds the largest continguous block of RAM above the 1MiB boundary
18:41 < dkg> then it lops off the top 25% to save that as free RAM
18:42 < dkg> then (if loading linux, and not some other OS) it checks if the kernel header has an 
             upper limit; 
18:42 < dkg> (an upper limit on initrd address, that is)
18:43 < dkg> then it takes the minimum(1GB, kernel header limit, 75% of free RAM)
18:43 < dkg> and treats that as the upper limit in RAM for the initrd.
18:43 < dkg> the lower limit is: bottom of contiguous free range + (3*size of kernel) + (size of 
             initrd)
18:44 < dkg> so the placement in RAM ends up being:
18:44 < dkg> kernel + freespace at least as big as initrd + initrd + freespace equal to at least 25% 
             of contiguous RAM
18:45 < dkg> and that's why it refuses to load a 57MB initrd in a 128MB system
Last modified 8 years ago Last modified on Oct 2, 2009, 6:53:18 PM