~jonathank89/burg/burg-percise

« back to all changes in this revision

Viewing changes to loader/i386/efi/linux.c

merge mainline into mips

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <grub/pci.h>
34
34
#include <grub/command.h>
35
35
#include <grub/memory.h>
 
36
#include <grub/i18n.h>
36
37
 
37
38
#define GRUB_LINUX_CL_OFFSET            0x1000
38
39
#define GRUB_LINUX_CL_END_OFFSET        0x2000
619
620
 
620
621
  if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
621
622
    {
622
 
      grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
 
623
      grub_error (GRUB_ERR_READ_ERROR, "cannot read the Linux header");
623
624
      goto fail;
624
625
    }
625
626
 
693
694
  params->ext_mem = ((32 * 0x100000) >> 10);
694
695
  params->alt_mem = ((32 * 0x100000) >> 10);
695
696
 
696
 
  params->video_cursor_x = grub_getxy () >> 8;
697
 
  params->video_cursor_y = grub_getxy () & 0xff;
 
697
  {
 
698
    grub_term_output_t term;
 
699
    int found = 0;
 
700
    FOR_ACTIVE_TERM_OUTPUTS(term)
 
701
      if (grub_strcmp (term->name, "vga_text") == 0
 
702
          || grub_strcmp (term->name, "console") == 0)
 
703
        {
 
704
          grub_uint16_t pos = grub_term_getxy (term);
 
705
          params->video_cursor_x = pos >> 8;
 
706
          params->video_cursor_y = pos & 0xff;
 
707
          params->video_width = grub_term_width (term);
 
708
          params->video_height = grub_term_height (term);
 
709
          found = 1;
 
710
          break;
 
711
        }
 
712
    if (!found)
 
713
      {
 
714
        params->video_cursor_x = 0;
 
715
        params->video_cursor_y = 0;
 
716
        params->video_width = 80;
 
717
        params->video_height = 25;
 
718
      }
 
719
  }
698
720
  params->video_page = 0; /* ??? */
699
721
  params->video_mode = grub_efi_system_table->con_out->mode->mode;
700
 
  params->video_width = (grub_getwh () >> 8);
701
722
  params->video_ega_bx = 0;
702
 
  params->video_height = (grub_getwh () & 0xff);
703
723
  params->have_vga = 0;
704
724
  params->font_size = 16; /* XXX */
705
725
 
989
1009
GRUB_MOD_INIT(linux)
990
1010
{
991
1011
  cmd_linux = grub_register_command ("linux", grub_cmd_linux,
992
 
                                     0, "Load Linux.");
 
1012
                                     0, N_("Load Linux."));
993
1013
  cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
994
 
                                      0, "Load initrd.");
 
1014
                                      0, N_("Load initrd."));
995
1015
  my_mod = mod;
996
1016
}
997
1017