~jonathank89/burg/burg-percise

« back to all changes in this revision

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

merge mainline into mips

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* linux.c - boot Linux zImage or bzImage */
2
2
/*
3
3
 *  GRUB  --  GRand Unified Bootloader
4
 
 *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008  Free Software Foundation, Inc.
 
4
 *  Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010  Free Software Foundation, Inc.
5
5
 *
6
6
 *  GRUB is free software: you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
32
32
#include <grub/cpu/linux.h>
33
33
#include <grub/ieee1275/ieee1275.h>
34
34
#include <grub/command.h>
 
35
#include <grub/i18n.h>
35
36
 
36
37
#define GRUB_OFW_LINUX_PARAMS_ADDR      0x90000
37
38
#define GRUB_OFW_LINUX_KERNEL_ADDR      0x100000
109
110
  params->cl_magic = GRUB_LINUX_CL_MAGIC;
110
111
  params->cl_offset = GRUB_OFW_LINUX_CL_OFFSET;
111
112
 
112
 
  params->video_width = (grub_getwh () >> 8);
113
 
  params->video_height = (grub_getwh () & 0xff);
 
113
  {
 
114
    grub_term_output_t term;
 
115
    int found = 0;
 
116
    FOR_ACTIVE_TERM_OUTPUTS(term)
 
117
      if (grub_strcmp (term->name, "ofconsole") == 0)
 
118
        {
 
119
          grub_uint16_t pos = grub_term_getxy (term);
 
120
          params->video_cursor_x = pos >> 8;
 
121
          params->video_cursor_y = pos & 0xff;
 
122
          params->video_width = grub_term_width (term);
 
123
          params->video_height = grub_term_height (term);
 
124
          found = 1;
 
125
          break;
 
126
        }
 
127
    if (!found)
 
128
      {
 
129
        params->video_cursor_x = 0;
 
130
        params->video_cursor_y = 0;
 
131
        params->video_width = 80;
 
132
        params->video_height = 25;
 
133
      }
 
134
  }
 
135
 
114
136
  params->font_size = 16;
115
137
 
116
138
  params->ofw_signature = GRUB_LINUX_OFW_SIGNATURE;
165
187
 
166
188
  if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
167
189
    {
168
 
      grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
 
190
      grub_error (GRUB_ERR_READ_ERROR, "cannot read the Linux header");
169
191
      goto fail;
170
192
    }
171
193
 
276
298
GRUB_MOD_INIT(linux)
277
299
{
278
300
  cmd_linux = grub_register_command ("linux", grub_cmd_linux,
279
 
                                     0, "Load Linux.");
 
301
                                     0, N_("Load Linux."));
280
302
  cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
281
 
                                      0, "Load initrd.");
 
303
                                      0, N_("Load initrd."));
282
304
  my_mod = mod;
283
305
}
284
306