All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marco Gerards <metgerards@student.han.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCHv2] FIXME: These should be dynamically obtained from a terminal.
Date: Wed, 13 Jul 2005 18:41:00 +0200	[thread overview]
Message-ID: <87slyi8xr7.fsf@student.han.nl> (raw)
In-Reply-To: <42D4D367.3030402@yahoo.fr> (Vincent Pelletier's message of "Wed, 13 Jul 2005 10:40:07 +0200")

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




  reply	other threads:[~2005-07-13 16:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87slyi8xr7.fsf@student.han.nl \
    --to=metgerards@student.han.nl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.