Merge multiterm into gfxmenu+multiterm
This commit is contained in:
commit
e6e86df1de
238 changed files with 3524 additions and 1873 deletions
|
@ -1,7 +1,7 @@
|
|||
/* appleloader.c - apple legacy boot loader. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2008,2009 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
|
||||
|
@ -59,58 +59,171 @@ grub_appleloader_boot (void)
|
|||
return grub_errno;
|
||||
}
|
||||
|
||||
/* early 2006 Core Duo / Core Solo models */
|
||||
static grub_uint8_t devpath_1[] =
|
||||
struct piwg_full_device_path
|
||||
{
|
||||
0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xF9, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
|
||||
0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
|
||||
struct grub_efi_memory_mapped_device_path comp1;
|
||||
struct grub_efi_piwg_device_path comp2;
|
||||
struct grub_efi_device_path end;
|
||||
};
|
||||
|
||||
/* early 2006 Core Duo / Core Solo models */
|
||||
static struct piwg_full_device_path devpath_1 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffe00000,
|
||||
.end_address = 0xfff9ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
|
||||
/* mid-2006 Mac Pro (and probably other Core 2 models) */
|
||||
static grub_uint8_t devpath_2[] =
|
||||
static struct piwg_full_device_path devpath_2 =
|
||||
{
|
||||
0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xF7, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
|
||||
0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffe00000,
|
||||
.end_address = 0xfff7ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
|
||||
/* mid-2007 MBP ("Santa Rosa" based models) */
|
||||
static grub_uint8_t devpath_3[] =
|
||||
static struct piwg_full_device_path devpath_3 =
|
||||
{
|
||||
0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
|
||||
0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffe00000,
|
||||
.end_address = 0xfff8ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
|
||||
/* early-2008 MBA */
|
||||
static grub_uint8_t devpath_4[] =
|
||||
static struct piwg_full_device_path devpath_4 =
|
||||
{
|
||||
0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
|
||||
0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffc00000,
|
||||
.end_address = 0xfff8ffff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
|
||||
/* late-2008 MB/MBP (NVidia chipset) */
|
||||
static grub_uint8_t devpath_5[] = {
|
||||
0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00,
|
||||
0x00, 0x40, 0xCB, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xBF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B,
|
||||
0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00,
|
||||
static struct piwg_full_device_path devpath_5 =
|
||||
{
|
||||
.comp1 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_memory_mapped_device_path), 0}
|
||||
},
|
||||
.memory_type = GRUB_EFI_MEMORY_MAPPED_IO,
|
||||
.start_address = 0xffcb4000,
|
||||
.end_address = 0xffffbfff
|
||||
},
|
||||
.comp2 =
|
||||
{
|
||||
.header = {
|
||||
.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_piwg_device_path), 0}
|
||||
},
|
||||
.guid = {0x2B0585EB, 0xD8B8, 0x49A9, {0x8B, 0x8C, 0xE2, 0x1B,
|
||||
0x01, 0xAE, 0xF2, 0xB7}}
|
||||
},
|
||||
.end =
|
||||
{
|
||||
.type = GRUB_EFI_END_DEVICE_PATH_TYPE,
|
||||
.subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
.length = {sizeof (struct grub_efi_device_path), 0}
|
||||
}
|
||||
};
|
||||
|
||||
struct devdata
|
||||
|
@ -121,11 +234,11 @@ struct devdata
|
|||
|
||||
struct devdata devs[] =
|
||||
{
|
||||
{"Core Duo/Solo", (grub_efi_device_path_t *) devpath_1},
|
||||
{"Mac Pro", (grub_efi_device_path_t *) devpath_2},
|
||||
{"MBP", (grub_efi_device_path_t *) devpath_3},
|
||||
{"MBA", (grub_efi_device_path_t *) devpath_4},
|
||||
{"MB NV", (grub_efi_device_path_t *) devpath_5},
|
||||
{"Core Duo/Solo", (grub_efi_device_path_t *) &devpath_1},
|
||||
{"Mac Pro", (grub_efi_device_path_t *) &devpath_2},
|
||||
{"MBP", (grub_efi_device_path_t *) &devpath_3},
|
||||
{"MBA", (grub_efi_device_path_t *) &devpath_4},
|
||||
{"MB NV", (grub_efi_device_path_t *) &devpath_5},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
|
@ -208,7 +321,7 @@ static grub_command_t cmd;
|
|||
GRUB_MOD_INIT(appleloader)
|
||||
{
|
||||
cmd = grub_register_command ("appleloader", grub_cmd_appleloader,
|
||||
"appleloader [OPTS]", "Boot legacy system.");
|
||||
"[OPTS]", "Boot legacy system.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ static grub_command_t cmd;
|
|||
GRUB_MOD_INIT(chainloader)
|
||||
{
|
||||
cmd = grub_register_command ("chainloader", grub_cmd_chainloader,
|
||||
0, "load another boot loader");
|
||||
0, "Load another boot loader.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <grub/aout.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#ifdef GRUB_MACHINE_PCBIOS
|
||||
#include <grub/machine/biosnum.h>
|
||||
|
@ -61,20 +62,20 @@ static grub_uint32_t openbsd_root;
|
|||
|
||||
static const struct grub_arg_option freebsd_opts[] =
|
||||
{
|
||||
{"dual", 'D', 0, "Display output on all consoles.", 0, 0},
|
||||
{"serial", 'h', 0, "Use serial console.", 0, 0},
|
||||
{"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0},
|
||||
{"cdrom", 'C', 0, "Use cdrom as root.", 0, 0},
|
||||
{"config", 'c', 0, "Invoke user configuration routing.", 0, 0},
|
||||
{"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0},
|
||||
{"gdb", 'g', 0, "Use GDB remote debugger instead of DDB.", 0, 0},
|
||||
{"mute", 'm', 0, "Disable all boot output.", 0, 0},
|
||||
{"dual", 'D', 0, N_("Display output on all consoles."), 0, 0},
|
||||
{"serial", 'h', 0, N_("Use serial console."), 0, 0},
|
||||
{"askname", 'a', 0, N_("Ask for file name to reboot from."), 0, 0},
|
||||
{"cdrom", 'C', 0, N_("Use CDROM as root."), 0, 0},
|
||||
{"config", 'c', 0, N_("Invoke user configuration routing."), 0, 0},
|
||||
{"kdb", 'd', 0, N_("Enter in KDB on boot."), 0, 0},
|
||||
{"gdb", 'g', 0, N_("Use GDB remote debugger instead of DDB."), 0, 0},
|
||||
{"mute", 'm', 0, N_("Disable all boot output."), 0, 0},
|
||||
{"nointr", 'n', 0, "", 0, 0},
|
||||
{"pause", 'p', 0, "Wait for keypress after every line of output.", 0, 0},
|
||||
{"pause", 'p', 0, N_("Wait for keypress after every line of output."), 0, 0},
|
||||
{"quiet", 'q', 0, "", 0, 0},
|
||||
{"dfltroot", 'r', 0, "Use compiled-in rootdev.", 0, 0},
|
||||
{"single", 's', 0, "Boot into single mode.", 0, 0},
|
||||
{"verbose", 'v', 0, "Boot with verbose messages.", 0, 0},
|
||||
{"dfltroot", 'r', 0, N_("Use compiled-in rootdev."), 0, 0},
|
||||
{"single", 's', 0, N_("Boot into single mode."), 0, 0},
|
||||
{"verbose", 'v', 0, N_("Boot with verbose messages."), 0, 0},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -89,12 +90,12 @@ static const grub_uint32_t freebsd_flags[] =
|
|||
|
||||
static const struct grub_arg_option openbsd_opts[] =
|
||||
{
|
||||
{"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0},
|
||||
{"halt", 'b', 0, "Don't reboot, just halt.", 0, 0},
|
||||
{"config", 'c', 0, "Change configured devices.", 0, 0},
|
||||
{"single", 's', 0, "Boot into single mode.", 0, 0},
|
||||
{"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0},
|
||||
{"root", 'r', 0, "Set root device.", "wdXY", ARG_TYPE_STRING},
|
||||
{"askname", 'a', 0, N_("Ask for file name to reboot from."), 0, 0},
|
||||
{"halt", 'b', 0, N_("Don't reboot, just halt."), 0, 0},
|
||||
{"config", 'c', 0, N_("Change configured devices."), 0, 0},
|
||||
{"single", 's', 0, N_("Boot into single mode."), 0, 0},
|
||||
{"kdb", 'd', 0, N_("Enter in KDB on boot."), 0, 0},
|
||||
{"root", 'r', 0, N_("Set root device."), "wdXY", ARG_TYPE_STRING},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -108,19 +109,19 @@ static const grub_uint32_t openbsd_flags[] =
|
|||
|
||||
static const struct grub_arg_option netbsd_opts[] =
|
||||
{
|
||||
{"no-smp", '1', 0, "Disable SMP.", 0, 0},
|
||||
{"no-acpi", '2', 0, "Disable ACPI.", 0, 0},
|
||||
{"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0},
|
||||
{"halt", 'b', 0, "Don't reboot, just halt.", 0, 0},
|
||||
{"config", 'c', 0, "Change configured devices.", 0, 0},
|
||||
{"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0},
|
||||
{"no-smp", '1', 0, N_("Disable SMP."), 0, 0},
|
||||
{"no-acpi", '2', 0, N_("Disable ACPI."), 0, 0},
|
||||
{"askname", 'a', 0, N_("Ask for file name to reboot from."), 0, 0},
|
||||
{"halt", 'b', 0, N_("Don't reboot, just halt."), 0, 0},
|
||||
{"config", 'c', 0, N_("Change configured devices."), 0, 0},
|
||||
{"kdb", 'd', 0, N_("Enter in KDB on boot."), 0, 0},
|
||||
{"miniroot", 'm', 0, "", 0, 0},
|
||||
{"quiet", 'q', 0, "Don't display boot diagnostic messages.", 0, 0},
|
||||
{"single", 's', 0, "Boot into single mode.", 0, 0},
|
||||
{"verbose", 'v', 0, "Boot with verbose messages.", 0, 0},
|
||||
{"debug", 'x', 0, "Boot with debug messages.", 0, 0},
|
||||
{"silent", 'z', 0, "Supress normal output (warnings remain).", 0, 0},
|
||||
{"root", 'r', 0, "Set root device.", "DEVICE", ARG_TYPE_STRING},
|
||||
{"quiet", 'q', 0, N_("Don't display boot diagnostic messages."), 0, 0},
|
||||
{"single", 's', 0, N_("Boot into single mode."), 0, 0},
|
||||
{"verbose", 'v', 0, N_("Boot with verbose messages."), 0, 0},
|
||||
{"debug", 'x', 0, N_("Boot with debug messages."), 0, 0},
|
||||
{"silent", 'z', 0, N_("Supress normal output (warnings remain)."), 0, 0},
|
||||
{"root", 'r', 0, N_("Set root device."), N_("DEVICE"), ARG_TYPE_STRING},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -679,7 +680,7 @@ grub_netbsd_boot (void)
|
|||
+ sizeof (struct grub_netbsd_btinfo_mmap_header)
|
||||
+ count * sizeof (struct grub_netbsd_btinfo_mmap_entry)
|
||||
> grub_os_area_addr + grub_os_area_size)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "No memory for boot info.");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "no memory for boot info");
|
||||
|
||||
curarg = mmap = (struct grub_netbsd_btinfo_mmap_header *) kern_end;
|
||||
pm = (struct grub_netbsd_btinfo_mmap_entry *) (mmap + 1);
|
||||
|
@ -750,10 +751,10 @@ grub_bsd_load_aout (grub_file_t file)
|
|||
return grub_errno;
|
||||
|
||||
if (grub_file_read (file, &ah, sizeof (ah)) != sizeof (ah))
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "Cannot read the a.out header");
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "cannot read the a.out header");
|
||||
|
||||
if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Invalid a.out header");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "invalid a.out header");
|
||||
|
||||
entry = ah.aout32.a_entry & 0xFFFFFF;
|
||||
|
||||
|
@ -771,7 +772,7 @@ grub_bsd_load_aout (grub_file_t file)
|
|||
}
|
||||
|
||||
if (load_addr < 0x100000)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Load address below 1M");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "load address below 1M");
|
||||
|
||||
kern_start = load_addr;
|
||||
kern_end = load_addr + ah.aout32.a_text + ah.aout32.a_data;
|
||||
|
@ -811,7 +812,7 @@ grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr, int *do_load)
|
|||
|
||||
if ((paddr < grub_os_area_addr)
|
||||
|| (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range",
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "address 0x%x is out of range",
|
||||
paddr);
|
||||
|
||||
if ((!kern_start) || (paddr < kern_start))
|
||||
|
@ -842,7 +843,7 @@ grub_bsd_elf64_hook (Elf64_Phdr * phdr, grub_addr_t * addr, int *do_load)
|
|||
|
||||
if ((paddr < grub_os_area_addr)
|
||||
|| (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range",
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "address 0x%x is out of range",
|
||||
paddr);
|
||||
|
||||
if ((!kern_start) || (paddr < kern_start))
|
||||
|
@ -871,7 +872,7 @@ grub_bsd_load_elf (grub_elf_t elf)
|
|||
is_64bit = 1;
|
||||
|
||||
if (! grub_cpuid_has_longmode)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Your CPU does not implement AMD64 architecture.");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "your CPU does not implement AMD64 architecture");
|
||||
|
||||
/* FreeBSD has 64-bit entry point. */
|
||||
if (kernel_type == KERNEL_TYPE_FREEBSD)
|
||||
|
@ -887,7 +888,7 @@ grub_bsd_load_elf (grub_elf_t elf)
|
|||
return grub_elf64_load (elf, grub_bsd_elf64_hook, 0, 0);
|
||||
}
|
||||
else
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Invalid elf");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "invalid elf");
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
@ -902,7 +903,7 @@ grub_bsd_load (int argc, char *argv[])
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1024,14 +1025,14 @@ grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[])
|
|||
int unit, part;
|
||||
if (*(arg++) != 'w' || *(arg++) != 'd')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only device specifications of form "
|
||||
"wd<number><lowercase letter> are supported.");
|
||||
"only device specifications of form "
|
||||
"wd<number><lowercase letter> are supported");
|
||||
|
||||
unit = grub_strtoul (arg, (char **) &arg, 10);
|
||||
if (! (arg && *arg >= 'a' && *arg <= 'z'))
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only device specifications of form "
|
||||
"wd<number><lowercase letter> are supported.");
|
||||
"only device specifications of form "
|
||||
"wd<number><lowercase letter> are supported");
|
||||
|
||||
part = *arg - 'a';
|
||||
|
||||
|
@ -1076,15 +1077,15 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (kernel_type == KERNEL_TYPE_NONE)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"You need to load the kernel first.");
|
||||
"you need to load the kernel first");
|
||||
|
||||
if (kernel_type != KERNEL_TYPE_FREEBSD)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only FreeBSD support environment");
|
||||
"only FreeBSD support environment");
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No filename");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no filename");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1170,15 +1171,15 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (kernel_type == KERNEL_TYPE_NONE)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"You need to load the kernel first.");
|
||||
"you need to load the kernel first");
|
||||
|
||||
if (kernel_type != KERNEL_TYPE_FREEBSD)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only FreeBSD support module");
|
||||
"only FreeBSD support module");
|
||||
|
||||
if (!is_elf_kernel)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only ELF kernel support module");
|
||||
"only ELF kernel support module");
|
||||
|
||||
/* List the current modules if no parameter. */
|
||||
if (!argc)
|
||||
|
@ -1193,7 +1194,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (kern_end + file->size > grub_os_area_addr + grub_os_area_size)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "Not enough memory for the module");
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "not enough memory for the module");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1236,15 +1237,15 @@ grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (kernel_type == KERNEL_TYPE_NONE)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"You need to load the kernel first.");
|
||||
"you need to load the kernel first");
|
||||
|
||||
if (kernel_type != KERNEL_TYPE_FREEBSD)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only FreeBSD support module");
|
||||
"only FreeBSD support module");
|
||||
|
||||
if (! is_elf_kernel)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"Only ELF kernel support module");
|
||||
"only ELF kernel support module");
|
||||
|
||||
/* List the current modules if no parameter. */
|
||||
if (! argc)
|
||||
|
@ -1280,25 +1281,25 @@ GRUB_MOD_INIT (bsd)
|
|||
{
|
||||
cmd_freebsd = grub_register_extcmd ("kfreebsd", grub_cmd_freebsd,
|
||||
GRUB_COMMAND_FLAG_BOTH,
|
||||
"kfreebsd FILE", "Load kernel of FreeBSD.",
|
||||
N_("FILE"), N_("Load kernel of FreeBSD."),
|
||||
freebsd_opts);
|
||||
cmd_openbsd = grub_register_extcmd ("kopenbsd", grub_cmd_openbsd,
|
||||
GRUB_COMMAND_FLAG_BOTH,
|
||||
"kopenbsd FILE", "Load kernel of OpenBSD.",
|
||||
N_("FILE"), N_("Load kernel of OpenBSD."),
|
||||
openbsd_opts);
|
||||
cmd_netbsd = grub_register_extcmd ("knetbsd", grub_cmd_netbsd,
|
||||
GRUB_COMMAND_FLAG_BOTH,
|
||||
"knetbsd FILE", "Load kernel of NetBSD.",
|
||||
N_("FILE"), N_("Load kernel of NetBSD."),
|
||||
netbsd_opts);
|
||||
cmd_freebsd_loadenv =
|
||||
grub_register_command ("kfreebsd_loadenv", grub_cmd_freebsd_loadenv,
|
||||
0, "load FreeBSD env");
|
||||
0, N_("Load FreeBSD env."));
|
||||
cmd_freebsd_module =
|
||||
grub_register_command ("kfreebsd_module", grub_cmd_freebsd_module,
|
||||
0, "load FreeBSD kernel module");
|
||||
0, N_("Load FreeBSD kernel module."));
|
||||
cmd_freebsd_module_elf =
|
||||
grub_register_command ("kfreebsd_module_elf", grub_cmd_freebsd_module_elf,
|
||||
0, "load FreeBSD kernel module (ELF)");
|
||||
0, N_("Load FreeBSD kernel module (ELF)."));
|
||||
|
||||
my_mod = mod;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ load (grub_file_t file, void *where, grub_off_t off, grub_size_t size)
|
|||
{
|
||||
if (PTR_TO_UINT32 (where) + size > grub_os_area_addr + grub_os_area_size)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
"Not enough memory for the module");
|
||||
"not enough memory for the module");
|
||||
if (grub_file_seek (file, off) == (grub_off_t) -1)
|
||||
return grub_errno;
|
||||
if (grub_file_read (file, where, size)
|
||||
|
@ -116,7 +116,7 @@ SUFFIX (grub_freebsd_load_elfmodule_obj) (grub_file_t file, int argc,
|
|||
case SHT_NOBITS:
|
||||
if (curload + s->sh_size > grub_os_area_addr + grub_os_area_size)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
"Not enough memory for the module");
|
||||
"not enough memory for the module");
|
||||
grub_memset (UINT_TO_PTR (curload), 0, s->sh_size);
|
||||
break;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ SUFFIX (grub_freebsd_load_elfmodule) (grub_file_t file, int argc, char *argv[],
|
|||
if (module + s->sh_addr + s->sh_size
|
||||
> grub_os_area_addr + grub_os_area_size)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
"Not enough memory for the module");
|
||||
"not enough memory for the module");
|
||||
grub_memset (UINT_TO_PTR (module + s->sh_addr), 0, s->sh_size);
|
||||
break;
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ SUFFIX (grub_freebsd_load_elf_meta) (grub_file_t file, grub_addr_t *kern_end)
|
|||
if (*kern_end + 4 * sizeof (grub_freebsd_addr_t) + symsize + strsize
|
||||
> grub_os_area_addr + grub_os_area_size)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
"Not enough memory for kernel symbols");
|
||||
"not enough memory for kernel symbols");
|
||||
|
||||
symstart = curload = ALIGN_UP (*kern_end, sizeof (grub_freebsd_addr_t));
|
||||
*((grub_freebsd_addr_t *) UINT_TO_PTR (curload)) = symsize;
|
||||
|
|
|
@ -671,7 +671,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
len = 0x400 - sizeof (lh);
|
||||
if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -881,7 +881,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
len = prot_size;
|
||||
if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
{
|
||||
|
@ -918,13 +918,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (! loaded)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -994,7 +994,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (grub_file_read (file, initrd_mem, size) != size)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1017,9 +1017,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, "Load Linux.");
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, "load initrd");
|
||||
0, "Load initrd.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -148,10 +148,10 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
|
|||
|
||||
c = grub_efi_locate_protocol (&uga_draw_guid, 0);
|
||||
if (! c)
|
||||
return grub_error (GRUB_ERR_IO, "Couldn't find UGADraw");
|
||||
return grub_error (GRUB_ERR_IO, "couldn't find UGADraw");
|
||||
|
||||
if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate))
|
||||
return grub_error (GRUB_ERR_IO, "Couldn't retrieve video mode");
|
||||
return grub_error (GRUB_ERR_IO, "couldn't retrieve video mode");
|
||||
|
||||
grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate);
|
||||
|
||||
|
@ -163,7 +163,7 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
|
|||
grub_efi_set_text_mode (1);
|
||||
|
||||
if (! ret)
|
||||
return grub_error (GRUB_ERR_IO, "Can\'t find frame buffer address\n");
|
||||
return grub_error (GRUB_ERR_IO, "can\'t find frame buffer address");
|
||||
|
||||
grub_printf ("Frame buffer base: 0x%x\n", fb_base);
|
||||
grub_printf ("Video line length: %d\n", line_len);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* linux.c - boot Linux zImage or bzImage */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 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
|
||||
|
@ -241,7 +241,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
kernel_size = prot_size;
|
||||
if (grub_file_read (file, kernel_addr, prot_size) != (int) prot_size)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
grub_loader_set (grub_linux_boot, grub_linux_unload, 1);
|
||||
|
@ -272,13 +272,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (! kernel_addr)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (grub_file_read (file, (void *) GRUB_OFW_LINUX_INITRD_ADDR,
|
||||
initrd_size) != (int) initrd_size)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -306,9 +306,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, "Load Linux.");
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, "load initrd");
|
||||
0, "Load initrd.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -696,7 +696,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
len = 0x400 - sizeof (lh);
|
||||
if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -885,7 +885,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
len = prot_size;
|
||||
if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
{
|
||||
|
@ -920,13 +920,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (! loaded)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -974,7 +974,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (addr < addr_min)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "The initrd is too big");
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "the initrd is too big");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -982,7 +982,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (grub_file_read (file, initrd_mem, size) != size)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1005,9 +1005,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, "Load Linux.");
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, "load initrd");
|
||||
0, "Load initrd.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ grub_multiboot_boot (void)
|
|||
{
|
||||
struct grub_relocator32_state state =
|
||||
{
|
||||
.eax = MULTIBOOT_MAGIC2,
|
||||
.eax = MULTIBOOT_BOOTLOADER_MAGIC,
|
||||
.ebx = PTR_TO_UINT32 (mbi_dest),
|
||||
.ecx = 0,
|
||||
.edx = 0,
|
||||
|
@ -226,21 +226,21 @@ grub_multiboot (int argc, char *argv[])
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
if (! file)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "Couldn't open file");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "couldn't open file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
len = grub_file_read (file, buffer, MULTIBOOT_SEARCH);
|
||||
if (len < 32)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "File too small");
|
||||
grub_error (GRUB_ERR_BAD_OS, "file too small");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -250,21 +250,21 @@ grub_multiboot (int argc, char *argv[])
|
|||
((char *) header <= buffer + len - 12) || (header = 0);
|
||||
header = (struct multiboot_header *) ((char *) header + 4))
|
||||
{
|
||||
if (header->magic == MULTIBOOT_MAGIC
|
||||
if (header->magic == MULTIBOOT_HEADER_MAGIC
|
||||
&& !(header->magic + header->flags + header->checksum))
|
||||
break;
|
||||
}
|
||||
|
||||
if (header == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No multiboot header found");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no multiboot header found");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (header->flags & MULTIBOOT_UNSUPPORTED)
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||
"Unsupported flag: 0x%x", header->flags);
|
||||
"unsupported flag: 0x%x", header->flags);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -408,14 +408,14 @@ grub_module (int argc, char *argv[])
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!mbi)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"You need to load the multiboot kernel first");
|
||||
"you need to load the multiboot kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -430,7 +430,7 @@ grub_module (int argc, char *argv[])
|
|||
|
||||
if (grub_file_read (file, module, size) != size)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* chainloader.c - boot another boot loader */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2004,2007 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2002,2004,2007,2009 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
|
||||
|
@ -146,7 +146,7 @@ static grub_command_t cmd;
|
|||
GRUB_MOD_INIT(chainloader)
|
||||
{
|
||||
cmd = grub_register_command ("chainloader", grub_cmd_chainloader,
|
||||
0, "load another boot loader");
|
||||
0, "Load another boot loader.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* linux.c - boot Linux zImage or bzImage */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 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
|
||||
|
@ -234,7 +234,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
len = real_size + GRUB_DISK_SECTOR_SIZE - sizeof (lh);
|
||||
if (grub_file_read (file, grub_linux_tmp_addr + sizeof (lh), len) != len)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -265,7 +265,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
len = prot_size;
|
||||
if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE)
|
||||
{
|
||||
|
@ -299,13 +299,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!loaded)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -314,7 +314,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (!(lh->header == grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE)
|
||||
&& grub_le_to_cpu16 (lh->version) >= 0x0200))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "The kernel is too old for initrd.");
|
||||
grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -357,13 +357,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (addr < addr_min)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "The initrd is too big");
|
||||
grub_error (GRUB_ERR_OUT_OF_RANGE, "the initrd is too big");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_file_read (file, (void *) addr, size) != size)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -383,10 +383,10 @@ GRUB_MOD_INIT(linux16)
|
|||
{
|
||||
cmd_linux =
|
||||
grub_register_command ("linux16", grub_cmd_linux,
|
||||
0, "load linux");
|
||||
0, "Load Linux.");
|
||||
cmd_initrd =
|
||||
grub_register_command ("initrd16", grub_cmd_initrd,
|
||||
0, "load initrd");
|
||||
0, "Load initrd.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* multiboot2.c - boot a multiboot 2 OS image. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2007,2008,2009 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
|
||||
|
@ -42,7 +42,7 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr,
|
|||
|
||||
if ((paddr < grub_os_area_addr)
|
||||
|| (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
|
||||
return grub_error(GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range",
|
||||
return grub_error(GRUB_ERR_OUT_OF_RANGE,"address 0x%x is out of range",
|
||||
paddr);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
@ -64,7 +64,7 @@ grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr,
|
|||
|
||||
if ((paddr < grub_os_area_addr)
|
||||
|| (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size))
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range",
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "address 0x%x is out of range",
|
||||
paddr);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
|
|
@ -527,12 +527,12 @@ grub_cmd_devprop_load (grub_command_t cmd __attribute__ ((unused)),
|
|||
unsigned i, j;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "File name required. ");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||
|
||||
file = grub_gzfile_open (args[0], 1);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"Couldn't load device-propertie dump. ");
|
||||
"couldn't load device-propertie dump");
|
||||
size = grub_file_size (file);
|
||||
buf = grub_malloc (size);
|
||||
if (!buf)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* multiboot.c - boot a multiboot 2 OS image. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2007,2009 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
|
||||
|
@ -51,7 +51,7 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr,
|
|||
|
||||
rc = grub_claimmap (phdr->p_paddr, phdr->p_memsz);
|
||||
if (rc)
|
||||
return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Couldn't claim %x - %x",
|
||||
return grub_error(GRUB_ERR_OUT_OF_MEMORY, "couldn't claim %x - %x",
|
||||
phdr->p_paddr, phdr->p_paddr + phdr->p_memsz);
|
||||
|
||||
grub_dprintf ("loader", "Loading segment at 0x%x - 0x%x\n", phdr->p_paddr,
|
||||
|
@ -77,7 +77,7 @@ grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr,
|
|||
|
||||
rc = grub_claimmap (phdr->p_paddr, phdr->p_memsz);
|
||||
if (rc)
|
||||
return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Couldn't claim 0x%lx - 0x%lx",
|
||||
return grub_error(GRUB_ERR_OUT_OF_MEMORY, "couldn't claim 0x%lx - 0x%lx",
|
||||
phdr->p_paddr, phdr->p_paddr + phdr->p_memsz);
|
||||
|
||||
grub_dprintf ("loader", "Loading segment at 0x%lx - 0x%lx\n",
|
||||
|
@ -96,7 +96,7 @@ grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr)
|
|||
rc = grub_ieee1275_claim (0, size, MULTIBOOT2_MOD_ALIGN, addr);
|
||||
if (rc)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"Firmware couldn't allocate memory (size 0x%lx)", size);
|
||||
"firmware couldn't allocate memory (size 0x%lx)", size);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ grub_macho_file (grub_file_t file)
|
|||
!= sizeof (filestart))
|
||||
{
|
||||
grub_error_push ();
|
||||
grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");
|
||||
grub_error (GRUB_ERR_READ_ERROR, "cannot read Mach-O header");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ grub_macho_file (grub_file_t file)
|
|||
{
|
||||
grub_free (archs);
|
||||
grub_error_push ();
|
||||
grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");
|
||||
grub_error (GRUB_ERR_READ_ERROR, "cannot read Mach-O header");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,13 +25,13 @@ SUFFIX (grub_macho_parse) (grub_macho_t macho)
|
|||
|| grub_file_read (macho->file, &head, sizeof (head))
|
||||
!= sizeof(head))
|
||||
{
|
||||
grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");
|
||||
grub_error (GRUB_ERR_READ_ERROR, "cannot read Mach-O header");
|
||||
macho->offsetXX = -1;
|
||||
return;
|
||||
}
|
||||
if (head.magic != GRUB_MACHO_MAGIC)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O " XX "-bit header.");
|
||||
grub_error (GRUB_ERR_BAD_OS, "invalid Mach-O " XX "-bit header");
|
||||
macho->offsetXX = -1;
|
||||
return;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ SUFFIX (grub_macho_parse) (grub_macho_t macho)
|
|||
(grub_size_t) macho->cmdsizeXX)
|
||||
!= (grub_ssize_t) macho->cmdsizeXX)
|
||||
{
|
||||
grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header.");
|
||||
grub_error (GRUB_ERR_READ_ERROR, "cannot read Mach-O header");
|
||||
macho->offsetXX = -1;
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ grub_macho_cmds_iterate (grub_macho_t macho,
|
|||
grub_uint8_t *hdrs = macho->cmdsXX;
|
||||
int i;
|
||||
if (! macho->cmdsXX)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Couldn't find " XX "-bit Mach-O");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "couldn't find " XX "-bit Mach-O");
|
||||
for (i = 0; i < macho->ncmdsXX; i++)
|
||||
{
|
||||
struct grub_macho_cmd *hdr = (struct grub_macho_cmd *) hdrs;
|
||||
|
@ -92,13 +92,13 @@ SUFFIX (grub_macho_readfile) (grub_macho_t macho, void *dest)
|
|||
grub_ssize_t read;
|
||||
if (! SUFFIX (grub_macho_contains_macho) (macho))
|
||||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Couldn't read architecture-specific part");
|
||||
"couldn't read architecture-specific part");
|
||||
|
||||
if (grub_file_seek (macho->file, macho->offsetXX) == (grub_off_t) -1)
|
||||
{
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Invalid offset in program header.");
|
||||
"invalid offset in program header");
|
||||
}
|
||||
|
||||
read = grub_file_read (macho->file, dest,
|
||||
|
@ -107,7 +107,7 @@ SUFFIX (grub_macho_readfile) (grub_macho_t macho, void *dest)
|
|||
{
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Couldn't read architecture-specific part");
|
||||
"couldn't read architecture-specific part");
|
||||
}
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -151,11 +151,11 @@ SUFFIX (grub_macho_size) (grub_macho_t macho, grub_macho_addr_t *segments_start,
|
|||
grub_macho_cmds_iterate (macho, calcsize, 0);
|
||||
|
||||
if (nr_phdrs == 0)
|
||||
return grub_error (GRUB_ERR_BAD_OS, "No program headers present");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "no program headers present");
|
||||
|
||||
if (*segments_end < *segments_start)
|
||||
/* Very bad addresses. */
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Bad program header load addresses");
|
||||
return grub_error (GRUB_ERR_BAD_OS, "bad program header load addresses");
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ SUFFIX (grub_macho_load) (grub_macho_t macho, char *offset, int flags)
|
|||
{
|
||||
grub_error_push ();
|
||||
grub_error (GRUB_ERR_BAD_OS,
|
||||
"Invalid offset in program header.");
|
||||
"invalid offset in program header");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -201,8 +201,8 @@ SUFFIX (grub_macho_load) (grub_macho_t macho, char *offset, int flags)
|
|||
/* XXX How can we free memory from `load_hook'? */
|
||||
grub_error_push ();
|
||||
err=grub_error (GRUB_ERR_BAD_OS,
|
||||
"Couldn't read segment from file: "
|
||||
"wanted 0x%lx bytes; read 0x%lx bytes.",
|
||||
"couldn't read segment from file: "
|
||||
"wanted 0x%lx bytes; read 0x%lx bytes",
|
||||
hdr->filesize, read);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* multiboot2.c - boot a multiboot 2 OS image. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2007,2009 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
|
||||
|
@ -319,14 +319,14 @@ grub_multiboot2 (int argc, char *argv[])
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
if (! file)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "Couldn't open file");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "couldn't open file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -337,7 +337,7 @@ grub_multiboot2 (int argc, char *argv[])
|
|||
len = grub_file_read (file, buffer, MULTIBOOT2_HEADER_SEARCH);
|
||||
if (len < 32)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "File too small");
|
||||
grub_error (GRUB_ERR_BAD_OS, "file too small");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ grub_multiboot2 (int argc, char *argv[])
|
|||
err = grub_mb2_load_other (file, header);
|
||||
else
|
||||
err = grub_error (GRUB_ERR_BAD_OS,
|
||||
"Need multiboot 2 header to load non-ELF files.");
|
||||
"need multiboot 2 header to load non-ELF files");
|
||||
grub_file_close (file);
|
||||
}
|
||||
|
||||
|
@ -406,20 +406,20 @@ grub_module2 (int argc, char *argv[])
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified");
|
||||
return;
|
||||
}
|
||||
|
||||
if (argc == 1)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No module type specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no module type specified");
|
||||
return;
|
||||
}
|
||||
|
||||
if (entry == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"You need to load the multiboot kernel first");
|
||||
"you need to load the multiboot kernel first");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -437,7 +437,7 @@ grub_module2 (int argc, char *argv[])
|
|||
modaddr + modsize);
|
||||
if (grub_file_read (file, (void *) modaddr, modsize) != modsize)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* multiboot_loader.c - boot multiboot 1 or 2 OS image */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2007,2008,2009 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
|
||||
|
@ -58,7 +58,7 @@ find_multi_boot1_header (grub_file_t file)
|
|||
((char *) header <= buffer + len - 12) || (header = 0);
|
||||
header = (struct multiboot_header *) ((char *) header + 4))
|
||||
{
|
||||
if (header->magic == MULTIBOOT_MAGIC
|
||||
if (header->magic == MULTIBOOT_HEADER_MAGIC
|
||||
&& !(header->magic + header->flags + header->checksum))
|
||||
{
|
||||
found_status = 1;
|
||||
|
@ -108,14 +108,14 @@ grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
file = grub_gzfile_open (argv[0], 1);
|
||||
if (! file)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "Couldn't open file");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "couldn't open file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)),
|
|||
header_multi_ver_found = 2;
|
||||
else
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_OS, "Multiboot header not found");
|
||||
grub_error (GRUB_ERR_BAD_OS, "multiboot header not found");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -197,10 +197,10 @@ GRUB_MOD_INIT(multiboot)
|
|||
{
|
||||
cmd_multiboot =
|
||||
grub_register_command ("multiboot", grub_cmd_multiboot_loader,
|
||||
0, "load a multiboot kernel");
|
||||
0, "Load a multiboot kernel.");
|
||||
cmd_module =
|
||||
grub_register_command ("module", grub_cmd_module_loader,
|
||||
0, "load a multiboot module");
|
||||
0, "Load a multiboot module.");
|
||||
|
||||
my_mod = mod;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* linux.c - boot Linux */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2003,2004,2005,2007,2009 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
|
||||
|
@ -75,10 +75,10 @@ grub_linux_release_mem (void)
|
|||
linux_args = 0;
|
||||
|
||||
if (linux_addr && grub_ieee1275_release (linux_addr, linux_size))
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not release memory");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot release memory");
|
||||
|
||||
if (initrd_addr && grub_ieee1275_release (initrd_addr, initrd_size))
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not release memory");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot release memory");
|
||||
|
||||
linux_addr = 0;
|
||||
initrd_addr = 0;
|
||||
|
@ -128,7 +128,7 @@ grub_linux_load32 (grub_elf_t elf)
|
|||
break;
|
||||
}
|
||||
if (found_addr == -1)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not claim memory.");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't claim memory");
|
||||
|
||||
/* Now load the segments into the area we claimed. */
|
||||
auto grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load);
|
||||
|
@ -178,7 +178,7 @@ grub_linux_load64 (grub_elf_t elf)
|
|||
break;
|
||||
}
|
||||
if (found_addr == -1)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not claim memory.");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't claim memory");
|
||||
|
||||
/* Now load the segments into the area we claimed. */
|
||||
auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load);
|
||||
|
@ -222,7 +222,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (elf->ehdr.ehdr32.e_type != ET_EXEC)
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||
"This ELF file is not of the right type\n");
|
||||
"this ELF file is not of the right type");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_linux_load64 (elf);
|
||||
else
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "Unknown ELF class");
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "unknown ELF class");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (!loaded)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (found_addr == -1)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, "Can not claim memory");
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot claim memory");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (grub_file_read (file, (void *) addr, size) != size)
|
||||
{
|
||||
grub_ieee1275_release (addr, size);
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -349,9 +349,9 @@ static grub_command_t cmd_linux, cmd_initrd;
|
|||
GRUB_MOD_INIT(linux)
|
||||
{
|
||||
cmd_linux = grub_register_command ("linux", grub_cmd_linux,
|
||||
0, "load a linux kernel");
|
||||
0, "Load Linux.");
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, "load an initrd");
|
||||
0, "Load initrd.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
|
@ -256,12 +256,12 @@ grub_linux_load64 (grub_elf_t elf)
|
|||
paddr = alloc_phys (linux_size + off);
|
||||
if (paddr == (grub_addr_t) -1)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"Could not allocate physical memory.");
|
||||
"couldn't allocate physical memory");
|
||||
ret = grub_ieee1275_map_physical (paddr, linux_addr - off,
|
||||
linux_size + off, IEEE1275_MAP_DEFAULT);
|
||||
if (ret)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"Could not map physical memory.");
|
||||
"couldn't map physical memory");
|
||||
|
||||
grub_dprintf ("loader", "Loading linux at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n",
|
||||
linux_addr, paddr, linux_size);
|
||||
|
@ -317,7 +317,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (elf->ehdr.ehdr32.e_type != ET_EXEC)
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_OS,
|
||||
"This ELF file is not of the right type\n");
|
||||
"this ELF file is not of the right type");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_linux_load64 (elf);
|
||||
else
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "Unknown ELF class");
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "unknown ELF class");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (!loaded)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first.");
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "you need to load the kernel first");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -405,14 +405,14 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (paddr == (grub_addr_t) -1)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"Could not allocate physical memory.");
|
||||
"couldn't allocate physical memory");
|
||||
goto fail;
|
||||
}
|
||||
ret = grub_ieee1275_map_physical (paddr, addr, size, IEEE1275_MAP_DEFAULT);
|
||||
if (ret)
|
||||
{
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"Could not map physical memory.");
|
||||
"couldn't map physical memory");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
if (grub_file_read (file, (void *) addr, size) != size)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, "couldn't read file");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -516,9 +516,9 @@ GRUB_MOD_INIT(linux)
|
|||
fetch_translations ();
|
||||
|
||||
cmd_linux = grub_register_command ("linux", grub_cmd_linux,
|
||||
0, "load a linux kernel");
|
||||
0, "Load Linux.");
|
||||
cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd,
|
||||
0, "load an initrd");
|
||||
0, "Load initrd.");
|
||||
my_mod = mod;
|
||||
}
|
||||
|
||||
|
|
40
loader/xnu.c
40
loader/xnu.c
|
@ -366,7 +366,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
|
|||
{
|
||||
grub_macho_close (macho);
|
||||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Kernel doesn't contain suitable 32-bit architecture");
|
||||
"kernel doesn't contain suitable 32-bit architecture");
|
||||
}
|
||||
|
||||
err = grub_macho_size32 (macho, &startcode, &endcode, GRUB_MACHO_NOBSS);
|
||||
|
@ -464,7 +464,7 @@ grub_cmd_xnu_kernel64 (grub_command_t cmd __attribute__ ((unused)),
|
|||
{
|
||||
grub_macho_close (macho);
|
||||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Kernel doesn't contain suitable 64-bit architecture");
|
||||
"kernel doesn't contain suitable 64-bit architecture");
|
||||
}
|
||||
|
||||
err = grub_macho_size64 (macho, &startcode, &endcode, GRUB_MACHO_NOBSS);
|
||||
|
@ -655,7 +655,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
|
|||
if (macho)
|
||||
grub_macho_close (macho);
|
||||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Extension doesn't contain suitable architecture");
|
||||
"extension doesn't contain suitable architecture");
|
||||
}
|
||||
if (grub_xnu_is_64bit)
|
||||
machosize = grub_macho_filesize64 (macho);
|
||||
|
@ -720,7 +720,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
|
|||
{
|
||||
grub_file_close (infoplist);
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s: ",
|
||||
return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s: ",
|
||||
infoplistname);
|
||||
}
|
||||
grub_file_close (infoplist);
|
||||
|
@ -764,7 +764,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
file = grub_gzfile_open (args[0], 1);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"Couldn't load driver package");
|
||||
"couldn't load driver package");
|
||||
|
||||
/* Sometimes caches are fat binary. Errgh. */
|
||||
if (grub_file_read (file, &head, sizeof (head))
|
||||
|
@ -774,7 +774,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
can hardly imagine a valid package shorter than 20 bytes. */
|
||||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]);
|
||||
return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", args[0]);
|
||||
}
|
||||
|
||||
/* Find the corresponding architecture. */
|
||||
|
@ -787,7 +787,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"Couldn't read file %s", args[0]);
|
||||
"couldn't read file %s", args[0]);
|
||||
|
||||
}
|
||||
if (grub_file_read (file, archs,
|
||||
|
@ -796,7 +796,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
{
|
||||
grub_free (archs);
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "Cannot read fat header.");
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "cannot read fat header");
|
||||
}
|
||||
for (i = 0; i < narchs; i++)
|
||||
{
|
||||
|
@ -849,7 +849,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
{
|
||||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]);
|
||||
return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", args[0]);
|
||||
}
|
||||
grub_file_close (file);
|
||||
|
||||
|
@ -876,7 +876,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
|||
file = grub_gzfile_open (args[0], 1);
|
||||
if (! file)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND,
|
||||
"Couldn't load ramdisk");
|
||||
"couldn't load ramdisk");
|
||||
|
||||
err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE);
|
||||
if (err)
|
||||
|
@ -892,7 +892,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)),
|
|||
{
|
||||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]);
|
||||
return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", args[0]);
|
||||
}
|
||||
return grub_xnu_register_memory ("RAMDisk", 0, loadto, size);
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
|
|||
{
|
||||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname);
|
||||
grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", plistname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -928,14 +928,14 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq,
|
|||
{
|
||||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't read file %s", plistname);
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't read file %s", plistname);
|
||||
return 0;
|
||||
}
|
||||
if (grub_file_read (file, buf, size) != (grub_ssize_t) (size))
|
||||
{
|
||||
grub_file_close (file);
|
||||
grub_error_push ();
|
||||
grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname);
|
||||
grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", plistname);
|
||||
return 0;
|
||||
}
|
||||
grub_file_close (file);
|
||||
|
@ -1425,23 +1425,23 @@ static grub_extcmd_t cmd_splash;
|
|||
GRUB_MOD_INIT(xnu)
|
||||
{
|
||||
cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0,
|
||||
"load a xnu kernel");
|
||||
"Load XNU image.");
|
||||
cmd_kernel64 = grub_register_command ("xnu_kernel64", grub_cmd_xnu_kernel64,
|
||||
0, "load a 64-bit xnu kernel");
|
||||
0, "Load 64-bit XNU image.");
|
||||
cmd_mkext = grub_register_command ("xnu_mkext", grub_cmd_xnu_mkext, 0,
|
||||
"Load XNU extension package.");
|
||||
cmd_kext = grub_register_command ("xnu_kext", grub_cmd_xnu_kext, 0,
|
||||
"Load XNU extension.");
|
||||
cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir,
|
||||
"xnu_kextdir DIRECTORY [OSBundleRequired]",
|
||||
"Load XNU extension directory");
|
||||
"DIRECTORY [OSBundleRequired]",
|
||||
"Load XNU extension directory.");
|
||||
cmd_ramdisk = grub_register_command ("xnu_ramdisk", grub_cmd_xnu_ramdisk, 0,
|
||||
"Load XNU ramdisk. "
|
||||
"It will be seen as md0");
|
||||
"It will be seen as md0.");
|
||||
cmd_splash = grub_register_extcmd ("xnu_splash",
|
||||
grub_cmd_xnu_splash,
|
||||
GRUB_COMMAND_FLAG_BOTH, 0,
|
||||
"Load a splash image for XNU",
|
||||
"Load a splash image for XNU.",
|
||||
xnu_splash_cmd_options);
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
|
|
|
@ -109,7 +109,7 @@ grub_xnu_resume (char *imagename)
|
|||
!= (grub_ssize_t) codesize)
|
||||
{
|
||||
grub_file_close (file);
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "Cannot read resume image.");
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "cannot read resume image");
|
||||
}
|
||||
|
||||
/* Read image. */
|
||||
|
@ -119,7 +119,7 @@ grub_xnu_resume (char *imagename)
|
|||
!= (grub_ssize_t) hibhead.image_size)
|
||||
{
|
||||
grub_file_close (file);
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "Cannot read resume image.");
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "cannot read resume image");
|
||||
}
|
||||
grub_file_close (file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue