From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1F6DC5-000087-9I for mharc-grub-devel@gnu.org; Mon, 06 Feb 2006 15:42:41 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F6DC3-00007q-Pw for grub-devel@gnu.org; Mon, 06 Feb 2006 15:42:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F6DC2-00007E-1f for grub-devel@gnu.org; Mon, 06 Feb 2006 15:42:39 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F6DC1-000079-PL for grub-devel@gnu.org; Mon, 06 Feb 2006 15:42:37 -0500 Received: from [194.109.24.24] (helo=smtp-vbr4.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F6DBc-0002L3-QZ for grub-devel@gnu.org; Mon, 06 Feb 2006 15:42:13 -0500 Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by smtp-vbr4.xs4all.nl (8.13.3/8.13.3) with ESMTP id k16Kd91A083437 for ; Mon, 6 Feb 2006 21:39:09 +0100 (CET) (envelope-from mgerards@xs4all.nl) Mail-Copies-To: mgerards@xs4all.nl To: grub-devel@gnu.org From: Marco Gerards Date: Mon, 06 Feb 2006 21:39:10 +0100 Message-ID: <87y80ow7bl.fsf@xs4all.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by XS4ALL Virus Scanner Subject: Idle time 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, 06 Feb 2006 20:42:40 -0000 Hi, When GRUB is idle (for example, waiting for keyboard input) it is very active with busy waiting. This has some problems and besides that, we can make good use of this time. First the problems. One GRUB user on some IRC channel I am in was complaining that GRUB on qemu consumed a lot of CPU power. He was entering GRUB commands on the GRUB console and his machine got slow. With a timeout GRUB will consume power on laptops. Perhaps it's not much, but it would be nice if we could fix this somehow. My main motivation is that it would be nice if sometimes events can be handled. For example, Okuji and Vincent were talking about the play command and how it should keep playing music in the background. My motivation to ask this is to handle network events (ARP and ICMP). Although it is not very important to handle those events, it can be nice and is efficient and easy to do. Here is some proposed function and interface: void grub_idle (int msec); When this function is called, GRUB will be idle for about MSEC milliseconds. When nothing can be sanely done with this time, some machine specific function is called instead of an idle loop. Otherwise some functions will be called that can be registered to run during idle time. But the next function will not be called it MSECS have passed. So we need some functions to register and deregister callback functions. And in input loops we have to add grub_idle. That's all and it will fix the problems above and give us a nice feature (one that should be handled with a *LOT* of care). Please let me know if you have problems with such interface. -- Marco