pull-in func-params branch
This commit is contained in:
commit
3db1c9eee4
181 changed files with 7238 additions and 14702 deletions
|
@ -96,23 +96,8 @@ void grub_dl_unload_all (void);
|
|||
#else
|
||||
#define GRUB_NO_MODULES 0
|
||||
#endif
|
||||
#if GRUB_NO_MODULES
|
||||
static inline int
|
||||
grub_dl_ref (grub_dl_t mod)
|
||||
{
|
||||
(void) mod;
|
||||
return 0;
|
||||
}
|
||||
static inline int
|
||||
grub_dl_unref (grub_dl_t mod)
|
||||
{
|
||||
(void) mod;
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod);
|
||||
int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod);
|
||||
#endif
|
||||
void EXPORT_FUNC(grub_dl_iterate) (int (*hook) (grub_dl_t mod));
|
||||
grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name);
|
||||
grub_err_t grub_dl_register_symbol (const char *name, void *addr,
|
||||
|
|
|
@ -99,12 +99,8 @@ struct grub_pe32_optional_header
|
|||
grub_uint32_t entry_addr;
|
||||
grub_uint32_t code_base;
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 4
|
||||
grub_uint32_t data_base;
|
||||
grub_uint32_t image_base;
|
||||
#else
|
||||
grub_uint64_t image_base;
|
||||
#endif
|
||||
|
||||
grub_uint32_t section_alignment;
|
||||
grub_uint32_t file_alignment;
|
||||
|
@ -121,22 +117,11 @@ struct grub_pe32_optional_header
|
|||
grub_uint16_t subsystem;
|
||||
grub_uint16_t dll_characteristics;
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 4
|
||||
|
||||
grub_uint32_t stack_reserve_size;
|
||||
grub_uint32_t stack_commit_size;
|
||||
grub_uint32_t heap_reserve_size;
|
||||
grub_uint32_t heap_commit_size;
|
||||
|
||||
#else
|
||||
|
||||
grub_uint64_t stack_reserve_size;
|
||||
grub_uint64_t stack_commit_size;
|
||||
grub_uint64_t heap_reserve_size;
|
||||
grub_uint64_t heap_commit_size;
|
||||
|
||||
#endif
|
||||
|
||||
grub_uint32_t loader_flags;
|
||||
grub_uint32_t num_data_directories;
|
||||
|
||||
|
@ -159,15 +144,63 @@ struct grub_pe32_optional_header
|
|||
struct grub_pe32_data_directory reserved_entry;
|
||||
};
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 4
|
||||
struct grub_pe64_optional_header
|
||||
{
|
||||
grub_uint16_t magic;
|
||||
grub_uint8_t major_linker_version;
|
||||
grub_uint8_t minor_linker_version;
|
||||
grub_uint32_t code_size;
|
||||
grub_uint32_t data_size;
|
||||
grub_uint32_t bss_size;
|
||||
grub_uint32_t entry_addr;
|
||||
grub_uint32_t code_base;
|
||||
|
||||
grub_uint64_t image_base;
|
||||
|
||||
grub_uint32_t section_alignment;
|
||||
grub_uint32_t file_alignment;
|
||||
grub_uint16_t major_os_version;
|
||||
grub_uint16_t minor_os_version;
|
||||
grub_uint16_t major_image_version;
|
||||
grub_uint16_t minor_image_version;
|
||||
grub_uint16_t major_subsystem_version;
|
||||
grub_uint16_t minor_subsystem_version;
|
||||
grub_uint32_t reserved;
|
||||
grub_uint32_t image_size;
|
||||
grub_uint32_t header_size;
|
||||
grub_uint32_t checksum;
|
||||
grub_uint16_t subsystem;
|
||||
grub_uint16_t dll_characteristics;
|
||||
|
||||
grub_uint64_t stack_reserve_size;
|
||||
grub_uint64_t stack_commit_size;
|
||||
grub_uint64_t heap_reserve_size;
|
||||
grub_uint64_t heap_commit_size;
|
||||
|
||||
grub_uint32_t loader_flags;
|
||||
grub_uint32_t num_data_directories;
|
||||
|
||||
/* Data directories. */
|
||||
struct grub_pe32_data_directory export_table;
|
||||
struct grub_pe32_data_directory import_table;
|
||||
struct grub_pe32_data_directory resource_table;
|
||||
struct grub_pe32_data_directory exception_table;
|
||||
struct grub_pe32_data_directory certificate_table;
|
||||
struct grub_pe32_data_directory base_relocation_table;
|
||||
struct grub_pe32_data_directory debug;
|
||||
struct grub_pe32_data_directory architecture;
|
||||
struct grub_pe32_data_directory global_ptr;
|
||||
struct grub_pe32_data_directory tls_table;
|
||||
struct grub_pe32_data_directory load_config_table;
|
||||
struct grub_pe32_data_directory bound_import;
|
||||
struct grub_pe32_data_directory iat;
|
||||
struct grub_pe32_data_directory delay_import_descriptor;
|
||||
struct grub_pe32_data_directory com_runtime_header;
|
||||
struct grub_pe32_data_directory reserved_entry;
|
||||
};
|
||||
|
||||
#define GRUB_PE32_PE32_MAGIC 0x10b
|
||||
|
||||
#else
|
||||
|
||||
#define GRUB_PE32_PE32_MAGIC 0x20b
|
||||
|
||||
#endif
|
||||
#define GRUB_PE32_PE64_MAGIC 0x20b
|
||||
|
||||
#define GRUB_PE32_SUBSYSTEM_EFI_APPLICATION 10
|
||||
|
||||
|
@ -205,6 +238,7 @@ struct grub_pe32_section_table
|
|||
#define GRUB_PE32_SCN_ALIGN_SHIFT 20
|
||||
#define GRUB_PE32_SCN_ALIGN_MASK 7
|
||||
|
||||
#define GRUB_PE32_SIGNATURE_SIZE 4
|
||||
|
||||
struct grub_pe32_header
|
||||
{
|
||||
|
@ -212,13 +246,18 @@ struct grub_pe32_header
|
|||
grub_uint8_t msdos_stub[GRUB_PE32_MSDOS_STUB_SIZE];
|
||||
|
||||
/* This is always PE\0\0. */
|
||||
char signature[4];
|
||||
char signature[GRUB_PE32_SIGNATURE_SIZE];
|
||||
|
||||
/* The COFF file header. */
|
||||
struct grub_pe32_coff_header coff_header;
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 8
|
||||
/* The Optional header. */
|
||||
struct grub_pe64_optional_header optional_header;
|
||||
#else
|
||||
/* The Optional header. */
|
||||
struct grub_pe32_optional_header optional_header;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct grub_pe32_fixup_block
|
||||
|
|
|
@ -555,6 +555,7 @@ typedef struct
|
|||
#define PT_NUM 8 /* Number of defined types */
|
||||
#define PT_LOOS 0x60000000 /* Start of OS-specific */
|
||||
#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */
|
||||
#define PT_GNU_STACK 0x6474e551 /* GCC stack segment */
|
||||
#define PT_LOSUNW 0x6ffffffa
|
||||
#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
|
||||
#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */
|
||||
|
|
|
@ -26,7 +26,6 @@ enum grub_dev_abstraction_types {
|
|||
};
|
||||
|
||||
char *grub_guess_root_device (const char *dir);
|
||||
char *grub_get_prefix (const char *dir);
|
||||
int grub_util_get_dev_abstraction (const char *os_dev);
|
||||
char *grub_util_get_grub_dev (const char *os_dev);
|
||||
const char *grub_util_check_block_device (const char *blk_dev);
|
50
include/grub/emu/misc.h
Normal file
50
include/grub/emu/misc.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#ifndef GRUB_EMU_MISC_H
|
||||
#define GRUB_EMU_MISC_H 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# include <sys/fcntl.h>
|
||||
# include <sys/cygwin.h>
|
||||
# include <limits.h>
|
||||
# define DEV_CYGDRIVE_MAJOR 98
|
||||
#endif
|
||||
|
||||
#ifdef __NetBSD__
|
||||
/* NetBSD uses /boot for its boot block. */
|
||||
# define DEFAULT_DIRECTORY "/grub"
|
||||
#else
|
||||
# define DEFAULT_DIRECTORY "/boot/grub"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"
|
||||
|
||||
extern int verbosity;
|
||||
extern const char *program_name;
|
||||
|
||||
void grub_init_all (void);
|
||||
void grub_fini_all (void);
|
||||
|
||||
char *grub_make_system_path_relative_to_its_root (const char *path);
|
||||
|
||||
void * EXPORT_FUNC(xmalloc) (grub_size_t size);
|
||||
void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size);
|
||||
char * EXPORT_FUNC(xstrdup) (const char *str);
|
||||
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
|
||||
|
||||
void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...);
|
||||
void EXPORT_FUNC(grub_util_info) (const char *fmt, ...);
|
||||
void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((noreturn));
|
||||
|
||||
#ifndef HAVE_VASPRINTF
|
||||
int EXPORT_FUNC(vasprintf) (char **buf, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ASPRINTF
|
||||
int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
char * EXPORT_FUNC(xasprintf) (const char *fmt, ...);
|
||||
|
||||
#endif /* GRUB_EMU_MISC_H */
|
|
@ -22,10 +22,15 @@
|
|||
#include <grub/video.h>
|
||||
#include <grub/bitmap.h>
|
||||
#include <grub/gfxmenu_view.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
#ifndef GRUB_GUI_H
|
||||
#define GRUB_GUI_H 1
|
||||
|
||||
/* The component ID identifying GUI components to be updated as the timeout
|
||||
status changes. */
|
||||
#define GRUB_GFXMENU_TIMEOUT_COMPONENT_ID "__timeout__"
|
||||
|
||||
/* A representation of a color. Unlike grub_video_color_t, this
|
||||
representation is independent of any video mode specifics. */
|
||||
typedef struct grub_gui_color
|
||||
|
@ -79,6 +84,46 @@ struct grub_gui_progress_ops
|
|||
void (*set_state) (void *self, int visible, int start, int current, int end);
|
||||
};
|
||||
|
||||
typedef void (*grub_gfxmenu_set_state_t) (void *self, int visible, int start,
|
||||
int current, int end);
|
||||
|
||||
struct grub_gfxmenu_timeout_notify
|
||||
{
|
||||
struct grub_gfxmenu_timeout_notify *next;
|
||||
grub_gfxmenu_set_state_t set_state;
|
||||
grub_gui_component_t self;
|
||||
};
|
||||
|
||||
extern struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications;
|
||||
|
||||
static inline grub_err_t
|
||||
grub_gfxmenu_timeout_register (grub_gui_component_t self,
|
||||
grub_gfxmenu_set_state_t set_state)
|
||||
{
|
||||
struct grub_gfxmenu_timeout_notify *ne = grub_malloc (sizeof (*ne));
|
||||
if (!ne)
|
||||
return grub_errno;
|
||||
ne->set_state = set_state;
|
||||
ne->self = self;
|
||||
ne->next = grub_gfxmenu_timeout_notifications;
|
||||
grub_gfxmenu_timeout_notifications = ne;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static inline void
|
||||
grub_gfxmenu_timeout_unregister (grub_gui_component_t self)
|
||||
{
|
||||
struct grub_gfxmenu_timeout_notify **p, *q;
|
||||
|
||||
for (p = &grub_gfxmenu_timeout_notifications, q = *p;
|
||||
q; p = &(q->next), q = q->next)
|
||||
if (q->self == self)
|
||||
{
|
||||
*p = q->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
typedef signed grub_fixed_signed_t;
|
||||
#define GRUB_FIXED_1 0x10000
|
||||
|
||||
|
|
|
@ -42,17 +42,33 @@ extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
|
|||
On pre-ANSI systems without 'const', the config.h file is supposed to
|
||||
contain "#define const". */
|
||||
# ifdef GRUB_UTIL
|
||||
# define gettext(Msgid) ((const char *) (Msgid))
|
||||
static inline const char * __attribute__ ((always_inline))
|
||||
gettext (const char *str)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
# else
|
||||
# define grub_gettext(str) ((const char *) (str))
|
||||
static inline const char * __attribute__ ((always_inline))
|
||||
grub_gettext (const char *str)
|
||||
{
|
||||
return str;
|
||||
}
|
||||
# endif /* GRUB_UTIL */
|
||||
|
||||
#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
# define _(str) gettext(str)
|
||||
static inline const char * __attribute__ ((always_inline))
|
||||
_ (const char *str)
|
||||
{
|
||||
return gettext(str);
|
||||
}
|
||||
#else
|
||||
# define _(str) grub_gettext(str)
|
||||
static inline const char * __attribute__ ((always_inline))
|
||||
_ (const char *str)
|
||||
{
|
||||
return grub_gettext(str);
|
||||
}
|
||||
#endif /* GRUB_UTIL */
|
||||
|
||||
#define N_(str) str
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,2007,2008 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
extern char grub_prefix[];
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
|
@ -44,8 +44,9 @@ typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t;
|
|||
|
||||
struct grub_linuxbios_table_item
|
||||
{
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 1
|
||||
#define GRUB_LINUXBIOS_MEMBER_UNUSED 0x00
|
||||
#define GRUB_LINUXBIOS_MEMBER_MEMORY 0x01
|
||||
#define GRUB_LINUXBIOS_MEMBER_LINK 0x11
|
||||
grub_uint32_t tag;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2003,2007 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_MACHINE_KERNEL_HEADER
|
||||
#define GRUB_MACHINE_KERNEL_HEADER 1
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX 0x8
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END 0x50
|
||||
|
||||
#endif /* ! GRUB_MACHINE_KERNEL_HEADER */
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include <grub/powerpc/ieee1275/kernel.h>
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_KERNEL_CPU_HEADER
|
||||
#define GRUB_KERNEL_CPU_HEADER 1
|
||||
|
||||
|
||||
#ifdef GRUB_MACHINE_IEEE1275
|
||||
#define GRUB_MOD_ALIGN 0x1000
|
||||
#else
|
||||
#define GRUB_MOD_ALIGN 0x1
|
||||
#endif
|
||||
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_MOD_GAP 0x0
|
||||
|
||||
#define GRUB_KERNEL_CPU_PREFIX 0x2
|
||||
#define GRUB_KERNEL_CPU_DATA_END 0x42
|
||||
|
||||
#endif
|
1
include/grub/i386/multiboot/boot.h
Normal file
1
include/grub/i386/multiboot/boot.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/boot.h>
|
1
include/grub/i386/multiboot/console.h
Normal file
1
include/grub/i386/multiboot/console.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/console.h>
|
1
include/grub/i386/multiboot/init.h
Normal file
1
include/grub/i386/multiboot/init.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/init.h>
|
1
include/grub/i386/multiboot/kernel.h
Normal file
1
include/grub/i386/multiboot/kernel.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/kernel.h>
|
1
include/grub/i386/multiboot/loader.h
Normal file
1
include/grub/i386/multiboot/loader.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/loader.h>
|
1
include/grub/i386/multiboot/memory.h
Normal file
1
include/grub/i386/multiboot/memory.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/memory.h>
|
1
include/grub/i386/multiboot/serial.h
Normal file
1
include/grub/i386/multiboot/serial.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/serial.h>
|
1
include/grub/i386/multiboot/time.h
Normal file
1
include/grub/i386/multiboot/time.h
Normal file
|
@ -0,0 +1 @@
|
|||
#include <grub/i386/coreboot/time.h>
|
|
@ -19,6 +19,8 @@
|
|||
#ifndef GRUB_BOOT_MACHINE_HEADER
|
||||
#define GRUB_BOOT_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/offsets.h>
|
||||
|
||||
/* The signature for bootloader. */
|
||||
#define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55
|
||||
|
||||
|
@ -57,9 +59,6 @@
|
|||
floppy. */
|
||||
#define GRUB_BOOT_MACHINE_BIOS_HD_FLAG 0x80
|
||||
|
||||
/* The segment where the kernel is loaded. */
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_SEG 0x800
|
||||
|
||||
/* The address where the kernel is loaded. */
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4)
|
||||
|
||||
|
@ -68,16 +67,7 @@
|
|||
|
||||
#define GRUB_BOOT_MACHINE_PXE_DL 0x7f
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
/* This is the blocklist used in the diskboot image. */
|
||||
struct grub_boot_blocklist
|
||||
{
|
||||
grub_uint64_t start;
|
||||
grub_uint16_t len;
|
||||
grub_uint16_t segment;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
#define grub_boot_blocklist grub_pc_bios_boot_blocklist
|
||||
|
||||
#endif /* ! BOOT_MACHINE_HEADER */
|
||||
|
|
|
@ -19,29 +19,7 @@
|
|||
#ifndef KERNEL_MACHINE_HEADER
|
||||
#define KERNEL_MACHINE_HEADER 1
|
||||
|
||||
/* The offset of GRUB_TOTAL_MODULE_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE 0x8
|
||||
|
||||
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc
|
||||
|
||||
/* The offset of GRUB_COMPRESSED_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE 0x10
|
||||
|
||||
/* The offset of GRUB_INSTALL_DOS_PART. */
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_DOS_PART 0x14
|
||||
|
||||
/* The offset of GRUB_INSTALL_BSD_PART. */
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART 0x18
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX 0x1c
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END 0x5c
|
||||
|
||||
/* The size of the first region which won't be compressed. */
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x5F0)
|
||||
#include <grub/offsets.h>
|
||||
|
||||
/* Enable LZMA compression */
|
||||
#define ENABLE_LZMA 1
|
||||
|
@ -63,10 +41,6 @@ extern grub_int32_t grub_install_dos_part;
|
|||
/* The BSD partition number of the installed partition. */
|
||||
extern grub_int32_t grub_install_bsd_part;
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
/* The boot BIOS drive number. */
|
||||
extern grub_uint8_t EXPORT_VAR(grub_boot_drive);
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
|
||||
#include <grub/i386/memory.h>
|
||||
|
||||
#include <grub/offsets.h>
|
||||
|
||||
/* The scratch buffer used in real mode code. */
|
||||
#define GRUB_MEMORY_MACHINE_SCRATCH_ADDR 0x68000
|
||||
#define GRUB_MEMORY_MACHINE_SCRATCH_SEG (GRUB_MEMORY_MACHINE_SCRATCH_ADDR >> 4)
|
||||
|
@ -40,9 +42,6 @@
|
|||
/* The size of the protect mode stack. */
|
||||
#define GRUB_MEMORY_MACHINE_PROT_STACK_SIZE 0x8000
|
||||
|
||||
/* The upper memory area (starting at 640 kiB). */
|
||||
#define GRUB_MEMORY_MACHINE_UPPER 0xa0000
|
||||
|
||||
/* The protected mode stack. */
|
||||
#define GRUB_MEMORY_MACHINE_PROT_STACK \
|
||||
(GRUB_MEMORY_MACHINE_SCRATCH_ADDR + GRUB_MEMORY_MACHINE_SCRATCH_SIZE \
|
||||
|
|
|
@ -22,7 +22,4 @@
|
|||
/* The size of boot.img. */
|
||||
#define GRUB_BOOT_MACHINE_SIZE (0x100000 - GRUB_BOOT_MACHINE_LINK_ADDR)
|
||||
|
||||
/* The offset of GRUB_CORE_ENTRY_ADDR. */
|
||||
#define GRUB_BOOT_MACHINE_CORE_ENTRY_ADDR 0x4
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,17 +19,7 @@
|
|||
#ifndef GRUB_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
/* The offset of GRUB_CORE_ENTRY_ADDR. */
|
||||
#define GRUB_KERNEL_MACHINE_CORE_ENTRY_ADDR 0x8
|
||||
|
||||
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX 0x10
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END 0x50
|
||||
#include <grub/offsets.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
|
@ -44,10 +34,6 @@ extern grub_int32_t grub_kernel_image_size;
|
|||
/* The total size of module images following the kernel. */
|
||||
extern grub_int32_t grub_total_module_size;
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
||||
|
|
|
@ -100,6 +100,9 @@ enum grub_ieee1275_flag
|
|||
|
||||
/* Open Hack'Ware don't support the ANSI sequence. */
|
||||
GRUB_IEEE1275_FLAG_NO_ANSI,
|
||||
|
||||
/* OpenFirmware hangs on qemu if one requests any memory below 1.5 MiB. */
|
||||
GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM,
|
||||
};
|
||||
|
||||
extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag);
|
||||
|
|
|
@ -42,19 +42,33 @@ struct grub_module_header
|
|||
/* "gmim" (GRUB Module Info Magic). */
|
||||
#define GRUB_MODULE_MAGIC 0x676d696d
|
||||
|
||||
struct grub_module_info
|
||||
struct grub_module_info32
|
||||
{
|
||||
/* Magic number so we know we have modules present. */
|
||||
grub_uint32_t magic;
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 8
|
||||
grub_uint32_t padding;
|
||||
#endif
|
||||
/* The offset of the modules. */
|
||||
grub_target_off_t offset;
|
||||
grub_uint32_t offset;
|
||||
/* The size of all modules plus this header. */
|
||||
grub_target_size_t size;
|
||||
grub_uint32_t size;
|
||||
};
|
||||
|
||||
struct grub_module_info64
|
||||
{
|
||||
/* Magic number so we know we have modules present. */
|
||||
grub_uint32_t magic;
|
||||
grub_uint32_t padding;
|
||||
/* The offset of the modules. */
|
||||
grub_uint64_t offset;
|
||||
/* The size of all modules plus this header. */
|
||||
grub_uint64_t size;
|
||||
};
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 8
|
||||
#define grub_module_info grub_module_info64
|
||||
#else
|
||||
#define grub_module_info grub_module_info32
|
||||
#endif
|
||||
|
||||
extern grub_addr_t grub_arch_modules_addr (void);
|
||||
|
||||
extern void EXPORT_FUNC(grub_module_iterate) (int (*hook) (struct grub_module_header *));
|
||||
|
@ -76,4 +90,8 @@ void grub_machine_set_prefix (void);
|
|||
/* Register all the exported symbols. This is automatically generated. */
|
||||
void grub_register_exported_symbols (void);
|
||||
|
||||
#if ! defined (ASM_FILE) && !defined (GRUB_MACHINE_EMU)
|
||||
extern char grub_prefix[];
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_KERNEL_HEADER */
|
||||
|
|
|
@ -47,6 +47,8 @@ struct grub_menu_entry
|
|||
/* The sourcecode of the menu entry, used by the editor. */
|
||||
const char *sourcecode;
|
||||
|
||||
int hotkey;
|
||||
|
||||
/* The next element. */
|
||||
struct grub_menu_entry *next;
|
||||
};
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,2007,2008 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_KERNEL_CPU_HEADER
|
||||
#define GRUB_KERNEL_CPU_HEADER 1
|
||||
|
||||
#define GRUB_MOD_ALIGN 0x1
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_MOD_GAP 0x0
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_LINK_ALIGN 32
|
||||
|
||||
#define GRUB_KERNEL_CPU_RAW_SIZE 0x200
|
||||
#define GRUB_KERNEL_CPU_COMPRESSED_SIZE 0x8
|
||||
#define GRUB_KERNEL_CPU_TOTAL_MODULE_SIZE 0xc
|
||||
#define GRUB_KERNEL_CPU_KERNEL_IMAGE_SIZE 0x10
|
||||
|
||||
#define GRUB_KERNEL_CPU_PREFIX GRUB_KERNEL_CPU_RAW_SIZE
|
||||
#define GRUB_KERNEL_CPU_DATA_END GRUB_KERNEL_CPU_RAW_SIZE + 0x48
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE GRUB_KERNEL_CPU_RAW_SIZE
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX GRUB_KERNEL_CPU_PREFIX
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END GRUB_KERNEL_CPU_DATA_END
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE GRUB_KERNEL_CPU_KERNEL_IMAGE_SIZE
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_KERNEL_CPU_TOTAL_MODULE_SIZE
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_KERNEL_CPU_COMPRESSED_SIZE
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_FORMATS "raw, elf"
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT "raw"
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT GRUB_PLATFORM_IMAGE_RAW
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef enum {
|
||||
GRUB_PLATFORM_IMAGE_RAW,
|
||||
GRUB_PLATFORM_IMAGE_ELF
|
||||
}
|
||||
grub_platform_image_format_t;
|
||||
#define GRUB_PLATFORM_IMAGE_RAW GRUB_PLATFORM_IMAGE_RAW
|
||||
#define GRUB_PLATFORM_IMAGE_ELF GRUB_PLATFORM_IMAGE_ELF
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -27,10 +27,6 @@
|
|||
void EXPORT_FUNC (grub_reboot) (void);
|
||||
void EXPORT_FUNC (grub_halt) (void);
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/cpu/kernel.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ void grub_multiboot_set_bootdev (void);
|
|||
grub_uint32_t grub_get_multiboot_mmap_count (void);
|
||||
grub_err_t grub_multiboot_set_video_mode (void);
|
||||
|
||||
#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU)
|
||||
#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU)
|
||||
#include <grub/i386/pc/vbe.h>
|
||||
#define GRUB_MACHINE_HAS_VGA_TEXT 1
|
||||
#else
|
||||
|
|
173
include/grub/offsets.h
Normal file
173
include/grub/offsets.h
Normal file
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2003,2007,2008 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OFFSETS_HEADER
|
||||
#define OFFSETS_HEADER 1
|
||||
|
||||
/* The offset of GRUB_TOTAL_MODULE_SIZE. */
|
||||
#define GRUB_KERNEL_I386_PC_TOTAL_MODULE_SIZE 0x8
|
||||
|
||||
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */
|
||||
#define GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE 0xc
|
||||
|
||||
/* The offset of GRUB_COMPRESSED_SIZE. */
|
||||
#define GRUB_KERNEL_I386_PC_COMPRESSED_SIZE 0x10
|
||||
|
||||
/* The offset of GRUB_INSTALL_DOS_PART. */
|
||||
#define GRUB_KERNEL_I386_PC_INSTALL_DOS_PART 0x14
|
||||
|
||||
/* The offset of GRUB_INSTALL_BSD_PART. */
|
||||
#define GRUB_KERNEL_I386_PC_INSTALL_BSD_PART 0x18
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_I386_PC_PREFIX 0x1c
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_PC_DATA_END 0x5c
|
||||
|
||||
/* The size of the first region which won't be compressed. */
|
||||
#define GRUB_KERNEL_I386_PC_RAW_SIZE (GRUB_KERNEL_I386_PC_DATA_END + 0x5F0)
|
||||
|
||||
/* The segment where the kernel is loaded. */
|
||||
#define GRUB_BOOT_I386_PC_KERNEL_SEG 0x800
|
||||
|
||||
#define GRUB_KERNEL_I386_PC_LINK_ADDR 0x8200
|
||||
|
||||
/* The upper memory area (starting at 640 kiB). */
|
||||
#define GRUB_MEMORY_I386_PC_UPPER 0xa0000
|
||||
#define GRUB_MEMORY_I386_QEMU_UPPER GRUB_MEMORY_I386_PC_UPPER
|
||||
|
||||
/* The offset of GRUB_CORE_ENTRY_ADDR. */
|
||||
#define GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR 0x4
|
||||
|
||||
/* The offset of GRUB_CORE_ENTRY_ADDR. */
|
||||
#define GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR 0x8
|
||||
|
||||
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */
|
||||
#define GRUB_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE 0xc
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_I386_QEMU_PREFIX 0x10
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_QEMU_DATA_END 0x50
|
||||
|
||||
#define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x8200
|
||||
|
||||
/* The offset of GRUB_TOTAL_MODULE_SIZE. */
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8
|
||||
|
||||
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE 0xc
|
||||
|
||||
/* The offset of GRUB_COMPRESSED_SIZE. */
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE 0x10
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_PREFIX 0x14
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_DATA_END 0x114
|
||||
|
||||
#define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12
|
||||
|
||||
#define GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS 0x4400
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_RAW_SIZE 0
|
||||
#define GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR 0x4400
|
||||
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_PREFIX 0x4
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_DATA_END 0x44
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
|
||||
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_LINK_ADDR 0x80200000
|
||||
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_LINK_ALIGN 32
|
||||
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE 0x200
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_COMPRESSED_SIZE 0x8
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_TOTAL_MODULE_SIZE 0xc
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_KERNEL_IMAGE_SIZE 0x10
|
||||
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_PREFIX GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_DATA_END GRUB_KERNEL_MIPS_YEELOONG_RAW_SIZE + 0x48
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_I386_EFI_PREFIX 0x8
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_I386_EFI_DATA_END 0x50
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_X86_64_EFI_PREFIX 0x8
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_X86_64_EFI_DATA_END 0x50
|
||||
|
||||
#define GRUB_KERNEL_I386_COREBOOT_PREFIX 0x2
|
||||
#define GRUB_KERNEL_I386_COREBOOT_DATA_END 0x42
|
||||
#define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200
|
||||
|
||||
#define GRUB_KERNEL_I386_IEEE1275_PREFIX 0x2
|
||||
#define GRUB_KERNEL_I386_IEEE1275_DATA_END 0x42
|
||||
#define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000
|
||||
|
||||
#define GRUB_KERNEL_I386_IEEE1275_MOD_ALIGN 0x1000
|
||||
#define GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN 0x1
|
||||
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_KERNEL_I386_IEEE1275_MOD_GAP 0x0
|
||||
#define GRUB_KERNEL_I386_COREBOOT_MOD_GAP 0x0
|
||||
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000
|
||||
|
||||
#define GRUB_KERNEL_MIPS_YEELOONG_MOD_ALIGN 0x1
|
||||
|
||||
/* Minimal gap between _end and the start of the modules. It's a hack
|
||||
for PowerMac to prevent "CLAIM failed" error. The real fix is to
|
||||
rewrite grub-mkimage to generate valid ELF files. */
|
||||
#define GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000
|
||||
|
||||
#ifdef MACHINE
|
||||
#define GRUB_OFFSETS_CONCAT_(a,b,c) a ## b ## c
|
||||
#define GRUB_OFFSETS_CONCAT(a,b,c) GRUB_OFFSETS_CONCAT_(a,b,c)
|
||||
#define GRUB_KERNEL_MACHINE_MOD_ALIGN GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _MOD_ALIGN)
|
||||
#define GRUB_KERNEL_MACHINE_MOD_GAP GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _MOD_GAP)
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _TOTAL_MODULE_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _KERNEL_IMAGE_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _COMPRESSED_SIZE)
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _PREFIX)
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _DATA_END)
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_SEG GRUB_OFFSETS_CONCAT (GRUB_BOOT_, MACHINE, _KERNEL_SEG)
|
||||
#define GRUB_MEMORY_MACHINE_UPPER GRUB_OFFSETS_CONCAT (GRUB_MEMORY_, MACHINE, _UPPER)
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _RAW_SIZE)
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _INSTALL_BSD_PART)
|
||||
#define GRUB_KERNEL_MACHINE_INSTALL_DOS_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, MACHINE, _INSTALL_DOS_PART)
|
||||
#endif
|
||||
|
||||
#ifndef ASM_FILE
|
||||
struct grub_pc_bios_boot_blocklist
|
||||
{
|
||||
grub_uint64_t start;
|
||||
grub_uint16_t len;
|
||||
grub_uint16_t segment;
|
||||
} __attribute__ ((packed));
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,2007,2008 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
|
@ -19,14 +19,4 @@
|
|||
#ifndef GRUB_KERNEL_CPU_HEADER
|
||||
#define GRUB_KERNEL_CPU_HEADER 1
|
||||
|
||||
#define GRUB_MOD_ALIGN 0x1000
|
||||
|
||||
/* Minimal gap between _end and the start of the modules. It's a hack
|
||||
for PowerMac to prevent "CLAIM failed" error. The real fix is to
|
||||
rewrite grub-mkimage to generate valid ELF files. */
|
||||
#define GRUB_MOD_GAP 0x8000
|
||||
|
||||
#define GRUB_KERNEL_CPU_PREFIX 0x4
|
||||
#define GRUB_KERNEL_CPU_DATA_END 0x44
|
||||
|
||||
#endif
|
||||
|
|
|
@ -67,6 +67,13 @@ struct grub_script_arg
|
|||
struct grub_script_arg *next;
|
||||
};
|
||||
|
||||
/* An argument vector. */
|
||||
struct grub_script_argv
|
||||
{
|
||||
unsigned argc;
|
||||
char **args;
|
||||
};
|
||||
|
||||
/* A complete argument. It consists of a list of one or more `struct
|
||||
grub_script_arg's. */
|
||||
struct grub_script_arglist
|
||||
|
@ -86,15 +93,6 @@ struct grub_script_cmdline
|
|||
struct grub_script_arglist *arglist;
|
||||
};
|
||||
|
||||
/* A block of commands, this can be used to group commands. */
|
||||
struct grub_script_cmdblock
|
||||
{
|
||||
struct grub_script_cmd cmd;
|
||||
|
||||
/* A chain of commands. */
|
||||
struct grub_script_cmd *cmdlist;
|
||||
};
|
||||
|
||||
/* An if statement. */
|
||||
struct grub_script_cmdif
|
||||
{
|
||||
|
@ -228,6 +226,11 @@ struct grub_parser_param
|
|||
struct grub_lexer_param *lexerstate;
|
||||
};
|
||||
|
||||
void grub_script_argv_free (struct grub_script_argv *argv);
|
||||
int grub_script_argv_next (struct grub_script_argv *argv);
|
||||
int grub_script_argv_append (struct grub_script_argv *argv, const char *s);
|
||||
int grub_script_argv_split_append (struct grub_script_argv *argv, char *s);
|
||||
|
||||
struct grub_script_arglist *
|
||||
grub_script_create_arglist (struct grub_parser_param *state);
|
||||
|
||||
|
@ -238,8 +241,6 @@ grub_script_add_arglist (struct grub_parser_param *state,
|
|||
struct grub_script_cmd *
|
||||
grub_script_create_cmdline (struct grub_parser_param *state,
|
||||
struct grub_script_arglist *arglist);
|
||||
struct grub_script_cmd *
|
||||
grub_script_create_cmdblock (struct grub_parser_param *state);
|
||||
|
||||
struct grub_script_cmd *
|
||||
grub_script_create_cmdif (struct grub_parser_param *state,
|
||||
|
@ -266,9 +267,9 @@ grub_script_create_cmdmenu (struct grub_parser_param *state,
|
|||
int options);
|
||||
|
||||
struct grub_script_cmd *
|
||||
grub_script_add_cmd (struct grub_parser_param *state,
|
||||
struct grub_script_cmdblock *cmdblock,
|
||||
struct grub_script_cmd *cmd);
|
||||
grub_script_append_cmd (struct grub_parser_param *state,
|
||||
struct grub_script_cmd *list,
|
||||
struct grub_script_cmd *last);
|
||||
struct grub_script_arg *
|
||||
grub_script_arg_add (struct grub_parser_param *state,
|
||||
struct grub_script_arg *arg,
|
||||
|
@ -305,7 +306,7 @@ void grub_script_yyerror (struct grub_parser_param *, char const *);
|
|||
|
||||
/* Commands to execute, don't use these directly. */
|
||||
grub_err_t grub_script_execute_cmdline (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdblock (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdlist (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdif (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdfor (struct grub_script_cmd *cmd);
|
||||
grub_err_t grub_script_execute_cmdwhile (struct grub_script_cmd *cmd);
|
||||
|
@ -344,8 +345,8 @@ grub_script_function_t grub_script_function_create (struct grub_script_arg *func
|
|||
void grub_script_function_remove (const char *name);
|
||||
grub_script_function_t grub_script_function_find (char *functionname);
|
||||
int grub_script_function_iterate (int (*iterate) (grub_script_function_t));
|
||||
int grub_script_function_call (grub_script_function_t func,
|
||||
int argc, char **args);
|
||||
grub_err_t grub_script_function_call (grub_script_function_t func,
|
||||
int argc, char **args);
|
||||
|
||||
char **
|
||||
grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);
|
||||
|
|
|
@ -50,10 +50,6 @@
|
|||
#define GRUB_BOOT_MACHINE_CODE_END \
|
||||
(0x1fc - GRUB_BOOT_AOUT_HEADER_SIZE)
|
||||
|
||||
#define GRUB_BOOT_MACHINE_LIST_SIZE 12
|
||||
|
||||
#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x4400
|
||||
|
||||
#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200
|
||||
|
||||
#endif /* ! BOOT_MACHINE_HEADER */
|
||||
|
|
|
@ -19,44 +19,10 @@
|
|||
#ifndef GRUB_KERNEL_MACHINE_HEADER
|
||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||
|
||||
#define GRUB_MOD_ALIGN 0x2000
|
||||
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_MOD_GAP 0x0
|
||||
|
||||
/* The offset of GRUB_TOTAL_MODULE_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE 0x8
|
||||
|
||||
/* The offset of GRUB_KERNEL_IMAGE_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc
|
||||
|
||||
/* The offset of GRUB_COMPRESSED_SIZE. */
|
||||
#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE 0x10
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX 0x14
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END 0x114
|
||||
|
||||
#define GRUB_KERNEL_MACHINE_RAW_SIZE 0
|
||||
#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_FORMATS "raw, aout"
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT "raw"
|
||||
|
||||
#define GRUB_PLATFORM_IMAGE_DEFAULT GRUB_PLATFORM_IMAGE_RAW
|
||||
|
||||
#ifndef ASM_FILE
|
||||
|
||||
typedef enum {
|
||||
GRUB_PLATFORM_IMAGE_RAW,
|
||||
GRUB_PLATFORM_IMAGE_AOUT
|
||||
}
|
||||
grub_platform_image_format_t;
|
||||
#define GRUB_PLATFORM_IMAGE_RAW GRUB_PLATFORM_IMAGE_RAW
|
||||
#define GRUB_PLATFORM_IMAGE_AOUT GRUB_PLATFORM_IMAGE_AOUT
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/types.h>
|
||||
|
||||
|
@ -66,10 +32,6 @@ extern grub_int32_t grub_kernel_image_size;
|
|||
/* The total size of module images following the kernel. */
|
||||
extern grub_int32_t grub_total_module_size;
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
#endif /* ! ASM_FILE */
|
||||
|
||||
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2005,2006,2007,2008 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_KERNEL_CPU_HEADER
|
||||
#define GRUB_KERNEL_CPU_HEADER 1
|
||||
|
||||
#define GRUB_MOD_ALIGN 0x2000
|
||||
|
||||
/* Non-zero value is only needed for PowerMacs. */
|
||||
#define GRUB_MOD_GAP 0x0
|
||||
|
||||
#define GRUB_KERNEL_CPU_PREFIX 0x2
|
||||
#define GRUB_KERNEL_CPU_DATA_END 0x42
|
||||
|
||||
#endif
|
|
@ -178,21 +178,6 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
|
|||
# define grub_be_to_cpu16(x) ((grub_uint16_t) (x))
|
||||
# define grub_be_to_cpu32(x) ((grub_uint32_t) (x))
|
||||
# define grub_be_to_cpu64(x) ((grub_uint64_t) (x))
|
||||
# ifdef GRUB_TARGET_WORDS_BIGENDIAN
|
||||
# define grub_target_to_host16(x) ((grub_uint16_t) (x))
|
||||
# define grub_target_to_host32(x) ((grub_uint32_t) (x))
|
||||
# define grub_target_to_host64(x) ((grub_uint64_t) (x))
|
||||
# define grub_host_to_target16(x) ((grub_uint16_t) (x))
|
||||
# define grub_host_to_target32(x) ((grub_uint32_t) (x))
|
||||
# define grub_host_to_target64(x) ((grub_uint64_t) (x))
|
||||
# else /* ! GRUB_TARGET_WORDS_BIGENDIAN */
|
||||
# define grub_target_to_host16(x) grub_swap_bytes16(x)
|
||||
# define grub_target_to_host32(x) grub_swap_bytes32(x)
|
||||
# define grub_target_to_host64(x) grub_swap_bytes64(x)
|
||||
# define grub_host_to_target16(x) grub_swap_bytes16(x)
|
||||
# define grub_host_to_target32(x) grub_swap_bytes32(x)
|
||||
# define grub_host_to_target64(x) grub_swap_bytes64(x)
|
||||
# endif
|
||||
#else /* ! WORDS_BIGENDIAN */
|
||||
# define grub_cpu_to_le16(x) ((grub_uint16_t) (x))
|
||||
# define grub_cpu_to_le32(x) ((grub_uint32_t) (x))
|
||||
|
@ -206,27 +191,6 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x)
|
|||
# define grub_be_to_cpu16(x) grub_swap_bytes16(x)
|
||||
# define grub_be_to_cpu32(x) grub_swap_bytes32(x)
|
||||
# define grub_be_to_cpu64(x) grub_swap_bytes64(x)
|
||||
# ifdef GRUB_TARGET_WORDS_BIGENDIAN
|
||||
# define grub_target_to_host16(x) grub_swap_bytes16(x)
|
||||
# define grub_target_to_host32(x) grub_swap_bytes32(x)
|
||||
# define grub_target_to_host64(x) grub_swap_bytes64(x)
|
||||
# define grub_host_to_target16(x) grub_swap_bytes16(x)
|
||||
# define grub_host_to_target32(x) grub_swap_bytes32(x)
|
||||
# define grub_host_to_target64(x) grub_swap_bytes64(x)
|
||||
# else /* ! GRUB_TARGET_WORDS_BIGENDIAN */
|
||||
# define grub_target_to_host16(x) ((grub_uint16_t) (x))
|
||||
# define grub_target_to_host32(x) ((grub_uint32_t) (x))
|
||||
# define grub_target_to_host64(x) ((grub_uint64_t) (x))
|
||||
# define grub_host_to_target16(x) ((grub_uint16_t) (x))
|
||||
# define grub_host_to_target32(x) ((grub_uint32_t) (x))
|
||||
# define grub_host_to_target64(x) ((grub_uint64_t) (x))
|
||||
# endif
|
||||
#endif /* ! WORDS_BIGENDIAN */
|
||||
|
||||
#if GRUB_TARGET_SIZEOF_VOID_P == 8
|
||||
# define grub_host_to_target_addr(x) grub_host_to_target64(x)
|
||||
#else
|
||||
# define grub_host_to_target_addr(x) grub_host_to_target32(x)
|
||||
#endif
|
||||
|
||||
#endif /* ! GRUB_TYPES_HEADER */
|
||||
|
|
|
@ -28,26 +28,7 @@
|
|||
#include <config.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/symbol.h>
|
||||
|
||||
#ifdef __NetBSD__
|
||||
/* NetBSD uses /boot for its boot block. */
|
||||
# define DEFAULT_DIRECTORY "/grub"
|
||||
#else
|
||||
# define DEFAULT_DIRECTORY "/boot/grub"
|
||||
#endif
|
||||
|
||||
#define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"
|
||||
|
||||
extern char *progname;
|
||||
extern int verbosity;
|
||||
|
||||
void EXPORT_FUNC(grub_util_warn) (const char *fmt, ...);
|
||||
void EXPORT_FUNC(grub_util_info) (const char *fmt, ...);
|
||||
void EXPORT_FUNC(grub_util_error) (const char *fmt, ...) __attribute__ ((noreturn));
|
||||
|
||||
void *xmalloc (size_t size);
|
||||
void *xrealloc (void *ptr, size_t size);
|
||||
char *xstrdup (const char *str);
|
||||
#include <grub/emu/misc.h>
|
||||
|
||||
char *grub_util_get_path (const char *dir, const char *file);
|
||||
size_t grub_util_get_fp_size (FILE *fp);
|
||||
|
@ -59,20 +40,6 @@ void grub_util_write_image (const char *img, size_t size, FILE *out);
|
|||
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
|
||||
FILE *out);
|
||||
|
||||
#ifndef HAVE_VASPRINTF
|
||||
|
||||
int vasprintf (char **buf, const char *fmt, va_list ap);
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ASPRINTF
|
||||
|
||||
int asprintf (char **buf, const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
char *xasprintf (const char *fmt, ...);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
#define fseeko fseeko64
|
||||
|
|
|
@ -181,7 +181,8 @@ typedef enum grub_video_driver_id
|
|||
GRUB_VIDEO_DRIVER_VBE,
|
||||
GRUB_VIDEO_DRIVER_EFI_UGA,
|
||||
GRUB_VIDEO_DRIVER_EFI_GOP,
|
||||
GRUB_VIDEO_DRIVER_SM712
|
||||
GRUB_VIDEO_DRIVER_SM712,
|
||||
GRUB_VIDEO_DRIVER_VGA
|
||||
} grub_video_driver_id_t;
|
||||
|
||||
struct grub_video_adapter
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2002,2003,2007 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef GRUB_MACHINE_KERNEL_HEADER
|
||||
#define GRUB_MACHINE_KERNEL_HEADER 1
|
||||
|
||||
/* The prefix which points to the directory where GRUB modules and its
|
||||
configuration file are located. */
|
||||
extern char grub_prefix[];
|
||||
|
||||
/* The offset of GRUB_PREFIX. */
|
||||
#define GRUB_KERNEL_MACHINE_PREFIX 0x8
|
||||
|
||||
/* End of the data section. */
|
||||
#define GRUB_KERNEL_MACHINE_DATA_END 0x50
|
||||
|
||||
#endif /* ! GRUB_MACHINE_KERNEL_HEADER */
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include <grub/i386/kernel.h>
|
Loading…
Add table
Add a link
Reference in a new issue