* include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_BPB_END):
Increase to 0x5a to accommodate FAT32. Adjust other offsets
accordingly.
Original patch by Yves Blusseau <yves.grub-devel@zetam.org>
* include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro.
* loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline
assembly in final jump, using register constraints.
(grub_linux_boot): For text mode, initialize `have_vga' using
GRUB_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1).
Initialize `video_cursor_x' and `video_cursor_y' as late as possible,
right before the final jump.
Set `video_mode' to 0x3.
Document initialization of `video_page', `video_mode' and
`video_ega_bx'.
* include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro.
* loader/i386/linux.c (grub_cmd_linux): Recognize "quiet" option,
and set GRUB_LINUX_FLAG_QUIET appropiately.
Load BSD ELF modules
* conf/i386-pc.rmk (bsd_mod_SOURCES): Add loader/i386/bsd32.c
and loader/i386/bsd64.c
* include/grub/i386/bsd.h (FREEBSD_MODTYPE_MODULE): Remove
(FREEBSD_MODTYPE_ELF_MODULE): New definition
(FREEBSD_MODTYPE_ELF_MODULE_OBJ): Likewise
(grub_freebsd_load_elfmodule32): New declaration
(grub_freebsd_load_elfmoduleobj64): Likewise
(grub_freebsd_load_elf_meta32): Likewise
(grub_freebsd_load_elf_meta64): Likewise
(grub_freebsd_add_meta): Likewise
(grub_freebsd_add_meta_module): Likewise
* loader/i386/bsd.c (grub_freebsd_add_meta): Make global
(grub_freebsd_add_meta_module): Likewise and move module-specific
parts to grub_cmd_freebsd and grub_cmd_freebsd_module
(grub_cmd_freebsd): Add elf-kernel specific parts
based on grub_freebsd_add_meta_module
(grub_cmd_freebsd_module): Add type parsing moved from
grub_freebsd_add_meta_module
(grub_cmd_freebsd_module_elf): New function
(cmd_freebsd_module_elf): New variable
(GRUB_MOD_INIT): Register freebsd_module_elf
* loader/i386/bsd32.c: New file
* loader/i386/bsd64.c: Likewise
* loader/i386/bsdXX.c: Likewise
* kern/elf.c (grub_elf32_load): Let hook decide which pheaders to load
(grub_elf64_load): Likewise
* include/grub/elfload.h (grub_elf32_load_hook_t): New parameter do_load
All users updated
(grub_elf64_load_hook_t): Likewise
* include/grub/i386/loader.h (grub_linux_prot_size)
(grub_linux_tmp_addr, grub_linux_real_addr)
(grub_linux_is_bzimage, grub_linux16_boot): Declare only on
GRUB_MACHINE_PCBIOS.
* util/i386/pc/grub-mkimage.c (compress_kernel): Move
common grub_util_info() call to ...
(generate_image): ... here.
Fix use of uninitialized memory, comparison of signed with
unsigned integers and memory leak.
Remove bogus module address message.
* boot/i386/pc/boot.S: Remove root_drive. Assert offset of
boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK. Don't
save %dx, we only need %dl and we never change it.
* boot/i386/pc/cdboot.S: Don't set the root drive.
* boot/i386/pc/pxeboot.S: Likewise.
* include/grub/i386/pc/boot.h: Remove
GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust
GRUB_BOOT_MACHINE_DRIVE_CHECK.
* include/grub/i386/pc/kernel.h: Remove grub_root_drive.
* kern/i386/pc/init.c (make_install_device): Remove references
to grub_root_drive.
* kern/i386/pc/startup.S: Likewise.
* util/i386/pc/grub-setup.c (setup): Don't set root_drive.
* include/grub/multiboot2.h: Provide compatibility defines for
multiboot2.h.
* include/multiboot2.h: Include stdint.h only if needed, using
angle brackets.
* loader/i386/pc/multiboot2.c: Include multiboot2.h after
grub/multiboot2.h.
* loader/ieee1275/multiboot2.c: Likewise.
* loader/multiboot2.c: Likewise.
* loader/multiboot_loader.c: Likewise.
* configure.ac: Remove checks for __bswapsi2 and __bswapdi2,
they fail without libc headers for the target.
* include/grub/powerpc/libgcc.h: Use weak attribute for all
exports.
* include/grub/sparc64/libgcc.h: Likewise. Don't use
preprocessor conditionals.
Avoid aliases when compiling with Apple's CC for PCBIOS machine
* kern/misc.c [APPLE_CC] (memcpy): new function
[APPLE_CC] (memmove): likewise
[APPLE_CC && !GRUB_UTIL] (grub_err_printf): likewise
(memcpy): define alias conditionaly on !APPLE_CC
(memset): likewise
(abort): likewise
* include/grub/misc.h (memove): don't define when both GRUB_UTIL and
APPLE_CC are defined
* include/grub/list.h [APPLE_CC] (grub_assert_fail): new function
(grub_assert_fail): make prototype conditional
Define segment as well as section when compiling with
Apple's CC
* efiemu/runtime/efiemu.c (PHYSICAL_ATTRIBUTE): new definition
(efiemu_set_virtual_address_map): declare with PHYSICAL_ATTRIBUTE
(efiemu_convert_pointer): likewise
(efiemu_set_virtual_address_map): likewise
(efiemu_convert_pointer): likewise
(efiemu_getcrc32): likewise
(init_crc32_table): likewise
(reflect): likewise
* include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC
(GRUB_MOD_DEP): likewise
Avoid clobbering %ebx/%rbx in inline assembly with Apple's CC
* efiemu/runtime/efiemu.c (write_cmos): use %cl instead of %bl as
temporary storage
* include/grub/i386/tsc.h (grub_get_tsc): restore %rbx/%ebx when
using Apple's CC
(grub_cpu_is_tsc_supported): likewise
* loader/i386/xnu.c (guessfsb): restore %rbx/%ebx in inline assembly
gfxpayload support
* commands/videotest.c (grub_cmd_videotest): use grub_video_set_mode
* include/grub/video.h (GRUB_VIDEO_MODE_TYPE_PURE_TEXT): new definition
(grub_video_setup): remove
(grub_video_set_mode): new prototype
* loader/i386/linux.c (DEFAULT_VIDEO_MODE): new definition
(vid_mode): remove
(linux_vesafb_res): compile only on PCBIOS
(grub_linux_boot): support gfxpayload
* loader/i386/pc/xnu.c (video_hook): new function
(grub_xnu_set_video): support gfxpayload
* term/gfxterm.c (DEFAULT_VIDEO_WIDTH): removed
(DEFAULT_VIDEO_HEIGHT): likewise
(DEFAULT_VIDEO_FLAGS): likewise
(DEFAULT_VIDEO_MODE): new definition
(video_hook): new function
(grub_gfxterm_init): use grub_video_set_mode
* util/grub.d/30_os-prober.in: remove explicit modesetting before
loading xnu
* video/video.c (grub_video_setup): removed
(grub_video_set_mode): new function based on grub_gfxterm_init and
grub_video_setup
Script fixes
* include/grub/script_sh.h (grub_script_cmdline): remove cmdline
(grub_lexer_param): add tokenonhold
(grub_script_create_cmdline): remove cmdline. All callers updated
(grub_script_function_create): make functionname
grub_script_arg. All callers updated
(grub_script_execute_argument_to_string): new prototype
* kern/parser.c (state_transitions): reorder
(grub_parser_cmdline_state): fix a bug and make more compact
* script/sh/execute.c (grub_script_execute_argument_to_string):
make global
(grub_script_execute_cmdline): use new format
* script/sh/function.c (grub_script_function_create): make functionname
grub_script_arg. All callers updated
* script/sh/lexer.c (grub_script_lexer_init): initilaize tokenonhold
(grub_script_yylex): remove
(grub_script_yylex2): renamed to ...
(grub_script_yylex): ...renamed
parse the expressions like a${b}c
* script/sh/parser.y (GRUB_PARSER_TOKEN_ARG): new typed terminal
(GRUB_PARSER_TOKEN_VAR): remove
(GRUB_PARSER_TOKEN_NAME): likewise
("if"): declare as typeless
("while"): likewise
("function"): likewise
("else"): likewise
("then"): likewise
("fi"): likewise
(text): remove
(argument): likewise
(script): accept empty scripts and make exit on error
(arguments): use GRUB_PARSER_TOKEN_ARG
(function): likewise
(command): move error handling to script
(menuentry): move grub_script_lexer_ref before
* script/sh/script.c (grub_script_create_cmdline): remove cmdline
argument. All callers updated
Cleaned up `include/grub/normal.h'. Grouped prototypes by
definition file, and functions defined in `normal/menu.c' have had
their prototypes moved to `include/grub/menu.h' for consistency.
* include/grub/menu.h (grub_menu_execute_callback): Added; moved
from normal.h.
(grub_menu_get_entry): Likewise.
(grub_menu_get_timeout): Likewise.
(grub_menu_set_timeout): Likewise.
(grub_menu_execute_entry): Likewise.
(grub_menu_execute_with_fallback): Likewise.
(grub_menu_entry_run): Likewise.
* include/grub/normal.h: Re-ordered and grouped function
prototypes by file that the function is defined in.
(grub_menu_execute_callback): Removed; moved to menu.h.
(grub_menu_get_entry): Likewise.
(grub_menu_get_timeout): Likewise.
(grub_menu_set_timeout): Likewise.
(grub_menu_execute_entry): Likewise.
(grub_menu_execute_with_fallback): Likewise.
(grub_menu_entry_run): Likewise.
(grub_menu_addentry): Renamed from this ...
(grub_normal_add_menu_entry): ... to this.
* normal/main.c (grub_menu_addentry): Renamed from this ...
(grub_normal_add_menu_entry): ... to this.
* script/sh/execute.c (grub_script_execute_menuentry): Update
reference to renamed grub_menu_addentry function.
trampoline for linux on 64-bit platform
* conf/x86_64-efi.rmk (linux_mod_SOURCES): added
loader/i386/efi/linux_trampoline.S
* include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed
declration
* kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here
* loader/i386/linux_trampoline.S: moved here
* loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline
(jumpvector): removed
(grub_linux_trampoline_start): new declaration
(grub_linux_trampoline_end): likewise
(grub_linux_boot): use trampoline when on 64-bit platform
* loader/i386/linux.c: likewise
* include/grub/kernel.h (grub_module_header_types): Add type
OBJ_TYPE_CONFIG.
* kern/main.c (grub_load_config): New function.
(grub_main): Call grub_load_config to read boot config.
* grub-mkimage (generate_image): New parameter config_path.
(options): New option --config.
(main): Parse --config option, and pass it to generate_image.
* kernel/disk.c (grub_disk_read): Use void pointer for the
buffer.
(grub_disk_write): Use const void pointer for the buffer.
Adjust all callers. Remove unnecessary casts.