From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1DskMa-00006Z-1C for mharc-grub-devel@gnu.org; Wed, 13 Jul 2005 12:45:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DskMP-0008WV-Cn for grub-devel@gnu.org; Wed, 13 Jul 2005 12:45:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DskMJ-0008UV-Pc for grub-devel@gnu.org; Wed, 13 Jul 2005 12:45:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DskMJ-0008TC-CG for grub-devel@gnu.org; Wed, 13 Jul 2005 12:45:19 -0400 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DskQ2-0003Zy-8Z for grub-devel@gnu.org; Wed, 13 Jul 2005 12:49:10 -0400 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id A7DCE890D for ; Wed, 13 Jul 2005 18:41:02 +0200 (CEST) Received: from mail-cn.han.nl ([145.74.66.11]) by vscan-cn.han.nl (venus.han.nl [145.74.65.6]) (amavisd-new, port 10024) with ESMTP id 09087-10 for ; Wed, 13 Jul 2005 17:47:32 +0200 (CEST) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 426CF8A54 for ; Wed, 13 Jul 2005 18:41:00 +0200 (CEST) Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 00DB8C045 for ; Wed, 13 Jul 2005 18:41:00 +0200 (CEST) Mail-Copies-To: metgerards@student.han.nl To: The development of GRUB 2 References: <42C85357.20500@yahoo.fr> <200507050105.54961.okuji@enbug.org> <87y88ltv78.fsf@student.han.nl> <200507051756.44065.okuji@enbug.org> <873bqtte1u.fsf@student.han.nl> <42D422A4.9030801@yahoo.fr> <42D4D367.3030402@yahoo.fr> From: Marco Gerards Date: Wed, 13 Jul 2005 18:41:00 +0200 In-Reply-To: <42D4D367.3030402@yahoo.fr> (Vincent Pelletier's message of "Wed, 13 Jul 2005 10:40:07 +0200") Message-ID: <87slyi8xr7.fsf@student.han.nl> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (2.2.0) at vscan-cn.han.nl Subject: Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 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: Wed, 13 Jul 2005 16:45:27 -0000 Vincent Pelletier writes: > Vincent Pelletier wrote: >> Warning : terms other than console.c & vga.c will be broken by this >> patch, as long as they don't have the function. > > It's fixed in this patch for sparc64 port (see sparc_getwh.diff, which > is a diff between term/powerpc and term/sparc64). I think the same code > can be used for ppc. Nice! I will test this on both the PPC boxes I have. > > It also contains the grub_getwh function I forgot in the previous patch. > > 2005-07-13 Vincent Pelletier > > * include/grub/term.h: (GRUB_TERM_WIDTH, GRUB_TERM_HEIGHT): > Redefined to use grub_getwh. > (struct grub_term): New field named getwh. > (grub_getwh): New exported prototype. > * kern/term.c : (grub_getwh): New function. > * term/i386/pc/console.c: (grub_console_getwh): New function. > (grub_console_term): New field and new initial value. > * term/i386/pc/vga.c: (grub_vga_getwh): New function. > (grub_vga_term): New field and new initial value. This looks fine. Please remove the `:' after the filename in case something follows between the ()'s. For grub_vga_term you did not say which member was added. > +static grub_uint16_t > +grub_ofconsole_getwh (void) > +{ > + grub_ieee1275_ihandle_t config; > + char *val; > + grub_ssize_t lval; > + static grub_uint8_t w, h; > + > + if (w && h) /* Once we have them, don't ask them again. */ > + { > + if (! grub_ieee1275_open ("/config", &config) && > + config != -1) > + { > + if (! grub_ieee1275_get_property_length (config, "screen-#columns", > + &lval) && lval != -1) > + { > + val = grub_malloc (lval); Please check for errors here. > + if (! grub_ieee1275_get_property (config, "screen-#columns", > + val, lval, 0)) > + w = (grub_uint8_t) grub_strtoul (val, val + lval, 10); > + grub_free (val); > + } > + if (! grub_ieee1275_get_property_length (config, "screen-#rows", > + &lval) && lval != -1) > + { > + val = grub_malloc (lval); Same here. > +static grub_uint16_t > +grub_console_getwh (void) > +{ > + return (80 << 8) | 25; /* FIXME: Always true ? */ > +} In mode 3 it is. Which is something we can assume, I hope. :) Thanks, Marco