From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lffa6-0006Ij-AL for mharc-grub-devel@gnu.org; Fri, 06 Mar 2009 14:19:38 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lffa5-0006IQ-6w for grub-devel@gnu.org; Fri, 06 Mar 2009 14:19:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lffa4-0006IE-NK for grub-devel@gnu.org; Fri, 06 Mar 2009 14:19:36 -0500 Received: from [199.232.76.173] (port=51107 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lffa4-0006IB-Jn for grub-devel@gnu.org; Fri, 06 Mar 2009 14:19:36 -0500 Received: from aybabtu.com ([69.60.117.155]:59325) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lffa4-0002qr-85 for grub-devel@gnu.org; Fri, 06 Mar 2009 14:19:36 -0500 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1LffSH-0002Jo-0q for grub-devel@gnu.org; Fri, 06 Mar 2009 20:11:33 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1Lffa1-0007ZS-F9 for grub-devel@gnu.org; Fri, 06 Mar 2009 20:19:33 +0100 Date: Fri, 6 Mar 2009 20:19:33 +0100 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20090306191933.GA29098@thorin> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline 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.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] make the generic Linux loader usable on i386-pc again 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: Fri, 06 Mar 2009 19:19:37 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch makes the generic Linux loader usable on i386-pc again. It doesn't seem like it's badly needed to spend a bit of time and a bit of code in adding low memory to the heap, and Vesa's work on the new memory manager should give a proper solution to this problem. I think in the meantime we could just not allocate low mem, assuming nobody has a problem with that. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." --ZGiS0Q5IWpPtfppv Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="linux_generic.diff" 2009-03-06 Robert Millan Make loader/i386/linux.c usable on i386-pc again. * kern/i386/pc/init.c (grub_machine_init): Disable addition of low memory to heap. * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (allocate_pages): Remove `#error' stanza. Index: kern/i386/pc/init.c =================================================================== --- kern/i386/pc/init.c (revision 2019) +++ kern/i386/pc/init.c (working copy) @@ -148,10 +148,15 @@ grub_machine_init (void) grub_gate_a20 (1); #endif +/* FIXME: This prevents loader/i386/linux.c from using low memory. When our + heap implements support for requesting a chunk in low memory, this should + no longer be a problem. */ +#if 0 /* Add the lower memory into free memory. */ if (grub_lower_mem >= GRUB_MEMORY_MACHINE_RESERVED_END) add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END, grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END); +#endif auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) Index: loader/i386/linux.c =================================================================== --- loader/i386/linux.c (revision 2019) +++ loader/i386/linux.c (working copy) @@ -143,9 +143,8 @@ allocate_pages (grub_size_t prot_size) real_mode_mem = 0; prot_mode_mem = 0; -#ifdef GRUB_MACHINE_PCBIOS -#error i386-pc port adds lower memory to heap, which collides with `real_mode_mem' allocation below -#endif + /* FIXME: Should request low memory from the heap when this feature is + implemented. */ auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) --ZGiS0Q5IWpPtfppv--