From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1J6q7V-0006Qb-Vx for mharc-grub-devel@gnu.org; Mon, 24 Dec 2007 11:25:38 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J6q7U-0006Q2-In for grub-devel@gnu.org; Mon, 24 Dec 2007 11:25:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J6q7P-0006Nd-KR for grub-devel@gnu.org; Mon, 24 Dec 2007 11:25:36 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J6q7P-0006NS-7n for grub-devel@gnu.org; Mon, 24 Dec 2007 11:25:31 -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 1J6q7N-0003Jz-O6 for grub-devel@gnu.org; Mon, 24 Dec 2007 11:25:30 -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 1J6q70-0004Hd-3O for grub-devel@gnu.org; Mon, 24 Dec 2007 17:25:06 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1J6q6o-0007YG-0U for grub-devel@gnu.org; Mon, 24 Dec 2007 17:24:54 +0100 Date: Mon, 24 Dec 2007 17:24:54 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20071224162453.GA28603@thorin> References: <1197915991.2541.3.camel@dv> <20071220173607.GA20508@thorin> <8763ysyoyf.fsf@xs4all.nl> <20071221180405.GA14997@thorin> <20071221205431.GA31264@thorin> <20071222121827.GA27503@thorin> <20071224130941.GB23228@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: embedding filesystems in core image (Re: moving ata initialisation to a command) 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: Mon, 24 Dec 2007 16:25:36 -0000 On Mon, Dec 24, 2007 at 09:27:05PM +0800, Bean wrote: > On Dec 24, 2007 9:09 PM, Robert Millan wrote: > > I was thinking in moving it to malloc'ed memory, which has the advantage that > > you no longer need to remember a particular region is hardcoded for memdisk > > (also, it hinders portability on platforms where top of memory is reserved). > > > > but this doesn't solve the problem about its original region being corrupted > > (by payload loaders) before we have a chance to copy it. > > In that case, you can copy the memdisk back to conventional memory, > alongside with modules. > In startup.S: > > codestart: > ... > /* copy modules before cleaning out the bss */ > movl EXT_C(grub_total_module_size), %ecx > movl EXT_C(grub_kernel_image_size), %esi > addl %ecx, %esi > > -> > movl EXT_C(grub_total_module_size), %ecx > + addl EXT_C(grub_memdisk_image_size), %ecx > movl EXT_C(grub_kernel_image_size), %esi > addl %ecx, %esi Doesn't this add a restriction on the maximum usable size, when it collides with the assorted amenities in the 640 kiB / 1024 kiB area ? > > > I also recommend to add a variable grub_memdisk_image_base in > > > startup.S, normally, this value will be zero, > > > > That's in my patch already. Or did you mean something else? > > But i only see the grub_memdisk_image_size, not the base address. Ah right; well it's still there, just not directly: + return 0x100000 + (grub_kernel_image_size - GRUB_KERNEL_MACHINE_RAW_SIZE) + grub_total_module_size; those two variables are from startup.S as well, IIRC. Although it might make sense to move them as a precalculated address. The code to compute it probably takes more kernel space than the address itself.. -- 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 /.)