Fail gracefuly when attempting to load 64-bit kFreeBSD on IA32 CPU.
* include/grub/i386/cpuid.h: New file.
* commands/i386/cpuid.c: Include `<grub/i386/cpuid.h>'.
(has_longmode): Rename to ...
(grub_cpuid_has_longmode): ... this. Update all users. Remove
`static' attribute.
* loader/i386/bsd.c: Include `<grub/i386/cpuid.h>'.
(grub_bsd_load_elf): Fail if load of 64-bit kernel was requested
on a CPU that doesn't implement AMD64 instruction set.
* include/grub/kernel.h (struct grub_module_header): Remove
`grub_module_header_types'. Make `type' unsigned. Make `size'
32-bit on all platforms.
* util/elf/grub-mkimage.c (load_modules): Treat `type' as an
8-bit field. Use grub_host_to_target32() for `size'.
* util/i386/efi/grub-mkimage.c (make_mods_section): Likewise.
* util/i386/pc/grub-mkimage.c (generate_image): Likewise.
* util/sparc64/ieee1275/grub-mkimage.c (generate_image): Likewise.
Save space by inlining misc.c functions.
* kern/misc.c (grub_iswordseparator): Made static.
* kern/misc.c (grub_strcat): Moved from here ...
* include/grub/misc.h (grub_strcat): ... here. Inlined.
* kern/misc.c (grub_strncat): Moved from here ...
* include/grub/misc.h (grub_strncat): ... here. Inlined.
* kern/misc.c (grub_strcasecmp): Moved from here ...
* include/grub/misc.h (grub_strcasecmp): ... here. Inlined.
* kern/misc.c (grub_strncasecmp): Moved from here ...
* include/grub/misc.h (grub_strncasecmp): ... here. Inlined.
* kern/misc.c (grub_isalpha): Moved from here ...
* include/grub/misc.h (grub_isalpha): ... here. Inlined.
* kern/misc.c (grub_isdigit): Moved from here ...
* include/grub/misc.h (grub_isdigit): ... here. Inlined.
* kern/misc.c (grub_isgraph): Moved from here ...
* include/grub/misc.h (grub_isgraph): ... here. Inlined.
* kern/misc.c (grub_tolower): Moved from here ...
* include/grub/misc.h (grub_tolower): ... here. Inlined.
Support --no-smp and --no-acpi for NetBSD.
* include/grub/i386/bsd.h (NETBSD_AB_NOSMP): New definition.
(NETBSD_AB_NOACPI): Likewise.
* loader/i386/bsd.c (netbsd_opts): New entries no-smp and no-acpi.
(netbsd_flags): Add NETBSD_AB_NOSMP, NETBSD_AB_NOACPI.
Framebuffer split.
* commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video
subsystem at the end.
* conf/common.rmk (pkglib_MODULES): Add video_fb.mod.
(video_fb_mod_SOURCES): New variable.
(video_fb_mod_CFLAGS): Likewise.
(video_fb_mod_LDFLAGS): Likewise.
* conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c,
video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c.
* video/i386/pc/vbeblit.c: Moved from here ...
* video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'.
* video/i386/pc/vbefill.c: Moved from here ...
* video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'.
* video/i386/pc/vbeutil.c: Moved from here ...
* video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'.
* include/grub/i386/pc/vbeblit.h: Moved from here ...
* include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'.
* include/grub/i386/pc/vbefill.h: Moved from here ...
* include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'.
* include/grub/i386/pc/vbeutil.h: Moved from here ...
* include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'.
* include/grub/i386/pc/vbe.h: Moved framebuffer part ...
* include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'.
* include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed.
(GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise.
(grub_video_adapter): Added 'get_info_and_fini'.
(grub_video_get_info_and_fini): New prototype.
(grub_video_set_mode): make modestring const char *.
* loader/i386/linux.c (grub_linux_setup_video): Use
grub_video_get_info_and_fini.
(grub_linux_boot): Move modesetting just before booting.
* loader/i386/pc/xnu.c (grub_xnu_set_video): Use
grub_video_get_info_and_fini.
* video/i386/pc/vbe.c: Moved framebuffer part ...
* video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'.
* video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use
grub_video_fbstd_colors and grub_video_fb_set_palette.
(grub_video_vbe_init): Clear 'framebuffer' variable and use
grub_video_fb_init.
(grub_video_vbe_fini): Use grub_video_fb_fini.
(grub_video_vbe_setup): Use framebuffer.render_target instead of
render_target and use grub_video_fb_set_active_render_target and
grub_video_fb_set_palette.
(grub_video_vbe_set_palette): Use grub_video_fb_set_palette.
(grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport.
(grub_video_vbe_adapter): Use framebuffer.
* video/video.c (grub_video_get_info_and_fini): New function.
(grub_video_set_mode): Make modestring const char *.
(GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these
values are already initialised.
* include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD)
(KERNEL_TYPE_OPENBSD, KERNEL_TYPE_NETBSD): Convert to ...
(bsd_kernel_types): ... this enum.
* loader/i386/bsd.c (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module)
(grub_cmd_freebsd_module_elf): Abort with "You need to load the
kernel first." when `kernel_type' is set to KERNEL_TYPE_NONE.
(grub_bsd_load_aout, grub_bsd_load, grub_cmd_freebsd_loadenv)
(grub_cmd_freebsd_module, grub_cmd_freebsd_module_elf)
(GRUB_MOD_INIT (bsd)): Fix capitalization in a few error
messages.
Fix a bug resulting in black screen when loading Linux using a
packed video mode.
* kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette_width): New
function.
* include/grub/i386/pc/vbe.h (GRUB_VBE_CAPABILITY_DACWIDTH): New macro.
(grub_vbe_bios_getset_dac_palette_width): New function.
(grub_vbe_bios_get_dac_palette_width)
(grub_vbe_bios_set_dac_palette_width): New macros (act as wrappers for
grub_vbe_bios_getset_dac_palette_width()).
* video/i386/pc/vbe.c (grub_vbe_probe): Use `GRUB_VBE_STATUS_OK' to
check for return status.
(grub_vbe_get_video_mode_info): When getting information for a packed
mode (<= 8 bpp), obtain DAC palette width using
grub_vbe_bios_getset_dac_palette_width(), and use that for initializing
{red,green,blue}_mark_size.
* disk/lvm.c (grub_lvm_scan_device): Ignore extra copy of metadata.
Don't change pv->disk if it's already set.
* disk/raid.c (grub_raid_scan_device): Merge this function into ...
(grub_raid_register): ... here.
(grub_raid_rescan): Removed.
* include/grub/raid.h (grub_raid_rescan): Removed.
* util/grub-fstest.c: Remove include file <grub/raid.h>.
(fstest): Replace grub_raid_rescan with module fini function followed
by init function.
* util/grub-probe.c: Add include file <grub/raid.h>.
(probe_raid_level): New function.
(probe): Detect abstraction by walking the disk device, support two
level of abstraction (LVM on RAID) when detecting partition map.
* 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.