Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KR86D-0002tH-PC for mharc-grub-devel@gnu.org; Thu, 07 Aug 2008 12:12:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KR868-0002pC-An for grub-devel@gnu.org; Thu, 07 Aug 2008 12:12:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KR860-0002iU-6L for grub-devel@gnu.org; Thu, 07 Aug 2008 12:12:14 -0400 Received: from [199.232.76.173] (port=34237 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KR85z-0002hr-My for grub-devel@gnu.org; Thu, 07 Aug 2008 12:12:11 -0400 Received: from aybabtu.com ([69.60.117.155]:46932) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KR85z-0006Dl-FI for grub-devel@gnu.org; Thu, 07 Aug 2008 12:12:11 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KR7yP-0004L4-8I for grub-devel@gnu.org; Thu, 07 Aug 2008 18:04:21 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1KR84p-0006qY-PB for grub-devel@gnu.org; Thu, 07 Aug 2008 18:10:59 +0200 Date: Thu, 7 Aug 2008 18:10:59 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080807161059.GB14153@thorin> References: <489B159A.2000106@t-online.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <489B159A.2000106@t-online.de> 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: [PATCH] Fix infinite loop in grub_pit_wait() 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: Thu, 07 Aug 2008 16:12:21 -0000 On Thu, Aug 07, 2008 at 05:32:42PM +0200, Christian Franke wrote: > grub2 from current SVN hangs if run in VirtualPC, the problem was > introduced with 'svn diff -r 1779:1780'. I'm not familiar with this part of the PIT interface; why does it hang only on VirtualPC? > void > grub_pit_wait (grub_uint16_t tics) > { > + /* Disable timer2 gate and speaker. */ > + grub_outb (grub_inb (TIMER2_REG_LATCH) & ~ (TIMER2_SPEAKER | TIMER2_GATE), TIMER2_REG_LATCH); > + > + /* Set tics. */ > grub_outb (TIMER2_SELECT | TIMER_ENABLE_LSB | TIMER_ENABLE_MSB, TIMER_REG_COMMAND); > grub_outb (tics & 0xff, TIMER2_REG_CONTROL); > grub_outb (tics >> 8, TIMER2_REG_CONTROL); > > + /* Enable timer2 gate, keep speaker disabled. */ > + grub_outb ((grub_inb (TIMER2_REG_LATCH) & ~ TIMER2_SPEAKER) | TIMER2_GATE, TIMER2_REG_LATCH); > + > + /* Wait. */ > while ((grub_inb (TIMER2_REG_LATCH) & TIMER2_LATCH) == 0x00); > + > + /* Disable timer2 gate and speaker. */ > + grub_outb (grub_inb (TIMER2_REG_LATCH) & ~ (TIMER2_SPEAKER | TIMER2_GATE), TIMER2_REG_LATCH); > } This doesn't AFAICT preserve the existing value of the timer2 gate and speaker. I assume that is ok? Thanks! -- 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."