From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1N4Aqx-0002P9-Mk for mharc-grub-devel@gnu.org; Sat, 31 Oct 2009 06:06:35 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4Aqw-0002OP-Et for grub-devel@gnu.org; Sat, 31 Oct 2009 06:06:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4Aqr-0002J8-JC for grub-devel@gnu.org; Sat, 31 Oct 2009 06:06:33 -0400 Received: from [199.232.76.173] (port=55416 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4Aqr-0002J1-DD for grub-devel@gnu.org; Sat, 31 Oct 2009 06:06:29 -0400 Received: from xvm-190-8.ghst.net ([217.70.190.8]:55615 helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N4Aqq-0000h0-U0 for grub-devel@gnu.org; Sat, 31 Oct 2009 06:06:29 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1N4Aqn-0004kP-3v for grub-devel@gnu.org; Sat, 31 Oct 2009 11:06:25 +0100 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1N4Aqo-0003KC-C2 for grub-devel@gnu.org; Sat, 31 Oct 2009 11:06:26 +0100 Date: Sat, 31 Oct 2009 11:06:26 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20091031100626.GA12730@thorin> References: <20091026181010.GA22942@thorin> <4AEB7207.9060009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEB7207.9060009@gmail.com> 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: GNU/Linux 2.6 (newer, 3) Subject: Re: [PATCH] turn grub-emu into a port 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, 31 Oct 2009 10:06:34 -0000 On Sat, Oct 31, 2009 at 12:08:55AM +0100, Vladimir 'phcoder' Serbinenko wrote: > Robert Millan wrote: > > This turns grub-emu into a port in order to make it easier to port GRUB to > > new CPUs. A porter can then do the CPU port without having to worry about > > firmware and/or hardware drivers initially. > > > > Patch attached. Branch is available in > > bzr+ssh://bzr.savannah.gnu.org/grub/people/robertmh/grub-emu/ > > > > > Following hunk is a regression for me: > - return (tv.tv_sec * GRUB_TICKS_PER_SECOND > - + (((tv.tv_sec % GRUB_TICKS_PER_SECOND) * 1000000 + tv.tv_usec) > - * GRUB_TICKS_PER_SECOND / 1000000)); > + GRUB_COMPILE_TIME_ASSERT (GRUB_TICKS_PER_SECOND == 1000000); > + return (tv.tv_sec * 1000000 + tv.tv_usec); > Having virtual clock going at any rate is an advantage for debugging. I don't get what you mean. When GRUB runs on a Unix system, a tick represents a 1000000th fraction of a second, and therefore GRUB_TICKS_PER_SECOND is 1000000. The old behaviour tried to emulate the behaviour of the specific hardware platform, but with grub-emu being a standalone port this doesn't make sense. I don't think we can have both things (old tick behaviour + portable grub-emu). Was that behaviour useful? It seems to me that GRUB routines don't directly care about number of ticker per second, but rather just use it as a means to archieve something else. E.g. to compare output of grub_get_rtc(). -- 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."