]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
REtrieve position from right console in loader/i386/linux.c
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 24 Dec 2009 23:07:52 +0000 (00:07 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 24 Dec 2009 23:07:52 +0000 (00:07 +0100)
loader/i386/linux.c

index 140ed19574fae66bc9a67cdfbb2759708952e95c..e3b8638d2e9f8f228ab866035906695e286a9657 100644 (file)
@@ -548,8 +548,30 @@ grub_linux_boot (void)
   /* Initialize these last, because terminal position could be affected by printfs above.  */
   if (params->have_vga == GRUB_VIDEO_TYPE_TEXT)
     {
-      params->video_cursor_x = grub_console_getxy () >> 8;
-      params->video_cursor_y = grub_console_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;
+           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;
+           found = 1;
+         }
+      if (!found)
+       {
+         params->video_cursor_x = 0;
+         params->video_cursor_y = 0;
+       }
     }
 
 #ifdef __x86_64__