]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix EFI compilation
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 26 Dec 2009 21:16:14 +0000 (22:16 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 26 Dec 2009 21:16:14 +0000 (22:16 +0100)
loader/i386/efi/linux.c

index 8cd4d23f2c22e6f7ec4c7a321aa3c1b15c80d87d..a869ca71accae0ff28636ee28567410f0b92979f 100644 (file)
@@ -693,13 +693,41 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
   params->ext_mem = ((32 * 0x100000) >> 10);
   params->alt_mem = ((32 * 0x100000) >> 10);
 
-  params->video_cursor_x = grub_getxy () >> 8;
-  params->video_cursor_y = grub_getxy () & 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->video_page = 0; /* ??? */
   params->video_mode = grub_efi_system_table->con_out->mode->mode;
-  params->video_width = (grub_getwh () >> 8);
   params->video_ega_bx = 0;
-  params->video_height = (grub_getwh () & 0xff);
   params->have_vga = 0;
   params->font_size = 16; /* XXX */