]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix i386-ieee1275 compilation
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 28 Dec 2009 21:06:30 +0000 (22:06 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 28 Dec 2009 21:06:30 +0000 (22:06 +0100)
loader/i386/ieee1275/linux.c
term/ieee1275/ofconsole.c

index 529d1590aa5a1651490c1fdf873fc70f143840fe..33488d443637fef810c39829fab34946c9744634 100644 (file)
@@ -109,8 +109,38 @@ grub_linux_boot (void)
   params->cl_magic = GRUB_LINUX_CL_MAGIC;
   params->cl_offset = GRUB_OFW_LINUX_CL_OFFSET;
 
-  params->video_width = (grub_getwh () >> 8);
-  params->video_height = (grub_getwh () & 0xff);
+  {
+    grub_term_output_t term;
+    int found = 0;
+    FOR_ACTIVE_TERM_OUTPUTS(term)
+      if (grub_strcmp (term->name, "vga_text") == 0)
+       {
+         grub_uint16_t pos = grub_term_getxy (term);
+         params->video_cursor_x = pos >> 8;
+         params->video_cursor_y = pos & 0xff;
+         params->video_width = grub_term_width (term);
+         params->video_height = grub_term_height (term);
+         found = 1;
+       }
+    if (!found)
+      FOR_ACTIVE_TERM_OUTPUTS(term)
+       if (grub_strcmp (term->name, "console") == 0)
+         {
+           grub_uint16_t pos = grub_term_getxy (term);
+           params->video_cursor_x = pos >> 8;
+           params->video_cursor_y = pos & 0xff;
+           params->video_width = grub_term_width (term);
+           params->video_height = grub_term_height (term);
+           found = 1;
+         }
+    if (!found)
+      {
+       params->video_cursor_x = 0;
+       params->video_cursor_y = 0;
+       params->video_width = 80;
+       params->video_height = 25;
+      }
+  }
   params->font_size = 16;
 
   params->ofw_signature = GRUB_LINUX_OFW_SIGNATURE;
index f5db7c146243bd1687e4294bb63bf71b5d34a364..4b9c9060e2c8382865377a9e4ff9b804eed6bccf 100644 (file)
@@ -88,7 +88,7 @@ grub_ofconsole_putchar (grub_uint32_t c)
       grub_curr_x++;
       if (grub_curr_x > grub_ofconsole_width)
         {
-          grub_putcode ('\n');
+          grub_ofconsole_putchar ('\n');
           grub_curr_x++;
         }
     }
@@ -319,7 +319,7 @@ grub_ofconsole_cls (void)
    * ANSI escape sequence.  Using video console, Apple Open Firmware (version
    * 3.1.1) only recognizes the literal ^L.  So use both.  */
   grub_ofconsole_writeesc ("\f\e[2J");
-  grub_gotoxy (0, 0);
+  grub_ofconsole_gotoxy (0, 0);
 }
 
 static void