From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1J9lAp-0000OQ-Fw for mharc-grub-devel@gnu.org; Tue, 01 Jan 2008 12:45:07 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J9lAn-0000OG-RJ for grub-devel@gnu.org; Tue, 01 Jan 2008 12:45:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J9lAm-0000Nv-HV for grub-devel@gnu.org; Tue, 01 Jan 2008 12:45:05 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J9lAm-0000Ns-B2 for grub-devel@gnu.org; Tue, 01 Jan 2008 12:45:04 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J9lAl-00062I-SS for grub-devel@gnu.org; Tue, 01 Jan 2008 12:45:04 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1J9lAj-0002v2-42 for grub-devel@gnu.org; Tue, 01 Jan 2008 18:45:03 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1J9lAI-00010T-TQ for grub-devel@gnu.org; Tue, 01 Jan 2008 18:44:34 +0100 Date: Tue, 1 Jan 2008 18:44:34 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080101174434.GB3440@thorin> References: <471E4628.9030706@t-online.de> <20071118112737.GB16674@thorin> <474202DA.4010001@t-online.de> <47790D50.4060000@t-online.de> <20080101111652.GA8608@thorin> <477A77D9.9020607@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <477A77D9.9020607@t-online.de> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Fix eisa_mmap evaluation, add memory existence check 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: Tue, 01 Jan 2008 17:45:06 -0000 On Tue, Jan 01, 2008 at 06:26:49PM +0100, Christian Franke wrote: > >>--- grub2.orig/kern/i386/pc/init.c 2007-10-22 22:22:51.359375000 +0200 > >>+++ grub2/kern/i386/pc/init.c 2007-12-31 16:05:59.953125000 +0100 > >>@@ -199,13 +199,8 @@ grub_machine_init (void) > >> > >> if (eisa_mmap) > >> { > >>- if ((eisa_mmap & 0xFFFF) == 0x3C00) > >>- add_mem_region (0x100000, (eisa_mmap << 16) + 0x100000 * 15); > >>- else > >>- { > >>- add_mem_region (0x100000, (eisa_mmap & 0xFFFF) << 10); > >>- add_mem_region (0x1000000, eisa_mmap << 16); > >>- } > >>+ add_mem_region (0x100000, (eisa_mmap & 0xFFFF) << 10); > >>+ add_mem_region (0x1000000, eisa_mmap & ~0xFFFF); > >> } > >> else > >> add_mem_region (0x100000, grub_get_memsize (1) << 10); > >> > > > >Ok, as it seems, this comes from: > > > > * grub_get_eisa_mmap() : return packed EISA memory map, lower 16 bits is > > * memory between 1M and 16M in 1K parts, upper 16 bits is > > * memory above 16M in 64K parts. If error, return zero. > > > >So the replacement of "eisa_mmap << 16" seems obviously correct, but the > >"0x3C00" part you removed is completely misterious to me. Can you explain > >what was it supposed to be doing or why you removed it? > > > > > > This part is intended to handle the (normal) case of one continuous > region with not gap between 1M and 16M: > (0x3C00 << 10) = 0x100000 * 15 = 15M > But this part does not work due to the same bug. > > It is IMO not necessary to make this distinction. The function > compact_mem_regions() called a few lines later joins the two regions anyway. Ah, ok. Have you verified that this is so? (setting debug=mem variable during init might help on that). Sorry for being so inquisitive, but I need to understand things well before touching this part of GRUB, which as I said I'm not very familiar with. -- Robert Millan I know my rights; I want my phone call! What use is a phone call, if you are unable to speak? (as seen on /.)