From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K3r9P-00012B-8Z for mharc-grub-devel@gnu.org; Wed, 04 Jun 2008 07:27:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3r9N-00011K-FI for grub-devel@gnu.org; Wed, 04 Jun 2008 07:27:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3r9M-000118-N4 for grub-devel@gnu.org; Wed, 04 Jun 2008 07:27:28 -0400 Received: from [199.232.76.173] (port=45469 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3r9M-000115-Fh for grub-devel@gnu.org; Wed, 04 Jun 2008 07:27:28 -0400 Received: from mta11.charter.net ([216.33.127.80]:35149) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3r9M-00068b-Ds for grub-devel@gnu.org; Wed, 04 Jun 2008 07:27:28 -0400 Received: from aarprv04.charter.net ([10.20.200.74]) by mta11.charter.net (InterMail vM.7.08.03.00 201-2186-126-20070710) with ESMTP id <20080604112722.MZYB5653.mta11.charter.net@aarprv04.charter.net> for ; Wed, 4 Jun 2008 07:27:22 -0400 Received: from [192.168.0.102] (really [71.10.234.12]) by aarprv04.charter.net with ESMTP id <20080604112722.HZGZ4495.aarprv04.charter.net@[192.168.0.102]> for ; Wed, 4 Jun 2008 07:27:22 -0400 Message-ID: <48467C1D.5000204@isaac.cedarswampstudios.org> Date: Wed, 04 Jun 2008 07:27:25 -0400 From: Isaac Dupree User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: The development of GRUB 2 References: <4840123A.5020003@isaac.cedarswampstudios.org> <48406B3F.1070704@isaac.cedarswampstudios.org> <20080531093501.GA6619@thorin> <48419F91.3070408@isaac.cedarswampstudios.org> <20080531192640.GA25920@thorin> <4841C728.5070008@isaac.cedarswampstudios.org> <48457141.3020405@isaac.cedarswampstudios.org> <48467600.9090203@isaac.cedarswampstudios.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Chzlrs: 0 X-detected-kernel: by monty-python.gnu.org: Solaris 10 (1203?) Subject: Re: macbook EFI experiences X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2008 11:27:29 -0000 Bean wrote: > On Wed, Jun 4, 2008 at 7:01 PM, Isaac Dupree > wrote: >> how do you apply this patch? With `patch -p1` I'm getting: >> 2 out of 4 hunks FAILED -- saving rejects to file >> loader/i386/efi/linux.c.rej >> >> any more infos needed? > > There maybe some code mixups, try this one: nope, against latest CVS: > patch -p1 <../grubinitrd2.patch patching file loader/i386/efi/linux.c Hunk #1 FAILED at 601. Hunk #2 FAILED at 612. 2 out of 4 hunks FAILED -- saving rejects to file loader/i386/efi/linux.c.rej > BTW, are you using a customized kernel ? Some people reports that efi > booting don't work. They have 32-bit firmware just like yours, but > hangs even without the initrd. Well, I'll see what happens. (Ubuntu kernel is very customized by the Ubuntu devs.) I have a theory that the console display doesn't work so I need to get feedback some other way (X? Sound? File modification? Visibility on network (plug into ethernet first)?) to see if linux has booted. Also once I have got this patch tried, I'll try adding your other patch(es) for x86-64 and see if a 64-bit EFI image makes any difference (although I doubt it will work any *better*, and possibly worse. but who knows.) Does grub2 "multiboot"-ing itself, work yet? (just so we could test that too under EFI) > > diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c > index ee3fb99..5ace7c0 100644 > --- a/loader/i386/efi/linux.c > +++ b/loader/i386/efi/linux.c > @@ -601,7 +601,7 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) > > lh = (struct linux_kernel_header *) real_mode_mem; > > - addr_max = grub_cpu_to_le32 (lh->initrd_addr_max); > + addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10); > if (linux_mem_size != 0 && linux_mem_size < addr_max) > addr_max = linux_mem_size; > > @@ -612,7 +612,8 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) > addr_max -= 0x10000; > > /* Usually, the compression ratio is about 50%. */ > - addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12); > + addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) > + + page_align (size); > > /* Find the highest address to put the initrd. */ > mmap_size = find_mmap_size (); > @@ -625,8 +626,6 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) > desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) > { > if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY > - && desc->physical_start >= addr_min > - && desc->physical_start + size < addr_max > && desc->num_pages >= initrd_pages) > { > grub_efi_physical_address_t physical_end; > @@ -635,6 +634,9 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) > if (physical_end > addr_max) > physical_end = addr_max; > > + if (physical_end < addr_min) > + continue; > + > if (physical_end > addr) > addr = physical_end - page_align (size); > } > >