* FIXME: These should be dynamically obtained from a terminal. @ 2005-07-03 21:06 Vincent Pelletier 2005-07-03 21:16 ` [Bulk] " Vincent Pelletier 2005-07-04 23:05 ` Yoshinori K. Okuji 0 siblings, 2 replies; 14+ messages in thread From: Vincent Pelletier @ 2005-07-03 21:06 UTC (permalink / raw) To: Grub-devel -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to fix that thing. I'm only working on the i386 part, because I have no ppc. Here is how I plan to do it (almost done, but I have some questions) : - -add an asm function to get the current vga mode without changing it (or maybe a global var to keep the current vga mode) - -add a field in struct grub_term - -implement this function in different terminal handlers - -implement grub_getwh - -redefine GRUB_TERM_WIDTH & GRUB_TERM_HEIGHT macros to use grub_getwh Here are my questions : Should we foresee, in vga mode, that the user might someday choose his vga mode ? Should we redefine all the macros we use to draw the menu to be less intensive on grub_getwh ? In the attached patch, the vga function is disabled, because for now the asm function does not work (returns always 0). As I'm really not familiar with x86 asm, I think I had something wrong adapting from grub_vga_set_mode. nb: I only give the patch as draft, a preview of what I'm working on. Vincent Pelletier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCyFNXFEQoKRQyjtURAtHIAKCDMtJhev1Z0mXvFm2Rg8p49rk4aQCgl2UR C3TbKukpU4T4dHFIjyTv6hI= =wg2h -----END PGP SIGNATURE----- ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Bulk] FIXME: These should be dynamically obtained from a terminal. 2005-07-03 21:06 FIXME: These should be dynamically obtained from a terminal Vincent Pelletier @ 2005-07-03 21:16 ` Vincent Pelletier 2005-07-04 23:05 ` Yoshinori K. Okuji 1 sibling, 0 replies; 14+ messages in thread From: Vincent Pelletier @ 2005-07-03 21:16 UTC (permalink / raw) To: The development of GRUB 2 [-- Attachment #1: Type: text/plain, Size: 322 bytes --] -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Vincent Pelletier wrote: > In the attached patch, *cough* *cough* Vincent Pelletier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCyFXJFEQoKRQyjtURAjFRAKCyEeBiF6HDVeeFajmy8oGfVWIrvQCfUiCG hX6z+XtVX9llG10YKEi6t7A= =tmOI -----END PGP SIGNATURE----- [-- Attachment #2: getwh.diff --] [-- Type: text/plain, Size: 6478 bytes --] 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 3 Jul 2005 20:34:40 -0000 @@ -72,8 +72,10 @@ 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 +/*#define GRUB_TERM_WIDTH 80 +#define GRUB_TERM_HEIGHT 25*/ +#define GRUB_TERM_WIDTH ((grub_getwh()&0xFF00)>>8) +#define GRUB_TERM_HEIGHT (grub_getwh()&0xFF) /* The number of lines of "GRUB version..." at the top. */ #define GRUB_TERM_INFO_HEIGHT 1 @@ -142,6 +144,9 @@ struct grub_term /* Get a character. */ int (*getkey) (void); + /* Get the screen size. The return value is ((Width << 8) | Height). */ + grub_uint16_t (*getwh) (void); + /* Get the cursor position. The return value is ((X << 8) | Y). */ grub_uint16_t (*getxy) (void); @@ -183,6 +188,7 @@ void EXPORT_FUNC(grub_putchar) (int c); void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); int EXPORT_FUNC(grub_getkey) (void); int EXPORT_FUNC(grub_checkkey) (void); +grub_uint16_t EXPORT_FUNC(grub_getwh) (void); grub_uint16_t EXPORT_FUNC(grub_getxy) (void); void EXPORT_FUNC(grub_gotoxy) (grub_uint8_t x, grub_uint8_t y); void EXPORT_FUNC(grub_cls) (void); Index: include/grub/i386/pc/vga.h =================================================================== RCS file: /cvsroot/grub/grub2/include/grub/i386/pc/vga.h,v retrieving revision 1.3 diff -u -p -r1.3 vga.h --- include/grub/i386/pc/vga.h 4 Apr 2004 13:46:01 -0000 1.3 +++ include/grub/i386/pc/vga.h 3 Jul 2005 20:34:40 -0000 @@ -25,6 +25,9 @@ /* Set the video mode to MODE and return the previous mode. */ unsigned char EXPORT_FUNC(grub_vga_set_mode) (unsigned char mode); +/* Return the current video mode. */ +unsigned char EXPORT_FUNC(grub_vga_get_mode) (void); + /* Return a pointer to the ROM font table. */ unsigned char *EXPORT_FUNC(grub_vga_get_font) (void); Index: kern/term.c =================================================================== RCS file: /cvsroot/grub/grub2/kern/term.c,v retrieving revision 1.7 diff -u -p -r1.7 term.c --- kern/term.c 4 Apr 2004 13:46:02 -0000 1.7 +++ kern/term.c 3 Jul 2005 20:34:44 -0000 @@ -213,6 +213,12 @@ grub_checkkey (void) } grub_uint16_t +grub_getwh (void) +{ + return (grub_cur_term->getwh) (); +} + +grub_uint16_t grub_getxy (void) { return (grub_cur_term->getxy) (); Index: kern/i386/pc/startup.S =================================================================== RCS file: /cvsroot/grub/grub2/kern/i386/pc/startup.S,v retrieving revision 1.13 diff -u -p -r1.13 startup.S --- kern/i386/pc/startup.S 4 Apr 2004 13:46:02 -0000 1.13 +++ kern/i386/pc/startup.S 3 Jul 2005 20:34:44 -0000 @@ -1570,6 +1570,28 @@ FUNCTION(grub_vga_set_mode) /* + * unsigned char grub_vga_get_mode (void) + */ +FUNCTION(grub_vga_get_mode) + pushl %ebp + pushl %ebx + + call prot_to_real + .code16 + /* get current mode */ + xorw %bx, %bx + movb $0x0f, %ah + int $0x10 + + DATA32 call real_to_prot + .code32 + + popl %ebx + popl %ebp + ret + + +/* * unsigned char *grub_vga_get_font (void) */ FUNCTION(grub_vga_get_font) Index: term/i386/pc/console.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/console.c,v retrieving revision 1.5 diff -u -p -r1.5 console.c --- term/i386/pc/console.c 15 Feb 2005 00:07:01 -0000 1.5 +++ term/i386/pc/console.c 3 Jul 2005 20:34:45 -0000 @@ -20,6 +20,7 @@ #include <grub/machine/console.h> #include <grub/term.h> #include <grub/types.h> +#include <grub/misc.h> grub_uint8_t grub_console_cur_color = 0x7; static grub_uint8_t grub_console_standard_color = 0x7; @@ -74,6 +75,12 @@ grub_console_putchar (grub_uint32_t c) grub_console_real_putchar (c); } +static grub_uint16_t +grub_console_getwh (void) +{ + return (80 << 8) | 25; /* FIXME: Always true ? */ +} + static void grub_console_setcolorstate (grub_term_color_state state) { @@ -107,6 +114,7 @@ static struct grub_term grub_console_ter .putchar = grub_console_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_console_getwh, .getxy = grub_console_getxy, .gotoxy = grub_console_gotoxy, .cls = grub_console_cls, Index: term/i386/pc/vga.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/vga.c,v retrieving revision 1.7 diff -u -p -r1.7 vga.c --- term/i386/pc/vga.c 2 Mar 2005 20:12:46 -0000 1.7 +++ term/i386/pc/vga.c 3 Jul 2005 20:34:46 -0000 @@ -473,6 +473,59 @@ grub_vga_putchar (grub_uint32_t c) } static grub_uint16_t +grub_vga_getwh (void) +{ + return (TEXT_WIDTH << 8) | TEXT_HEIGHT; +#if 0 + static grub_uint16_t res; + unsigned char mode; + if (res) + return res; + /* FIXME : Assumed char size : w=8 h=16. */ + switch (mode = grub_vga_get_mode () ) + { + case 0: /* text, 40x25 */ + case 1: + res = (40 << 8) | 25; + break; + case 2: /* text, 80x25 */ + case 3: + res = (80 << 8) | 25; + break; + case 8: /* graph, 160x200 */ + res = (20 << 8) | 12; + break; + case 4: /* graph, 320x200 */ + case 5: + case 9: + case 0xD: + case 0x13: + res = (40 << 8) | 12; + break; + case 6: /* graph, 640x200 */ + case 0xA: + case 0xE: + res = (80 << 8) | 12; + break; + case 0xF: /* graph, 640x350 */ + case 0x10: + res = (80 << 8) | 21; + break; + case 0x11: /* graph, 640x480 */ + case 0x12: + res = (80 << 8) | 21; + break; + default: /* XXX: dumb values */ + res = (10 << 8) | 10; + break; + } + grub_dprintf("terminal","Mode=%d, Val=0x%x, w=%d, h=%d",mode,res,(res&0xFF00)>>8,res&0xFF); + while(1); + return res; +#endif +} + +static grub_uint16_t grub_vga_getxy (void) { return ((xpos << 8) | ypos); @@ -566,6 +619,7 @@ static struct grub_term grub_vga_term = .putchar = grub_vga_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_vga_getwh, .getxy = grub_vga_getxy, .gotoxy = grub_vga_gotoxy, .cls = grub_vga_cls, ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: FIXME: These should be dynamically obtained from a terminal. 2005-07-03 21:06 FIXME: These should be dynamically obtained from a terminal Vincent Pelletier 2005-07-03 21:16 ` [Bulk] " Vincent Pelletier @ 2005-07-04 23:05 ` Yoshinori K. Okuji 2005-07-04 23:19 ` Vincent Pelletier 2005-07-05 10:15 ` Marco Gerards 1 sibling, 2 replies; 14+ messages in thread From: Yoshinori K. Okuji @ 2005-07-04 23:05 UTC (permalink / raw) To: The development of GRUB 2 On Sunday 03 July 2005 23:06, Vincent Pelletier wrote: > -add an asm function to get the current vga mode without changing it (or > maybe a global var to keep the current vga mode) Probably it is better to keep the current mode in a variable. It is not funny to go back to real mode every time. > -add a field in struct grub_term > -implement this function in different terminal handlers > -implement grub_getwh > -redefine GRUB_TERM_WIDTH & GRUB_TERM_HEIGHT macros to use grub_getwh Sound good. > Here are my questions : > Should we foresee, in vga mode, that the user might someday choose his > vga mode ? No. Since the BIOS does not provide the geometry for each VGA mode, we must maintain a table in that case. And, the table differs among video cards. So I do not want to allow the user to change it to an arbitrary mode. What we really need is to support VESA. The screen of the VGA mode is too small to do fancy stuff. > Should we redefine all the macros we use to draw the menu to be less > intensive on grub_getwh ? We need to call grub_getwh only once. Possibly in grub_menu_init_page. > In the attached patch, the vga function is disabled, because for now the > asm function does not work (returns always 0). As I'm really not > familiar with x86 asm, I think I had something wrong adapting from > grub_vga_set_mode. As the VGA mode is hardcoded, you can hardcode the geometry in vga.c as well. BTW, is the VGA terminal working well? Since Marco changed the mode to 0x10 from 0x12, the screen is a bit smaller than before, and I'm not sure if the menu entry editor works with this. Okuji ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: FIXME: These should be dynamically obtained from a terminal. 2005-07-04 23:05 ` Yoshinori K. Okuji @ 2005-07-04 23:19 ` Vincent Pelletier 2005-07-05 10:15 ` Marco Gerards 1 sibling, 0 replies; 14+ messages in thread From: Vincent Pelletier @ 2005-07-04 23:19 UTC (permalink / raw) To: The development of GRUB 2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yoshinori K. Okuji wrote: > We need to call grub_getwh only once. Possibly in grub_menu_init_page. So we have to redesign the way sizes are computed to use something else than macros. > BTW, is the VGA terminal working well? Since Marco changed the mode to 0x10 > from 0x12, the screen is a bit smaller than before, and I'm not sure if the > menu entry editor works with this. It wasn't working, and that's why I started studying the getwh idea :) . There is one line missing at the bottom of the screen, so when it's initialy drawn (frame + comments) it scrolls up one line. Then, when entries are drawn, they are drawn at the right absolute place, so one line below the top of the menu. Maybe see you tomorr^Wtoday at the LSM :). Vincent Pelletier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCycP7FEQoKRQyjtURAvB6AJwMZ1ppB3e+sVxF0o2933WjFunNvgCfcaj0 ZpJw03aghGX1VP4v81oLvkc= =7FD8 -----END PGP SIGNATURE----- ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: FIXME: These should be dynamically obtained from a terminal. 2005-07-04 23:05 ` Yoshinori K. Okuji 2005-07-04 23:19 ` Vincent Pelletier @ 2005-07-05 10:15 ` Marco Gerards 2005-07-05 15:56 ` Yoshinori K. Okuji 1 sibling, 1 reply; 14+ messages in thread From: Marco Gerards @ 2005-07-05 10:15 UTC (permalink / raw) To: The development of GRUB 2 "Yoshinori K. Okuji" <okuji@enbug.org> writes: > No. Since the BIOS does not provide the geometry for each VGA mode, we must > maintain a table in that case. And, the table differs among video cards. So I > do not want to allow the user to change it to an arbitrary mode. > > What we really need is to support VESA. The screen of the VGA mode is too > small to do fancy stuff. For VGA the first modes are all the same, so we can use a fixed table. For VESA modes we can get the width and height. But that should be done when setting the mode. > BTW, is the VGA terminal working well? Since Marco changed the mode to 0x10 > from 0x12, the screen is a bit smaller than before, and I'm not sure if the > menu entry editor works with this. The menu should support all kinds of screen sizes anyway. For example on the PPC the text screen is really big. -- Marco ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: FIXME: These should be dynamically obtained from a terminal. 2005-07-05 10:15 ` Marco Gerards @ 2005-07-05 15:56 ` Yoshinori K. Okuji 2005-07-05 16:26 ` Marco Gerards 0 siblings, 1 reply; 14+ messages in thread From: Yoshinori K. Okuji @ 2005-07-05 15:56 UTC (permalink / raw) To: The development of GRUB 2 On Tuesday 05 July 2005 12:15, Marco Gerards wrote: > The menu should support all kinds of screen sizes anyway. For example on > the PPC the text screen is really big. I think there are 2 different issues in a high resolution: - How to adapt the menu without making it too ugly - How to use bigger fonts When I use yaboot on my iBook, I always feel that the font is too small. It is almost unreadable. So there must be a way to increase the font size. Okuji ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: FIXME: These should be dynamically obtained from a terminal. 2005-07-05 15:56 ` Yoshinori K. Okuji @ 2005-07-05 16:26 ` Marco Gerards 2005-07-12 20:05 ` [PATCH] " Vincent Pelletier 0 siblings, 1 reply; 14+ messages in thread From: Marco Gerards @ 2005-07-05 16:26 UTC (permalink / raw) To: The development of GRUB 2 "Yoshinori K. Okuji" <okuji@enbug.org> writes: > On Tuesday 05 July 2005 12:15, Marco Gerards wrote: >> The menu should support all kinds of screen sizes anyway. For example on >> the PPC the text screen is really big. > > I think there are 2 different issues in a high resolution: > > - How to adapt the menu without making it too ugly > > - How to use bigger fonts > > When I use yaboot on my iBook, I always feel that the font is too small. It is > almost unreadable. So there must be a way to increase the font size. Yes, I agree. It is very small. It should be possible to increase it. If I have the time I will write framebuffer support for GRUB 2 on the PPC. But my todo list is big already so I do not know when. I hope someone else is interested in doing this. :) Thanks, Marco ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] FIXME: These should be dynamically obtained from a terminal. 2005-07-05 16:26 ` Marco Gerards @ 2005-07-12 20:05 ` Vincent Pelletier 2005-07-13 8:40 ` [PATCHv2] " Vincent Pelletier 0 siblings, 1 reply; 14+ messages in thread From: Vincent Pelletier @ 2005-07-12 20:05 UTC (permalink / raw) To: The development of GRUB 2 [-- Attachment #1: Type: text/plain, Size: 873 bytes --] -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Here is a patch that adds grub_getwh functions. Warning : terms other than console.c & vga.c will be broken by this patch, as long as they don't have the function. 2005-07-12 Vincent Pelletier <subdino2004@yahoo.fr> * 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. * 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. Vincent Pelletier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC1CKkFEQoKRQyjtURAhQOAJ9kxitoVirko0thecc0gpAzguTyvgCcDyuS VE/VAYMisJ+VwyzyOLjhT5Y= =Yygw -----END PGP SIGNATURE----- [-- Attachment #2: getwh2.diff --] [-- Type: text/plain, Size: 3205 bytes --] 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 12 Jul 2005 19:55:33 -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) /* The number of lines of "GRUB version..." at the top. */ #define GRUB_TERM_INFO_HEIGHT 1 @@ -142,6 +142,9 @@ struct grub_term /* Get a character. */ int (*getkey) (void); + /* Get the screen size. The return value is ((Width << 8) | Height). */ + grub_uint16_t (*getwh) (void); + /* Get the cursor position. The return value is ((X << 8) | Y). */ grub_uint16_t (*getxy) (void); @@ -183,6 +186,7 @@ void EXPORT_FUNC(grub_putchar) (int c); void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); int EXPORT_FUNC(grub_getkey) (void); int EXPORT_FUNC(grub_checkkey) (void); +grub_uint16_t EXPORT_FUNC(grub_getwh) (void); grub_uint16_t EXPORT_FUNC(grub_getxy) (void); void EXPORT_FUNC(grub_gotoxy) (grub_uint8_t x, grub_uint8_t y); void EXPORT_FUNC(grub_cls) (void); Index: term/i386/pc/console.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/console.c,v retrieving revision 1.5 diff -u -p -r1.5 console.c --- term/i386/pc/console.c 15 Feb 2005 00:07:01 -0000 1.5 +++ term/i386/pc/console.c 12 Jul 2005 19:55:33 -0000 @@ -74,6 +74,12 @@ grub_console_putchar (grub_uint32_t c) grub_console_real_putchar (c); } +static grub_uint16_t +grub_console_getwh (void) +{ + return (80 << 8) | 25; /* FIXME: Always true ? */ +} + static void grub_console_setcolorstate (grub_term_color_state state) { @@ -107,6 +113,7 @@ static struct grub_term grub_console_ter .putchar = grub_console_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_console_getwh, .getxy = grub_console_getxy, .gotoxy = grub_console_gotoxy, .cls = grub_console_cls, Index: term/i386/pc/vga.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/vga.c,v retrieving revision 1.7 diff -u -p -r1.7 vga.c --- term/i386/pc/vga.c 2 Mar 2005 20:12:46 -0000 1.7 +++ term/i386/pc/vga.c 12 Jul 2005 19:55:34 -0000 @@ -473,6 +473,12 @@ grub_vga_putchar (grub_uint32_t c) } static grub_uint16_t +grub_vga_getwh (void) +{ + return (TEXT_WIDTH << 8) | TEXT_HEIGHT; +} + +static grub_uint16_t grub_vga_getxy (void) { return ((xpos << 8) | ypos); @@ -566,6 +572,7 @@ static struct grub_term grub_vga_term = .putchar = grub_vga_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_vga_getwh, .getxy = grub_vga_getxy, .gotoxy = grub_vga_gotoxy, .cls = grub_vga_cls, ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 2005-07-12 20:05 ` [PATCH] " Vincent Pelletier @ 2005-07-13 8:40 ` Vincent Pelletier 2005-07-13 16:41 ` Marco Gerards 0 siblings, 1 reply; 14+ messages in thread From: Vincent Pelletier @ 2005-07-13 8:40 UTC (permalink / raw) To: The development of GRUB 2 [-- Attachment #1: Type: text/plain, Size: 1138 bytes --] -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. It also contains the grub_getwh function I forgot in the previous patch. 2005-07-13 Vincent Pelletier <subdino2004@yahoo.fr> * 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. Vincent Pelletier -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC1NNnFEQoKRQyjtURAtibAJoDv9ya6nHL1JHkyIxLfWOeC8paaQCfcO9K fRM2BWoPzNOCr2NMZ+P3z9I= =g1su -----END PGP SIGNATURE----- [-- Attachment #2: sparc_getwh.diff --] [-- Type: text/plain, Size: 2779 bytes --] diff -rupN powerpc/ieee1275/ofconsole.c sparc64/ieee1275/ofconsole.c --- powerpc/ieee1275/ofconsole.c 2005-06-21 04:33:52.000000000 +0200 +++ sparc64/ieee1275/ofconsole.c 2005-07-13 10:18:46.000000000 +0200 @@ -120,7 +120,7 @@ static int grub_ofconsole_readkey (int *key) { char c; - int actual = 0; + grub_ssize_t actual = 0; grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); @@ -207,6 +207,49 @@ grub_ofconsole_getxy (void) return ((grub_curr_x - 1) << 8) | grub_curr_y; } +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); + 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); + if (! grub_ieee1275_get_property (config, "screen-#rows", + val, lval, 0)) + h = (grub_uint8_t) grub_strtoul (val, val + lval, 10); + grub_free (val); + } + } + } + + /* XXX: Default values from OpenBoot on my U10. */ + if (! w) + w = 80; + if (! h) + h = 34; + + return (w << 8) | h; +} + static void grub_ofconsole_gotoxy (grub_uint8_t x, grub_uint8_t y) { @@ -222,6 +265,8 @@ static void grub_ofconsole_cls (void) { /* Clear the screen. */ + if (grub_env_get ("nocls")) + return; grub_ofconsole_writeesc ("\e[2J"); grub_gotoxy (0, 0); } @@ -241,8 +286,8 @@ grub_ofconsole_refresh (void) static grub_err_t grub_ofconsole_init (void) { - char data[4]; - grub_size_t actual; + unsigned char data[4]; + grub_ssize_t actual; int col; if (grub_ieee1275_get_property (grub_ieee1275_chosen, "stdout", data, @@ -287,6 +332,7 @@ static struct grub_term grub_ofconsole_t .checkkey = grub_ofconsole_checkkey, .getkey = grub_ofconsole_getkey, .getxy = grub_ofconsole_getxy, + .getwh = grub_ofconsole_getwh, .gotoxy = grub_ofconsole_gotoxy, .cls = grub_ofconsole_cls, .setcolorstate = grub_ofconsole_setcolorstate, [-- Attachment #3: getwh2.diff --] [-- Type: text/plain, Size: 3688 bytes --] 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 12 Jul 2005 19:55:33 -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) /* The number of lines of "GRUB version..." at the top. */ #define GRUB_TERM_INFO_HEIGHT 1 @@ -142,6 +142,9 @@ struct grub_term /* Get a character. */ int (*getkey) (void); + /* Get the screen size. The return value is ((Width << 8) | Height). */ + grub_uint16_t (*getwh) (void); + /* Get the cursor position. The return value is ((X << 8) | Y). */ grub_uint16_t (*getxy) (void); @@ -183,6 +186,7 @@ void EXPORT_FUNC(grub_putchar) (int c); void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); int EXPORT_FUNC(grub_getkey) (void); int EXPORT_FUNC(grub_checkkey) (void); +grub_uint16_t EXPORT_FUNC(grub_getwh) (void); grub_uint16_t EXPORT_FUNC(grub_getxy) (void); void EXPORT_FUNC(grub_gotoxy) (grub_uint8_t x, grub_uint8_t y); void EXPORT_FUNC(grub_cls) (void); Index: kern/term.c =================================================================== RCS file: /cvsroot/grub/grub2/kern/term.c,v retrieving revision 1.7 diff -u -p -r1.7 term.c --- kern/term.c 4 Apr 2004 13:46:02 -0000 1.7 +++ kern/term.c 13 Jul 2005 08:27:22 -0000 @@ -218,6 +218,12 @@ grub_getxy (void) return (grub_cur_term->getxy) (); } +grub_uint16_t +grub_getwh (void) +{ + return (grub_cur_term->getwh) (); +} + void grub_gotoxy (grub_uint8_t x, grub_uint8_t y) { Index: term/i386/pc/console.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/console.c,v retrieving revision 1.5 diff -u -p -r1.5 console.c --- term/i386/pc/console.c 15 Feb 2005 00:07:01 -0000 1.5 +++ term/i386/pc/console.c 13 Jul 2005 08:27:22 -0000 @@ -74,6 +74,12 @@ grub_console_putchar (grub_uint32_t c) grub_console_real_putchar (c); } +static grub_uint16_t +grub_console_getwh (void) +{ + return (80 << 8) | 25; /* FIXME: Always true ? */ +} + static void grub_console_setcolorstate (grub_term_color_state state) { @@ -107,6 +113,7 @@ static struct grub_term grub_console_ter .putchar = grub_console_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_console_getwh, .getxy = grub_console_getxy, .gotoxy = grub_console_gotoxy, .cls = grub_console_cls, Index: term/i386/pc/vga.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/vga.c,v retrieving revision 1.7 diff -u -p -r1.7 vga.c --- term/i386/pc/vga.c 2 Mar 2005 20:12:46 -0000 1.7 +++ term/i386/pc/vga.c 13 Jul 2005 08:27:22 -0000 @@ -473,6 +473,12 @@ grub_vga_putchar (grub_uint32_t c) } static grub_uint16_t +grub_vga_getwh (void) +{ + return (TEXT_WIDTH << 8) | TEXT_HEIGHT; +} + +static grub_uint16_t grub_vga_getxy (void) { return ((xpos << 8) | ypos); @@ -566,6 +572,7 @@ static struct grub_term grub_vga_term = .putchar = grub_vga_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_vga_getwh, .getxy = grub_vga_getxy, .gotoxy = grub_vga_gotoxy, .cls = grub_vga_cls, ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 2005-07-13 8:40 ` [PATCHv2] " Vincent Pelletier @ 2005-07-13 16:41 ` Marco Gerards 2005-07-13 21:29 ` Vincent Pelletier 0 siblings, 1 reply; 14+ messages in thread From: Marco Gerards @ 2005-07-13 16:41 UTC (permalink / raw) To: The development of GRUB 2 Vincent Pelletier <subdino2004@yahoo.fr> 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 <subdino2004@yahoo.fr> > > * 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 2005-07-13 16:41 ` Marco Gerards @ 2005-07-13 21:29 ` Vincent Pelletier 2005-08-04 12:29 ` Marco Gerards 0 siblings, 1 reply; 14+ messages in thread From: Vincent Pelletier @ 2005-07-13 21:29 UTC (permalink / raw) To: The development of GRUB 2 [-- Attachment #1: Type: text/plain, Size: 1822 bytes --] -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Marco Gerards wrote: > Nice! I will test this on both the PPC boxes I have. I hope it works too. I haven't see any variable naming standard in the ieee1275 docs, so I'm afraid it won't find the variables. > 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. Oops. Fixed below. > Please check for errors here. [...] > Same here. Done. I thought I checked all the possible errors though :'( . And I forgot those simple ones. > In mode 3 it is. Which is something we can assume, I hope. :) Removed the comment. First patch : 2005-07-13 Vincent Pelletier <subdino2004@yahoo.fr> * 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 <subdino2004@yahoo.fr> * term/sparc64/ofconsole.c (grub_ofconsole_readkey): Use grub_ssize_t. (grub_ofconsole_getw): New function. (grub_ofconsole_cls): Don't clear screen when debug environment variable is set, regardless of its value. (grub_ofconsole_init): Use grub_ssize_t and unsigned char. (grub_ofconsole_term): New field named getwh and new initial value. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFC1YfMFEQoKRQyjtURAtliAJ9iZKLpn48u8arpEXsgLlm5GBSFPwCcCOMX ECZ8+QD/tK5cmdvciVRrnN8= =EbEg -----END PGP SIGNATURE----- [-- Attachment #2: getwh3.diff --] [-- Type: text/plain, Size: 3660 bytes --] 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) /* The number of lines of "GRUB version..." at the top. */ #define GRUB_TERM_INFO_HEIGHT 1 @@ -142,6 +142,9 @@ struct grub_term /* Get a character. */ int (*getkey) (void); + /* Get the screen size. The return value is ((Width << 8) | Height). */ + grub_uint16_t (*getwh) (void); + /* Get the cursor position. The return value is ((X << 8) | Y). */ grub_uint16_t (*getxy) (void); @@ -183,6 +186,7 @@ void EXPORT_FUNC(grub_putchar) (int c); void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); int EXPORT_FUNC(grub_getkey) (void); int EXPORT_FUNC(grub_checkkey) (void); +grub_uint16_t EXPORT_FUNC(grub_getwh) (void); grub_uint16_t EXPORT_FUNC(grub_getxy) (void); void EXPORT_FUNC(grub_gotoxy) (grub_uint8_t x, grub_uint8_t y); void EXPORT_FUNC(grub_cls) (void); Index: kern/term.c =================================================================== RCS file: /cvsroot/grub/grub2/kern/term.c,v retrieving revision 1.7 diff -u -p -r1.7 term.c --- kern/term.c 4 Apr 2004 13:46:02 -0000 1.7 +++ kern/term.c 13 Jul 2005 21:19:37 -0000 @@ -218,6 +218,12 @@ grub_getxy (void) return (grub_cur_term->getxy) (); } +grub_uint16_t +grub_getwh (void) +{ + return (grub_cur_term->getwh) (); +} + void grub_gotoxy (grub_uint8_t x, grub_uint8_t y) { Index: term/i386/pc/console.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/console.c,v retrieving revision 1.5 diff -u -p -r1.5 console.c --- term/i386/pc/console.c 15 Feb 2005 00:07:01 -0000 1.5 +++ term/i386/pc/console.c 13 Jul 2005 21:19:37 -0000 @@ -74,6 +74,12 @@ grub_console_putchar (grub_uint32_t c) grub_console_real_putchar (c); } +static grub_uint16_t +grub_console_getwh (void) +{ + return (80 << 8) | 25; +} + static void grub_console_setcolorstate (grub_term_color_state state) { @@ -107,6 +113,7 @@ static struct grub_term grub_console_ter .putchar = grub_console_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_console_getwh, .getxy = grub_console_getxy, .gotoxy = grub_console_gotoxy, .cls = grub_console_cls, Index: term/i386/pc/vga.c =================================================================== RCS file: /cvsroot/grub/grub2/term/i386/pc/vga.c,v retrieving revision 1.7 diff -u -p -r1.7 vga.c --- term/i386/pc/vga.c 2 Mar 2005 20:12:46 -0000 1.7 +++ term/i386/pc/vga.c 13 Jul 2005 21:19:38 -0000 @@ -473,6 +473,12 @@ grub_vga_putchar (grub_uint32_t c) } static grub_uint16_t +grub_vga_getwh (void) +{ + return (TEXT_WIDTH << 8) | TEXT_HEIGHT; +} + +static grub_uint16_t grub_vga_getxy (void) { return ((xpos << 8) | ypos); @@ -566,6 +572,7 @@ static struct grub_term grub_vga_term = .putchar = grub_vga_putchar, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getwh = grub_vga_getwh, .getxy = grub_vga_getxy, .gotoxy = grub_vga_gotoxy, .cls = grub_vga_cls, [-- Attachment #3: sparc_getwh2.diff --] [-- Type: text/plain, Size: 2912 bytes --] diff -rup powerpc/ieee1275/ofconsole.c sparc64/ieee1275/ofconsole.c --- powerpc/ieee1275/ofconsole.c 2005-06-21 04:33:52.000000000 +0200 +++ sparc64/ieee1275/ofconsole.c 2005-07-13 23:25:39.000000000 +0200 @@ -120,7 +120,7 @@ static int grub_ofconsole_readkey (int *key) { char c; - int actual = 0; + grub_ssize_t actual = 0; grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); @@ -207,6 +207,53 @@ grub_ofconsole_getxy (void) return ((grub_curr_x - 1) << 8) | grub_curr_y; } +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) + { + if ((val = grub_malloc (lval)) != 0) + { + 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) + { + if ((val = grub_malloc (lval)) != 0) + { + if (! grub_ieee1275_get_property (config, "screen-#rows", + val, lval, 0)) + h = (grub_uint8_t) grub_strtoul (val, val + lval, 10); + grub_free (val); + } + } + } + } + + /* XXX: Default values from OpenBoot on my U10. */ + if (! w) + w = 80; + if (! h) + h = 34; + + return (w << 8) | h; +} + static void grub_ofconsole_gotoxy (grub_uint8_t x, grub_uint8_t y) { @@ -222,6 +269,8 @@ static void grub_ofconsole_cls (void) { /* Clear the screen. */ + if (grub_env_get ("debug")) + return; grub_ofconsole_writeesc ("\e[2J"); grub_gotoxy (0, 0); } @@ -241,8 +290,8 @@ grub_ofconsole_refresh (void) static grub_err_t grub_ofconsole_init (void) { - char data[4]; - grub_size_t actual; + unsigned char data[4]; + grub_ssize_t actual; int col; if (grub_ieee1275_get_property (grub_ieee1275_chosen, "stdout", data, @@ -287,6 +336,7 @@ static struct grub_term grub_ofconsole_t .checkkey = grub_ofconsole_checkkey, .getkey = grub_ofconsole_getkey, .getxy = grub_ofconsole_getxy, + .getwh = grub_ofconsole_getwh, .gotoxy = grub_ofconsole_gotoxy, .cls = grub_ofconsole_cls, .setcolorstate = grub_ofconsole_setcolorstate, ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 2005-07-13 21:29 ` Vincent Pelletier @ 2005-08-04 12:29 ` Marco Gerards 2005-08-04 18:13 ` Marco Gerards 0 siblings, 1 reply; 14+ messages in thread From: Marco Gerards @ 2005-08-04 12:29 UTC (permalink / raw) To: The development of GRUB 2 Vincent Pelletier <subdino2004@yahoo.fr> 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 <subdino2004@yahoo.fr> > > * 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 <subdino2004@yahoo.fr> > * 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 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 2005-08-04 12:29 ` Marco Gerards @ 2005-08-04 18:13 ` Marco Gerards 2005-08-09 3:26 ` Hollis Blanchard 0 siblings, 1 reply; 14+ messages in thread From: Marco Gerards @ 2005-08-04 18:13 UTC (permalink / raw) To: The development of GRUB 2 Marco Gerards <metgerards@student.han.nl> writes: > Vincent Pelletier <subdino2004@yahoo.fr> 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. Hi Vincent, I have committed your patch with some changes and some extra code so the pager can use the screen height. -- Marco ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal. 2005-08-04 18:13 ` Marco Gerards @ 2005-08-09 3:26 ` Hollis Blanchard 0 siblings, 0 replies; 14+ messages in thread From: Hollis Blanchard @ 2005-08-09 3:26 UTC (permalink / raw) To: The development of GRUB 2 On Aug 4, 2005, at 1:13 PM, Marco Gerards wrote: > Marco Gerards <metgerards@student.han.nl> writes: > >> Vincent Pelletier <subdino2004@yahoo.fr> 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. > > I have committed your patch with some changes and some extra code so > the pager can use the screen height. This patch introduced some build warnings which I've just taken care of. -Hollis ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2005-08-09 3:33 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-07-03 21:06 FIXME: These should be dynamically obtained from a terminal Vincent Pelletier 2005-07-03 21:16 ` [Bulk] " Vincent Pelletier 2005-07-04 23:05 ` Yoshinori K. Okuji 2005-07-04 23:19 ` Vincent Pelletier 2005-07-05 10:15 ` Marco Gerards 2005-07-05 15:56 ` Yoshinori K. Okuji 2005-07-05 16:26 ` Marco Gerards 2005-07-12 20:05 ` [PATCH] " Vincent Pelletier 2005-07-13 8:40 ` [PATCHv2] " Vincent Pelletier 2005-07-13 16:41 ` Marco Gerards 2005-07-13 21:29 ` Vincent Pelletier 2005-08-04 12:29 ` Marco Gerards 2005-08-04 18:13 ` Marco Gerards 2005-08-09 3:26 ` Hollis Blanchard
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.