Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1E4aSH-0001KI-GE for mharc-grub-devel@gnu.org; Mon, 15 Aug 2005 04:36:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E4aSC-0001Gj-Lc for grub-devel@gnu.org; Mon, 15 Aug 2005 04:36:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E4aS8-0001Dy-Nr for grub-devel@gnu.org; Mon, 15 Aug 2005 04:36:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4aS7-0001Bu-BQ for grub-devel@gnu.org; Mon, 15 Aug 2005 04:36:15 -0400 Received: from [212.43.237.68] (helo=kotoba.storever.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E4abo-0005V2-Hz for grub-devel@gnu.org; Mon, 15 Aug 2005 04:46:16 -0400 Received: from ASSP-nospam (localhost [127.0.0.1]) by kotoba.storever.com (Postfix) with ESMTP id 2A72FFF96FCB for ; Mon, 15 Aug 2005 10:30:32 +0200 (CEST) Received: from 127.0.0.1 ([127.0.0.1] helo=ip6-localhost) by ASSP-nospam ; 15 Aug 05 08:30:31 -0000 From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Mon, 15 Aug 2005 10:29:21 +0200 User-Agent: KMail/1.7.2 References: <20050814222711.23047.qmail@web35315.mail.mud.yahoo.com> <200508150103.43027.okuji@enbug.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508151029.21808.okuji@enbug.org> Subject: Re: [PATCH] mmap support and x86_64 detection 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, 15 Aug 2005 08:36:23 -0000 On Monday 15 August 2005 04:29, Hollis Blanchard wrote: > Ruslan, I would ask for a different function name. Initially I was very > confused as to how/why GRUB was implementing mmap(2), but obviously > that's not really what's going on. Perhaps "grub_multiboot_get_memmap" > instead of "grub_multiboot_mmap"? Good idea. > > The detection code should not be a part of the kernel. You can do this > > only > > protected mode, right? > > (I guess you mean the grub "kern" directory. Calling it "kernel" is a > little confusing because of course GRUB loads kernels...) > > Why shouldn't it go there? Where should it go? For the first question: because we do not need this function in the kernel. We should keep the kernel minimalistic, unless we have a good reason. For the second question: for now, it can be in the multiboot loader itself. If we find another use of this function, we can move it to somewhere else later (e.g. normal/i386/pc/misc.c or loader/i386/pc/helper.c). > > I prefer implementing this with inline assembly. > > That's quite a lot of inline assembly... why not make it its own > function? Because writing assembly should be avoided whenever possible. For example, you might want to test GRUB with a different calling convention (e.g. -regparm=0). If a function is written with inline assembly, the function entry code is automatically generated by GCC, so we do not have to modify it. If a function is written in assembly, we must modify it. This is critical when we want to use the same code for the native code and the emulator (grub-emu or grub-setup). Okuji