merge mainline into asprintf
This commit is contained in:
commit
2d49abe9e7
342 changed files with 14569 additions and 4699 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -33,6 +33,8 @@
|
|||
#include <grub/video_fb.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i386/pc/vbe.h>
|
||||
#include <grub/i386/pc/console.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#define GRUB_LINUX_CL_OFFSET 0x1000
|
||||
#define GRUB_LINUX_CL_END_OFFSET 0x2000
|
||||
|
@ -520,11 +522,11 @@ grub_linux_boot (void)
|
|||
tmp = grub_asprintf ("%s;text", modevar);
|
||||
if (! tmp)
|
||||
return grub_errno;
|
||||
err = grub_video_set_mode (tmp, 0);
|
||||
err = grub_video_set_mode (tmp, 0, 0);
|
||||
grub_free (tmp);
|
||||
}
|
||||
else
|
||||
err = grub_video_set_mode ("text", 0);
|
||||
err = grub_video_set_mode ("text", 0, 0);
|
||||
|
||||
if (err)
|
||||
{
|
||||
|
@ -534,19 +536,34 @@ grub_linux_boot (void)
|
|||
}
|
||||
|
||||
if (! grub_linux_setup_video (params))
|
||||
params->have_vga = GRUB_VIDEO_TYPE_VLFB;
|
||||
params->have_vga = GRUB_VIDEO_LINUX_TYPE_VESA;
|
||||
else
|
||||
{
|
||||
params->have_vga = GRUB_VIDEO_TYPE_TEXT;
|
||||
params->have_vga = GRUB_VIDEO_LINUX_TYPE_TEXT;
|
||||
params->video_width = 80;
|
||||
params->video_height = 25;
|
||||
}
|
||||
|
||||
/* Initialize these last, because terminal position could be affected by printfs above. */
|
||||
if (params->have_vga == GRUB_VIDEO_TYPE_TEXT)
|
||||
if (params->have_vga == GRUB_VIDEO_LINUX_TYPE_TEXT)
|
||||
{
|
||||
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_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;
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
params->video_cursor_x = 0;
|
||||
params->video_cursor_y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
@ -611,7 +628,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
|
||||
{
|
||||
grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
|
||||
grub_error (GRUB_ERR_READ_ERROR, "cannot read the Linux header");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -710,8 +727,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
grub_file_seek (file, real_size + GRUB_DISK_SECTOR_SIZE);
|
||||
|
||||
grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n",
|
||||
(unsigned) real_size, (unsigned) prot_size);
|
||||
grub_dprintf ("linux", "bzImage, setup=0x%x, size=0x%x\n",
|
||||
(unsigned) real_size, (unsigned) prot_size);
|
||||
|
||||
/* Look for memory size and video mode specified on the command line. */
|
||||
linux_mem_size = 0;
|
||||
|
@ -960,8 +977,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
goto fail;
|
||||
}
|
||||
|
||||
grub_printf (" [Initrd, addr=0x%x, size=0x%x]\n",
|
||||
(unsigned) addr, (unsigned) size);
|
||||
grub_dprintf ("linux", "Initrd, addr=0x%x, size=0x%x\n",
|
||||
(unsigned) addr, (unsigned) size);
|
||||
|
||||
lh->ramdisk_image = addr;
|
||||
lh->ramdisk_size = size;
|
||||
|
@ -979,9 +996,9 @@ static grub_command_t cmd_linux, cmd_initrd;
|
|||
GRUB_MOD_INIT(linux)
|
||||
{
|
||||
cmd_linux = grub_register_command ("linux", grub_cmd_linux,
|
||||
0, "Load Linux.");
|
||||
0, N_("Load Linux."));
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, "Load initrd.");
|
||||
0, N_("Load initrd."));
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue