From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KUN16-0006Fd-7D for mharc-grub-devel@gnu.org; Sat, 16 Aug 2008 10:44:32 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUN14-0006EV-L5 for grub-devel@gnu.org; Sat, 16 Aug 2008 10:44:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUN13-0006Db-UH for grub-devel@gnu.org; Sat, 16 Aug 2008 10:44:30 -0400 Received: from [199.232.76.173] (port=40542 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUN13-0006DR-K4 for grub-devel@gnu.org; Sat, 16 Aug 2008 10:44:29 -0400 Received: from spacedout.fries.net ([67.64.210.234]:41559) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KUN12-00059J-WC for grub-devel@gnu.org; Sat, 16 Aug 2008 10:44:29 -0400 Received: from SpacedOut.fries.net (david@localhost [127.0.0.1]) by SpacedOut.fries.net (8.13.8/8.13.8/Debian-3) with ESMTP id m7GEiPrP017007 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 16 Aug 2008 09:44:25 -0500 Received: (from david@localhost) by SpacedOut.fries.net (8.13.8/8.13.8/Submit) id m7GEiM4S017006 for grub-devel@gnu.org; Sat, 16 Aug 2008 09:44:22 -0500 Date: Sat, 16 Aug 2008 09:44:22 -0500 From: David Fries To: The development of GRUB 2 Message-ID: <20080816144422.GE16592@spacedout.fries.net> References: <20080812030708.GB16592@spacedout.fries.net> <20080812091037.GC381@thorin> <20080816031109.GD16592@spacedout.fries.net> <20080816123317.GE6334@thorin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080816123317.GE6334@thorin> User-Agent: Mutt/1.5.4i X-Greylist: Sender is SPF-compliant, not delayed by milter-greylist-3.0 (SpacedOut.fries.net [127.0.0.1]); Sat, 16 Aug 2008 09:44:25 -0500 (CDT) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Enable grub_cpu_idle for i386 to halt the CPU 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: Sat, 16 Aug 2008 14:44:30 -0000 On Sat, Aug 16, 2008 at 02:33:17PM +0200, Robert Millan wrote: > On Fri, Aug 15, 2008 at 10:11:09PM -0500, David Fries wrote: > > [...]. Until I have an > > application for it, I'll have to let someone else implement support > > for grub_cpu_idle. > > We have 4 ports on i386. A proper implementation of grub_cpu_idle > should work fine on all of them. When I say "proper" I mean that > 'hlt' instruction should be usable without doing strange gimmicks. Gasp, grub_biosdisk_rw calls grub_biosdisk_rw_int13_extensions which for i386/pc call prot_to_real and back. There's like 40 other calls doing this strange gimmick of going to real mode for various things. > Your patch simply works around the fact that 'hlt' is broken on 32-bit by > going back to i8086 mode in order to use it. Pavel Roskin didn't like an earlier patch of mine to add a whole 10 assembly instructions to the core.mod. This is the first time I've dealt with the uglieness of BIOS, but I don't see why anyone would trade a straight forward 6 instruction grub_cpu_idle to make use of the BIOS facilities, for reimplementing an interrupt stack and drivers to acknowledge those interrupts, when grub heavily depends on BIOS to be there and working. I believe that's what one calls platform specific. i386/pc provides the support required for hlt to work, coreboot doesn't, it's coreboot that would need interrupts setup, a different platform, a different solution, and very much independent. Maybe I should mention that hlt is already being used in real mode. Protected mode interrupts would cause that to break. -- David Fries http://fries.net/~david/ (PGP encryption key available)