Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MU5tY-0001I7-KR for mharc-grub-devel@gnu.org; Thu, 23 Jul 2009 17:32:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU5tW-0001Fw-Oo for grub-devel@gnu.org; Thu, 23 Jul 2009 17:32:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU5tS-0001B9-GV for grub-devel@gnu.org; Thu, 23 Jul 2009 17:32:06 -0400 Received: from [199.232.76.173] (port=39379 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU5tS-0001Aw-8C for grub-devel@gnu.org; Thu, 23 Jul 2009 17:32:02 -0400 Received: from c60.cesmail.net ([216.154.195.49]:6121) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MU5tR-0005ao-G1 for grub-devel@gnu.org; Thu, 23 Jul 2009 17:32:01 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 23 Jul 2009 17:31:59 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id BF9E434C6A for ; Thu, 23 Jul 2009 17:42:42 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: Content-Type: text/plain Date: Thu, 23 Jul 2009 17:31:57 -0400 Message-Id: <1248384717.2661.109.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] zero-fill entry before asking BIOS for memory map 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: Thu, 23 Jul 2009 21:32:07 -0000 On Thu, 2009-07-23 at 11:38 +0200, Vladimir 'phcoder' Serbinenko wrote: > Hello. According to xen some BIOSes update only lower 32-bit in mmap > entries. To workaround this and not get high values in memory map > zero-fill before calling BIOS I think the fix belongs to grub_get_mmap_entry(), not to all of its callers. Something like this: diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index be258fb..5468ba8 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -997,6 +997,14 @@ FUNCTION(grub_get_mmap_entry) /* push ADDR */ pushl %eax + /* clear the request area, buggy BIOSes may not clear it */ + xor %edi, %edi + movl %edi, 4(%eax) + movl %edi, 8(%eax) + movl %edi, 12(%eax) + movl %edi, 16(%eax) + movl %edi, 20(%eax) + /* place address (+4) in ES:DI */ addl $4, %eax movl %eax, %edi I don't know whether it would interfere with the Apple CC workaround. It would be great if we get rid of it, perhaps by using labels starting with "L_". -- Regards, Pavel Roskin