From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1E0fZW-0000Dh-1y for mharc-grub-devel@gnu.org; Thu, 04 Aug 2005 09:15:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E0fZR-0000CX-En for grub-devel@gnu.org; Thu, 04 Aug 2005 09:15:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E0fZP-0000BH-Ea for grub-devel@gnu.org; Thu, 04 Aug 2005 09:15:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E0fYy-0008CQ-M5 for grub-devel@gnu.org; Thu, 04 Aug 2005 09:15:09 -0400 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E0f3M-0005qu-BA for grub-devel@gnu.org; Thu, 04 Aug 2005 08:42:28 -0400 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id 6B3B387EF for ; Thu, 4 Aug 2005 14:29:14 +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 20425-01 for ; Thu, 4 Aug 2005 13:38:44 +0200 (CEST) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 5FDBD89B9 for ; Thu, 4 Aug 2005 14:29:10 +0200 (CEST) Received: from localhost.localdomain (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id 190F1C045 for ; Thu, 4 Aug 2005 14:29:10 +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> <87slyi8xr7.fsf@student.han.nl> <42D587CC.7000908@yahoo.fr> From: Marco Gerards Date: Thu, 04 Aug 2005 14:29:10 +0200 In-Reply-To: <42D587CC.7000908@yahoo.fr> (Vincent Pelletier's message of "Wed, 13 Jul 2005 23:29:48 +0200") Message-ID: <87zmrxlwbt.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: Thu, 04 Aug 2005 13:15:38 -0000 Vincent Pelletier writes: Hi Vincent, Finally I had the time and energy to both proofread and test your patch. It did work for me after making some changes. > First 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 named getwh and new initial > value. > * term/i386/pc/vga.c (grub_vga_getwh): New function. > (grub_vga_term): New field named getwh and new initial value. > > Second patch : > > 2005-07-13 Vincent Pelletier > * term/sparc64/ofconsole.c (grub_ofconsole_readkey): Use > grub_ssize_t. You forgot a newline. The sparc64 directory does not exist. Hollis changes this to term/ieee1275, can you make that change? > (grub_ofconsole_cls): Don't clear screen when debug environment > variable is set, regardless of its value. Please do not check in this change. If we have to make such change, I think it should be in grub_cls (). > (grub_ofconsole_init): Use grub_ssize_t and unsigned char. > (grub_ofconsole_term): New field named getwh and new initial > value. This should be a single changelog entry. As I see it, it is one patch. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQFC1YfMFEQoKRQyjtURAtliAJ9iZKLpn48u8arpEXsgLlm5GBSFPwCcCOMX > ECZ8+QD/tK5cmdvciVRrnN8= > =EbEg > -----END PGP SIGNATURE----- > Index: include/grub/term.h > =================================================================== > RCS file: /cvsroot/grub/grub2/include/grub/term.h,v > retrieving revision 1.7 > diff -u -p -r1.7 term.h > --- include/grub/term.h 19 Feb 2005 20:56:07 -0000 1.7 > +++ include/grub/term.h 13 Jul 2005 21:19:36 -0000 > @@ -71,9 +71,9 @@ grub_term_color_state; > > /* Menu-related geometrical constants. */ > > -/* FIXME: These should be dynamically obtained from a terminal. */ > -#define GRUB_TERM_WIDTH 80 > -#define GRUB_TERM_HEIGHT 25 > +/* FIXME: Ugly way to get them form terminal. */ > +#define GRUB_TERM_WIDTH ((grub_getwh()&0xFF00)>>8) > +#define GRUB_TERM_HEIGHT (grub_getwh()&0xFF) Please use the GCS, so a space before the () and spaces surrounding the operators. > diff -rup powerpc/ieee1275/ofconsole.c sparc64/ieee1275/ofconsole.c > --- powerpc/ieee1275/ofconsole.c 2005-06-21 04:33:52.000000000 +0200 [...] > +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. */ The check is wrong, it should be: if (! (w && h)) > + { > + if (! grub_ieee1275_open ("/config", &config) && This did not work for me, I changed this to: if (! grub_ieee1275_finddevice ("/options", &config) && Does that change work for you? If it does not we have to figure out how to make it work on both the sparc and on the PPC. > + config != -1) > + { > + if (! grub_ieee1275_get_property_length (config, "screen-#columns", > + &lval) && lval != -1) > + { > + if ((val = grub_malloc (lval)) != 0) I do not like this. Just use: val = grub_malloc (...); if (! val) ... > + /* XXX: Default values from OpenBoot on my U10. */ > + if (! w) > + w = 80; > + if (! h) > + h = 34; Can you change that to 80x24, the defaults on the pegasos? It would be better to use values that are too small instead of too big. Thanks, Marco