From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1L6XFQ-0004Rt-1v for mharc-grub-devel@gnu.org; Sat, 29 Nov 2008 16:21:04 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6XFO-0004RZ-Qs for grub-devel@gnu.org; Sat, 29 Nov 2008 16:21:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6XFN-0004RM-KN for grub-devel@gnu.org; Sat, 29 Nov 2008 16:21:01 -0500 Received: from [199.232.76.173] (port=43934 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6XFN-0004RJ-Fu for grub-devel@gnu.org; Sat, 29 Nov 2008 16:21:01 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:47931 helo=jenni1.inet.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6XFN-0002pw-43 for grub-devel@gnu.org; Sat, 29 Nov 2008 16:21:01 -0500 Received: from [192.168.1.102] (84.248.105.254) by jenni1.inet.fi (8.5.014) id 48FC59C701DB7E65 for grub-devel@gnu.org; Sat, 29 Nov 2008 23:21:00 +0200 Message-ID: <4931B236.5040804@nic.fi> Date: Sat, 29 Nov 2008 23:20:54 +0200 From: =?ISO-8859-1?Q?Vesa_J=E4=E4skel=E4inen?= User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: The development of GRUB 2 References: <20081102181132.GA24737@thorin> <200811221842.54928.okuji@enbug.org> <20081122195457.GA7779@thorin> <200811252223.53090.okuji@enbug.org> <20081128203800.GA13026@thorin> In-Reply-To: <20081128203800.GA13026@thorin> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: Re: [RFC] Multi-terminal support (Re: [PATCH] terminal split) 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, 29 Nov 2008 21:21:03 -0000 Robert Millan wrote: > On Tue, Nov 25, 2008 at 10:23:52PM +0100, Yoshinori K. Okuji wrote: >>> I've been thinking... what if we make this generic? I.e. with an event >>> loop, then terminals can register their poll functions to it, and write >>> their stuff to a shared resource the rest of GRUB can read from. >> For inputs, this is trivial for me. But, for outputs, not simple. For example, >> although we don't support yet in GRUB 2, if we have a dumb terminal, the menu >> interface must be very different from others. > > Aside from the problem with output ones, what to you think of the event loop > idea? It can be useful exploit the parellelism in hardware initialisations. > Currently GRUB can do silly things like: > > - wait for keyboard controller in grub_keyboard_controller_read() and in > grub_keyboard_controller_write() > - move on > - wait for ATA disk in grub_atapi_read() > - move on > - wait for _user_ to stare at the menu and pick an option > - move on > > which could be avoided this way (instead of waiting, each function would > register a hook that will be repeatedly run untill it returns non-zero). Well... I think better road would be co-operative multitasking. While waiting for hardware to respond you could give time to other tasks to handle their stuff. This would also make easier to write such tasks as you do not have to think about complex event system. System you propose can get quite complex to understand and maintain.