From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LoK0T-00025X-GV for mharc-grub-devel@gnu.org; Mon, 30 Mar 2009 12:06:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LoK0R-00023u-70 for grub-devel@gnu.org; Mon, 30 Mar 2009 12:06:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LoK0Q-00023E-PB for grub-devel@gnu.org; Mon, 30 Mar 2009 12:06:34 -0400 Received: from [199.232.76.173] (port=56534 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LoK0Q-000233-Cz for grub-devel@gnu.org; Mon, 30 Mar 2009 12:06:34 -0400 Received: from mail.nexedi.com ([91.121.25.85]:49631 helo=nexedi.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LoK0P-0001l9-Q2 for grub-devel@gnu.org; Mon, 30 Mar 2009 12:06:34 -0400 Received: from [10.8.0.46] (unknown [10.8.0.46]) by nexedi.com (Postfix) with ESMTP id 078A13D9EF for ; Mon, 30 Mar 2009 18:06:31 +0200 (CEST) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Tue, 31 Mar 2009 01:06:25 +0900 User-Agent: KMail/1.9.10 References: <20090306195735.GA9992@thorin> <1238419927.2868.6.camel@mj> <49D0D8C8.4010801@gmail.com> In-Reply-To: <49D0D8C8.4010801@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200903310106.25852.okuji@enbug.org> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] build 32-bit Linux loader as `linux', rename legacy loader to `linux16' 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, 30 Mar 2009 16:06:35 -0000 On Monday 30 March 2009 23:35:52 phcoder wrote: > Pavel Roskin wrote: > > On Sat, 2009-03-28 at 13:53 +0100, Robert Millan wrote: > >>> Here's a patch to rename `linux' to `linux16' and build the 32-bit > >>> loader as simply `linux'. > >> > >> Committed. > > > > Just for your information. With the old loader, booting an x86_64 > > kernel in qemu emulating i386 would result in a kernel message: > > > > "This kernel requires an x86-64 CPU but only detected an i686 CPU > > Unable to boot - please use a kernel appropriate for your CPU" > > > > With the new loader, the kernel hands without showing any messages. It > > can be a kernel bug. Linux 2.6.29, current GRUB. > > I confirm. I suppose that this check and message is bypassed with 32-bit > loading mode. IMO grub2 should provide an equivlent of this check. We > already have cpuid code. Does anyone know how to determine if kernel is > i386 or amd64? I don't know any reliable way. Some candidates: - The ramdisk max value. On 32-bit, initrd may not be loaded onto over 2GB. This is hard to change in Linux, so we can expect that this will not change. On 64-bit, currently, the max is 4GB-1. It is likely that this value will not change, but who knows. - The long mode panic message. This exists only for x86_64. But the message might change some day. - Otherwise, we could probe some opcodes and see if 64-bit opcodes are used. This would be error-prone. After all, the best way might be to just ask Linux developers to add a new flag. Regards, Okuji