From c5dc16905aea5bce096c5a2061c236712b6e4686 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 6 Oct 2010 19:57:01 +0200 Subject: [PATCH 01/65] Make enable of disk cache statistics code configurable. * configure.ac: --enable-cache-stats added. * config.h.in (DISK_CACHE_STATS): New define. * grub-core/Makefile.core.def (cacheinfo): New command. * include/grub/disk.h(grub_disk_cache_get_performance): New function. * grub-core/commands/cacheinfo.c: New file. * grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and moved to cacheinfo.c. * grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache debug code. * include/grub/disk.h: Likewise. --- ChangeLog | 15 +++++++++ config.h.in | 2 ++ configure.ac | 17 ++++++++++ grub-core/Makefile.core.def | 6 ++++ grub-core/commands/cacheinfo.c | 58 ++++++++++++++++++++++++++++++++++ grub-core/commands/minicmd.c | 20 ------------ grub-core/kern/disk.c | 6 ++-- include/grub/disk.h | 5 +++ 8 files changed, 106 insertions(+), 23 deletions(-) create mode 100644 grub-core/commands/cacheinfo.c diff --git a/ChangeLog b/ChangeLog index cc3c87445..6d54b6301 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2010-10-05 Szymon Janc + + Make enable of disk cache statistics code configurable. + + * configure.ac: --enable-cache-stats added. + * config.h.in (DISK_CACHE_STATS): New define. + * grub-core/Makefile.core.def (cacheinfo): New command. + * include/grub/disk.h(grub_disk_cache_get_performance): New function. + * grub-core/commands/cacheinfo.c: New file. + * grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and + moved to cacheinfo.c. + * grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache + debug code. + * include/grub/disk.h: Likewise. + 2010-10-02 Aleš Nesrsta * include/grub/scsi.h: diff --git a/config.h.in b/config.h.in index 6d7d95dec..cfe6a94b2 100644 --- a/config.h.in +++ b/config.h.in @@ -32,6 +32,8 @@ #define NEED_ENABLE_EXECUTE_STACK @NEED_ENABLE_EXECUTE_STACK@ /* Define to 1 if GCC generates calls to __register_frame_info(). */ #define NEED_REGISTER_FRAME_INFO @NEED_REGISTER_FRAME_INFO@ +/* Define to 1 to enable disk cache statistics. */ +#define DISK_CACHE_STATS @DISK_CACHE_STATS@ #if defined(__i386__) #define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) diff --git a/configure.ac b/configure.ac index 66d4a6877..b3b5652d1 100644 --- a/configure.ac +++ b/configure.ac @@ -669,6 +669,17 @@ AC_ARG_ENABLE([mm-debug], [AC_DEFINE([MM_DEBUG], [1], [Define to 1 if you enable memory manager debugging.])]) +AC_ARG_ENABLE([cache-stats], + AS_HELP_STRING([--enable-cache-stats], + [enable disk cache statistics collection])]) + +if test x$enable_cache_stats = xyes; then + DISK_CACHE_STATS=1 +else + DISK_CACHE_STATS=0 +fi +AC_SUBST([DISK_CACHE_STATS]) + AC_ARG_ENABLE([grub-emu-usb], [AS_HELP_STRING([--enable-grub-emu-usb], [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) @@ -922,6 +933,7 @@ AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x]) AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x]) AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1]) AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes]) +AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1]) AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1]) @@ -983,6 +995,11 @@ echo With memory debugging: Yes else echo With memory debugging: No fi +if [ x"$enable_cache_stats" = xyes ]; then +echo With disk cache statistics: Yes +else +echo With disk cache statistics: No +fi if [ x"$efiemu_excuse" = x ]; then echo efiemu runtime: Yes else diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 8845c26ea..51ae522a6 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1502,3 +1502,9 @@ module = { common = commands/keylayouts.c; enable = videomodules; }; + +module = { + name = cacheinfo; + common = commands/cacheinfo.c; + condition = COND_ENABLE_CACHE_STATS; +}; diff --git a/grub-core/commands/cacheinfo.c b/grub-core/commands/cacheinfo.c new file mode 100644 index 000000000..771763c9c --- /dev/null +++ b/grub-core/commands/cacheinfo.c @@ -0,0 +1,58 @@ +/* cacheinfo.c - disk cache statistics */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008,2010 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 . + */ + +#include +#include +#include +#include +#include + +static grub_err_t +grub_rescue_cmd_info (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + unsigned long hits, misses; + + grub_disk_cache_get_performance (&hits, &misses); + grub_printf ("Disk cache: hits = %lu, misses = %lu ", hits, misses); + if (hits + misses) + { + unsigned long ratio = hits * 10000 / (hits + misses); + grub_printf ("(%lu.%lu%%)\n", ratio / 100, ratio % 100); + } + else + grub_printf ("(N/A)\n"); + + return 0; +} + +static grub_command_t cmd_cacheinfo; + +GRUB_MOD_INIT(cacheinfo) +{ + cmd_cacheinfo = + grub_register_command ("cacheinfo", grub_rescue_cmd_info, + 0, N_("Get disk cache info.")); +} + +GRUB_MOD_FINI(cacheinfo) +{ + grub_unregister_command (cmd_cacheinfo); +} diff --git a/grub-core/commands/minicmd.c b/grub-core/commands/minicmd.c index 5cf109fde..5c90e8ac5 100644 --- a/grub-core/commands/minicmd.c +++ b/grub-core/commands/minicmd.c @@ -88,26 +88,6 @@ grub_mini_cmd_help (struct grub_command *cmd __attribute__ ((unused)), return 0; } -#if 0 -static void -grub_rescue_cmd_info (void) -{ - extern void grub_disk_cache_get_performance (unsigned long *, - unsigned long *); - unsigned long hits, misses; - - grub_disk_cache_get_performance (&hits, &misses); - grub_printf ("Disk cache: hits = %u, misses = %u ", hits, misses); - if (hits + misses) - { - unsigned long ratio = hits * 10000 / (hits + misses); - grub_printf ("(%u.%u%%)\n", ratio / 100, ratio % 100); - } - else - grub_printf ("(N/A)\n"); -} -#endif - /* dump ADDRESS [SIZE] */ static grub_err_t grub_mini_cmd_dump (struct grub_command *cmd __attribute__ ((unused)), diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c index 807ee4277..2d50ea60c 100644 --- a/grub-core/kern/disk.c +++ b/grub-core/kern/disk.c @@ -50,7 +50,7 @@ grub_err_t (* grub_disk_ata_pass_through) (grub_disk_t, struct grub_disk_ata_pass_through_parms *); -#if 0 +#if DISK_CACHE_STATS static unsigned long grub_disk_cache_hits; static unsigned long grub_disk_cache_misses; @@ -123,13 +123,13 @@ grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id, && cache->sector == sector) { cache->lock = 1; -#if 0 +#if DISK_CACHE_STATS grub_disk_cache_hits++; #endif return cache->data; } -#if 0 +#if DISK_CACHE_STATS grub_disk_cache_misses++; #endif diff --git a/include/grub/disk.h b/include/grub/disk.h index 9c5653e00..783640d19 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -160,6 +160,11 @@ grub_err_t EXPORT_FUNC(grub_disk_write) (grub_disk_t disk, grub_uint64_t EXPORT_FUNC(grub_disk_get_size) (grub_disk_t disk); +#if DISK_CACHE_STATS +void +EXPORT_FUNC(grub_disk_cache_get_performance) (unsigned long *hits, unsigned long *misses); +#endif + extern void (* EXPORT_VAR(grub_disk_firmware_fini)) (void); extern int EXPORT_VAR(grub_disk_firmware_is_tainted); From 5d49b1e69c82de6a07195dc39e7e601feeedd44d Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 6 Oct 2010 22:09:07 +0200 Subject: [PATCH 02/65] Move last changelog entry from ChangeLog to ChangeLog.cacheinfo. --- ChangeLog | 15 --------------- ChangeLog.cacheinfo | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 ChangeLog.cacheinfo diff --git a/ChangeLog b/ChangeLog index 6d54b6301..cc3c87445 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,3 @@ -2010-10-05 Szymon Janc - - Make enable of disk cache statistics code configurable. - - * configure.ac: --enable-cache-stats added. - * config.h.in (DISK_CACHE_STATS): New define. - * grub-core/Makefile.core.def (cacheinfo): New command. - * include/grub/disk.h(grub_disk_cache_get_performance): New function. - * grub-core/commands/cacheinfo.c: New file. - * grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and - moved to cacheinfo.c. - * grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache - debug code. - * include/grub/disk.h: Likewise. - 2010-10-02 Aleš Nesrsta * include/grub/scsi.h: diff --git a/ChangeLog.cacheinfo b/ChangeLog.cacheinfo new file mode 100644 index 000000000..a26271cca --- /dev/null +++ b/ChangeLog.cacheinfo @@ -0,0 +1,14 @@ +2010-10-05 Szymon Janc + + Make enable of disk cache statistics code configurable. + + * configure.ac: --enable-cache-stats added. + * config.h.in (DISK_CACHE_STATS): New define. + * grub-core/Makefile.core.def (cacheinfo): New command. + * include/grub/disk.h(grub_disk_cache_get_performance): New function. + * grub-core/commands/cacheinfo.c: New file. + * grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and + moved to cacheinfo.c. + * grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache + debug code. + * include/grub/disk.h: Likewise. From e03f549b3e11018b0ec0f44465f6bf5ca98ca993 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Dec 2010 16:22:19 +0000 Subject: [PATCH 03/65] Preferred resolution detection for VBE. * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info): New function. (grub_vbe_bios_get_ddc_capabilities): Likewise. (grub_vbe_bios_read_edid): Likewise. (grub_vbe_edid_checksum): Likewise. (grub_vbe_get_preferred_mode): Likewise. Try EDID followed by the Flat Panel extension, in line with the X.org VESA driver. (grub_video_vbe_setup): When the mode is "auto", try to get the preferred mode from VBE, and use the largest mode that is no larger than the preferred mode (some BIOSes expose a preferred mode that is not in their mode list!). If this fails, fall back to 640x480 as a safe conservative choice. * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New structure. (struct grub_vbe_edid_info): Likewise. (grub_vbe_bios_get_flat_panel_info): Add prototype. (grub_vbe_bios_get_ddc_capabilities): Likewise. (grub_vbe_bios_read_edid): Likewise. * util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto". This is more appropriate on a wider range of platforms than 640x480. --- ChangeLog.vbe-autodetect | 25 ++++++ grub-core/video/i386/pc/vbe.c | 150 +++++++++++++++++++++++++++++++++- include/grub/i386/pc/vbe.h | 84 +++++++++++++++++++ util/grub.d/00_header.in | 2 +- 4 files changed, 256 insertions(+), 5 deletions(-) create mode 100644 ChangeLog.vbe-autodetect diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect new file mode 100644 index 000000000..7d16ebee2 --- /dev/null +++ b/ChangeLog.vbe-autodetect @@ -0,0 +1,25 @@ +2010-12-14 Colin Watson + + Preferred resolution detection for VBE. + + * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info): + New function. + (grub_vbe_bios_get_ddc_capabilities): Likewise. + (grub_vbe_bios_read_edid): Likewise. + (grub_vbe_edid_checksum): Likewise. + (grub_vbe_get_preferred_mode): Likewise. Try EDID followed by the + Flat Panel extension, in line with the X.org VESA driver. + (grub_video_vbe_setup): When the mode is "auto", try to get the + preferred mode from VBE, and use the largest mode that is no larger + than the preferred mode (some BIOSes expose a preferred mode that is + not in their mode list!). If this fails, fall back to 640x480 as a + safe conservative choice. + * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New + structure. + (struct grub_vbe_edid_info): Likewise. + (grub_vbe_bios_get_flat_panel_info): Add prototype. + (grub_vbe_bios_get_ddc_capabilities): Likewise. + (grub_vbe_bios_read_edid): Likewise. + + * util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto". This + is more appropriate on a wider range of platforms than 640x480. diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index 2ddb4ca80..1794addae 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -273,6 +273,56 @@ grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset, return regs.eax & 0xffff; } +/* Call VESA BIOS 0x4f11 to get flat panel information, return status. */ +grub_vbe_status_t +grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_info) +{ + struct grub_bios_int_registers regs; + + regs.eax = 0x4f11; + regs.ebx = 0x0001; + regs.es = (((grub_addr_t) flat_panel_info) & 0xffff0000) >> 4; + regs.edi = ((grub_addr_t) flat_panel_info) & 0xffff; + regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + grub_bios_interrupt (0x10, ®s); + return regs.eax & 0xffff; +} + +/* Call VESA BIOS 0x4f15 to get DDC availability, return status. */ +grub_vbe_status_t +grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level) +{ + struct grub_bios_int_registers regs; + + regs.eax = 0x4f15; + regs.ebx = 0x0000; + regs.ecx = 0x0000; + regs.es = 0x0000; + regs.edi = 0x0000; + regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + grub_bios_interrupt (0x10, ®s); + + *level = regs.ebx & 0xff; + return regs.eax & 0xffff; +} + +/* Call VESA BIOS 0x4f15 to read EDID information, return status. */ +grub_vbe_status_t +grub_vbe_bios_read_edid (struct grub_vbe_edid_info *edid_info) +{ + struct grub_bios_int_registers regs; + + regs.eax = 0x4f15; + regs.ebx = 0x0001; + regs.ecx = 0x0000; + regs.edx = 0x0000; + regs.es = (((grub_addr_t) edid_info) & 0xffff0000) >> 4; + regs.edi = ((grub_addr_t) edid_info) & 0xffff; + regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT; + grub_bios_interrupt (0x10, ®s); + return regs.eax & 0xffff; +} + grub_err_t grub_vbe_probe (struct grub_vbe_info_block *info_block) @@ -327,6 +377,70 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) return GRUB_ERR_NONE; } +static grub_err_t +grub_vbe_edid_checksum (struct grub_vbe_edid_info *edid_info) +{ + const char *edid_bytes = (const char *) edid_info; + int i; + char checksum = 0; + + /* Check EDID checksum. */ + for (i = 0; i < 128; ++i) + checksum += edid_bytes[i]; + + if (checksum != 0) + return grub_error (GRUB_ERR_BAD_DEVICE, + "invalid EDID checksum %d", checksum); + + grub_errno = GRUB_ERR_NONE; + return grub_errno; +} + +static grub_err_t +grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) +{ + grub_vbe_status_t status; + grub_uint8_t ddc_level; + struct grub_vbe_edid_info edid_info; + struct grub_vbe_flat_panel_info flat_panel_info; + + if (controller_info.version >= 0x200 + && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) + == GRUB_VBE_STATUS_OK) + { + status = grub_vbe_bios_read_edid (&edid_info); + /* Bit 1 in the Feature Support field indicates that the first + Detailed Timing Description is the preferred timing mode. */ + if (status == GRUB_VBE_STATUS_OK + && grub_vbe_edid_checksum (&edid_info) == GRUB_ERR_NONE + && edid_info.version == 1 /* we don't understand later versions */ + && (edid_info.feature_support + & GRUB_VBE_EDID_FEATURE_PREFERRED_TIMING_MODE) + && edid_info.detailed_timings[0].pixel_clock) + { + *width = edid_info.detailed_timings[0].horizontal_active_lo + | (((unsigned int) + (edid_info.detailed_timings[0].horizontal_hi & 0xf0)) + << 4); + *height = edid_info.detailed_timings[0].vertical_active_lo + | (((unsigned int) + (edid_info.detailed_timings[0].vertical_hi & 0xf0)) + << 4); + return GRUB_ERR_NONE; + } + } + + status = grub_vbe_bios_get_flat_panel_info (&flat_panel_info); + if (status == GRUB_VBE_STATUS_OK) + { + *width = flat_panel_info.horizontal_size; + *height = flat_panel_info.vertical_size; + return GRUB_ERR_NONE; + } + + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot get preferred mode"); +} + grub_err_t grub_vbe_set_video_mode (grub_uint32_t vbe_mode, struct grub_vbe_mode_info_block *vbe_mode_info) @@ -695,11 +809,28 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, struct grub_vbe_mode_info_block best_vbe_mode_info; grub_uint32_t best_vbe_mode = 0; int depth; + int preferred_mode = 0; /* Decode depth from mode_type. If it is zero, then autodetect. */ depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + if (width == 0 && height == 0) + { + grub_vbe_get_preferred_mode (&width, &height); + if (grub_errno == GRUB_ERR_NONE) + preferred_mode = 1; + else + { + /* Fall back to 640x480. This is conservative, but the largest + mode supported by the graphics card may not be safe for the + display device. */ + grub_errno = GRUB_ERR_NONE; + width = 640; + height = 480; + } + } + /* Walk thru mode list and try to find matching mode. */ for (p = vbe_mode_list; *p != 0xFFFF; p++) { @@ -742,10 +873,21 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, /* Unsupported bitdepth . */ continue; - if (((vbe_mode_info.x_resolution != width) - || (vbe_mode_info.y_resolution != height)) && width != 0 && height != 0) - /* Non matching resolution. */ - continue; + if (preferred_mode) + { + if (vbe_mode_info.x_resolution > width + || vbe_mode_info.y_resolution > height) + /* Resolution exceeds that of preferred mode. */ + continue; + } + else + { + if (((vbe_mode_info.x_resolution != width) + || (vbe_mode_info.y_resolution != height)) + && width != 0 && height != 0) + /* Non matching resolution. */ + continue; + } /* Check if user requested RGB or index color mode. */ if ((mode_mask & GRUB_VIDEO_MODE_TYPE_COLOR_MASK) != 0) diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index fba3ee642..5be34fdec 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -169,6 +169,81 @@ struct grub_vbe_palette_data grub_uint8_t alignment; } __attribute__ ((packed)); +struct grub_vbe_flat_panel_info +{ + grub_uint16_t horizontal_size; + grub_uint16_t vertical_size; + grub_uint16_t panel_type; + grub_uint8_t red_bpp; + grub_uint8_t green_bpp; + grub_uint8_t blue_bpp; + grub_uint8_t reserved_bpp; + grub_uint32_t reserved_offscreen_mem_size; + grub_vbe_farptr_t reserved_offscreen_mem_ptr; + + grub_uint8_t reserved[14]; +} __attribute__ ((packed)); + +struct grub_vbe_edid_info +{ + grub_uint8_t header[8]; + grub_uint16_t manufacturer_id; + grub_uint16_t product_id; + grub_uint32_t serial_number; + grub_uint8_t week_of_manufacture; + grub_uint8_t year_of_manufacture; + grub_uint8_t version; + grub_uint8_t revision; + + grub_uint8_t video_input_definition; + grub_uint8_t max_horizontal_image_size; + grub_uint8_t max_vertical_image_size; + grub_uint8_t display_gamma; + grub_uint8_t feature_support; +#define GRUB_VBE_EDID_FEATURE_PREFERRED_TIMING_MODE (1 << 1) + + grub_uint8_t red_green_lo; + grub_uint8_t blue_white_lo; + grub_uint8_t red_x_hi; + grub_uint8_t red_y_hi; + grub_uint8_t green_x_hi; + grub_uint8_t green_y_hi; + grub_uint8_t blue_x_hi; + grub_uint8_t blue_y_hi; + grub_uint8_t white_x_hi; + grub_uint8_t white_y_hi; + + grub_uint8_t established_timings_1; + grub_uint8_t established_timings_2; + grub_uint8_t manufacturer_reserved_timings; + + grub_uint16_t standard_timings[8]; + + struct { + grub_uint16_t pixel_clock; + /* Only valid if the pixel clock is non-null. */ + grub_uint8_t horizontal_active_lo; + grub_uint8_t horizontal_blanking_lo; + grub_uint8_t horizontal_hi; + grub_uint8_t vertical_active_lo; + grub_uint8_t vertical_blanking_lo; + grub_uint8_t vertical_hi; + grub_uint8_t horizontal_sync_offset_lo; + grub_uint8_t horizontal_sync_pulse_width_lo; + grub_uint8_t vertical_sync_lo; + grub_uint8_t sync_hi; + grub_uint8_t horizontal_image_size_lo; + grub_uint8_t vertical_image_size_lo; + grub_uint8_t image_size_hi; + grub_uint8_t horizontal_border; + grub_uint8_t vertical_border; + grub_uint8_t flags; + } detailed_timings[4]; + + grub_uint8_t extension_flag; + grub_uint8_t checksum; +} __attribute__ ((packed)); + /* Prototypes for helper functions. */ /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */ grub_vbe_status_t @@ -197,6 +272,15 @@ grub_vbe_bios_get_scanline_length (grub_uint32_t *length); grub_vbe_status_t grub_vbe_bios_get_display_start (grub_uint32_t *x, grub_uint32_t *y); +/* Call VESA BIOS 0x4f11 to get flat panel information, return status. */ +grub_vbe_status_t +grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_info); +/* Call VESA BIOS 0x4f15 to get DDC availability, return status. */ +grub_vbe_status_t +grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level); +/* Call VESA BIOS 0x4f15 to read EDID information, return status. */ +grub_vbe_status_t +grub_vbe_bios_read_edid (struct grub_vbe_edid_info *edid_data); grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *width); diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index a596e9c4a..55c686296 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -36,7 +36,7 @@ done if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi if [ "x${GRUB_DEFAULT}" = "xsaved" ] ; then GRUB_DEFAULT='${saved_entry}' ; fi if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi -if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi +if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=auto ; fi if [ "x${GRUB_DEFAULT_BUTTON}" = "x" ] ; then GRUB_DEFAULT_BUTTON="$GRUB_DEFAULT" ; fi if [ "x${GRUB_DEFAULT_BUTTON}" = "xsaved" ] ; then GRUB_DEFAULT_BUTTON='${saved_entry}' ; fi From 25d884a52a1819792bc97cac9890d44a72446b7c Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Dec 2010 17:06:32 +0000 Subject: [PATCH 04/65] move generic parts of EDID handling (structure, checksumming) to generic location --- ChangeLog.vbe-autodetect | 7 ++-- grub-core/video/i386/pc/vbe.c | 27 +++------------ grub-core/video/video.c | 19 +++++++++++ include/grub/i386/pc/vbe.h | 64 ++--------------------------------- include/grub/video.h | 62 +++++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+), 87 deletions(-) diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect index 7d16ebee2..0d96fc0a2 100644 --- a/ChangeLog.vbe-autodetect +++ b/ChangeLog.vbe-autodetect @@ -2,11 +2,11 @@ Preferred resolution detection for VBE. + * grub-core/video/video.c (grub_video_edid_checksum): New function. * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info): - New function. + Likewise. (grub_vbe_bios_get_ddc_capabilities): Likewise. (grub_vbe_bios_read_edid): Likewise. - (grub_vbe_edid_checksum): Likewise. (grub_vbe_get_preferred_mode): Likewise. Try EDID followed by the Flat Panel extension, in line with the X.org VESA driver. (grub_video_vbe_setup): When the mode is "auto", try to get the @@ -14,9 +14,10 @@ than the preferred mode (some BIOSes expose a preferred mode that is not in their mode list!). If this fails, fall back to 640x480 as a safe conservative choice. + * include/grub/video.h (struct grub_vbe_edid_info): New structure. + (grub_video_edid_checksum): Add prototype. * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New structure. - (struct grub_vbe_edid_info): Likewise. (grub_vbe_bios_get_flat_panel_info): Add prototype. (grub_vbe_bios_get_ddc_capabilities): Likewise. (grub_vbe_bios_read_edid): Likewise. diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index 1794addae..e2dcc151e 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -308,7 +308,7 @@ grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level) /* Call VESA BIOS 0x4f15 to read EDID information, return status. */ grub_vbe_status_t -grub_vbe_bios_read_edid (struct grub_vbe_edid_info *edid_info) +grub_vbe_bios_read_edid (struct grub_video_edid_info *edid_info) { struct grub_bios_int_registers regs; @@ -377,31 +377,12 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) return GRUB_ERR_NONE; } -static grub_err_t -grub_vbe_edid_checksum (struct grub_vbe_edid_info *edid_info) -{ - const char *edid_bytes = (const char *) edid_info; - int i; - char checksum = 0; - - /* Check EDID checksum. */ - for (i = 0; i < 128; ++i) - checksum += edid_bytes[i]; - - if (checksum != 0) - return grub_error (GRUB_ERR_BAD_DEVICE, - "invalid EDID checksum %d", checksum); - - grub_errno = GRUB_ERR_NONE; - return grub_errno; -} - static grub_err_t grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) { grub_vbe_status_t status; grub_uint8_t ddc_level; - struct grub_vbe_edid_info edid_info; + struct grub_video_edid_info edid_info; struct grub_vbe_flat_panel_info flat_panel_info; if (controller_info.version >= 0x200 @@ -412,10 +393,10 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) /* Bit 1 in the Feature Support field indicates that the first Detailed Timing Description is the preferred timing mode. */ if (status == GRUB_VBE_STATUS_OK - && grub_vbe_edid_checksum (&edid_info) == GRUB_ERR_NONE + && grub_video_edid_checksum (&edid_info) == GRUB_ERR_NONE && edid_info.version == 1 /* we don't understand later versions */ && (edid_info.feature_support - & GRUB_VBE_EDID_FEATURE_PREFERRED_TIMING_MODE) + & GRUB_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE) && edid_info.detailed_timings[0].pixel_clock) { *width = edid_info.detailed_timings[0].horizontal_active_lo diff --git a/grub-core/video/video.c b/grub-core/video/video.c index 7a1a446e4..f3ecab94d 100644 --- a/grub-core/video/video.c +++ b/grub-core/video/video.c @@ -374,6 +374,25 @@ grub_video_get_active_render_target (struct grub_video_render_target **target) return grub_video_adapter_active->get_active_render_target (target); } +grub_err_t +grub_video_edid_checksum (struct grub_video_edid_info *edid_info) +{ + const char *edid_bytes = (const char *) edid_info; + int i; + char checksum = 0; + + /* Check EDID checksum. */ + for (i = 0; i < 128; ++i) + checksum += edid_bytes[i]; + + if (checksum != 0) + return grub_error (GRUB_ERR_BAD_DEVICE, + "invalid EDID checksum %d", checksum); + + grub_errno = GRUB_ERR_NONE; + return grub_errno; +} + /* Parse x[x]*/ static grub_err_t parse_modespec (const char *current_mode, int *width, int *height, int *depth) diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index 5be34fdec..0422558db 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -19,6 +19,8 @@ #ifndef GRUB_VBE_MACHINE_HEADER #define GRUB_VBE_MACHINE_HEADER 1 +#include + /* Default video mode to be used. */ #define GRUB_VBE_DEFAULT_VIDEO_MODE 0x101 @@ -184,66 +186,6 @@ struct grub_vbe_flat_panel_info grub_uint8_t reserved[14]; } __attribute__ ((packed)); -struct grub_vbe_edid_info -{ - grub_uint8_t header[8]; - grub_uint16_t manufacturer_id; - grub_uint16_t product_id; - grub_uint32_t serial_number; - grub_uint8_t week_of_manufacture; - grub_uint8_t year_of_manufacture; - grub_uint8_t version; - grub_uint8_t revision; - - grub_uint8_t video_input_definition; - grub_uint8_t max_horizontal_image_size; - grub_uint8_t max_vertical_image_size; - grub_uint8_t display_gamma; - grub_uint8_t feature_support; -#define GRUB_VBE_EDID_FEATURE_PREFERRED_TIMING_MODE (1 << 1) - - grub_uint8_t red_green_lo; - grub_uint8_t blue_white_lo; - grub_uint8_t red_x_hi; - grub_uint8_t red_y_hi; - grub_uint8_t green_x_hi; - grub_uint8_t green_y_hi; - grub_uint8_t blue_x_hi; - grub_uint8_t blue_y_hi; - grub_uint8_t white_x_hi; - grub_uint8_t white_y_hi; - - grub_uint8_t established_timings_1; - grub_uint8_t established_timings_2; - grub_uint8_t manufacturer_reserved_timings; - - grub_uint16_t standard_timings[8]; - - struct { - grub_uint16_t pixel_clock; - /* Only valid if the pixel clock is non-null. */ - grub_uint8_t horizontal_active_lo; - grub_uint8_t horizontal_blanking_lo; - grub_uint8_t horizontal_hi; - grub_uint8_t vertical_active_lo; - grub_uint8_t vertical_blanking_lo; - grub_uint8_t vertical_hi; - grub_uint8_t horizontal_sync_offset_lo; - grub_uint8_t horizontal_sync_pulse_width_lo; - grub_uint8_t vertical_sync_lo; - grub_uint8_t sync_hi; - grub_uint8_t horizontal_image_size_lo; - grub_uint8_t vertical_image_size_lo; - grub_uint8_t image_size_hi; - grub_uint8_t horizontal_border; - grub_uint8_t vertical_border; - grub_uint8_t flags; - } detailed_timings[4]; - - grub_uint8_t extension_flag; - grub_uint8_t checksum; -} __attribute__ ((packed)); - /* Prototypes for helper functions. */ /* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */ grub_vbe_status_t @@ -280,7 +222,7 @@ grub_vbe_status_t grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level); /* Call VESA BIOS 0x4f15 to read EDID information, return status. */ grub_vbe_status_t -grub_vbe_bios_read_edid (struct grub_vbe_edid_info *edid_data); +grub_vbe_bios_read_edid (struct grub_video_edid_info *edid_data); grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *width); diff --git a/include/grub/video.h b/include/grub/video.h index 97bd85bd1..2cf1424c4 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -210,6 +210,66 @@ struct grub_video_palette_data grub_uint8_t a; /* Reserved bits value (0-255). */ }; +struct grub_video_edid_info +{ + grub_uint8_t header[8]; + grub_uint16_t manufacturer_id; + grub_uint16_t product_id; + grub_uint32_t serial_number; + grub_uint8_t week_of_manufacture; + grub_uint8_t year_of_manufacture; + grub_uint8_t version; + grub_uint8_t revision; + + grub_uint8_t video_input_definition; + grub_uint8_t max_horizontal_image_size; + grub_uint8_t max_vertical_image_size; + grub_uint8_t display_gamma; + grub_uint8_t feature_support; +#define GRUB_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE (1 << 1) + + grub_uint8_t red_green_lo; + grub_uint8_t blue_white_lo; + grub_uint8_t red_x_hi; + grub_uint8_t red_y_hi; + grub_uint8_t green_x_hi; + grub_uint8_t green_y_hi; + grub_uint8_t blue_x_hi; + grub_uint8_t blue_y_hi; + grub_uint8_t white_x_hi; + grub_uint8_t white_y_hi; + + grub_uint8_t established_timings_1; + grub_uint8_t established_timings_2; + grub_uint8_t manufacturer_reserved_timings; + + grub_uint16_t standard_timings[8]; + + struct { + grub_uint16_t pixel_clock; + /* Only valid if the pixel clock is non-null. */ + grub_uint8_t horizontal_active_lo; + grub_uint8_t horizontal_blanking_lo; + grub_uint8_t horizontal_hi; + grub_uint8_t vertical_active_lo; + grub_uint8_t vertical_blanking_lo; + grub_uint8_t vertical_hi; + grub_uint8_t horizontal_sync_offset_lo; + grub_uint8_t horizontal_sync_pulse_width_lo; + grub_uint8_t vertical_sync_lo; + grub_uint8_t sync_hi; + grub_uint8_t horizontal_image_size_lo; + grub_uint8_t vertical_image_size_lo; + grub_uint8_t image_size_hi; + grub_uint8_t horizontal_border; + grub_uint8_t vertical_border; + grub_uint8_t flags; + } detailed_timings[4]; + + grub_uint8_t extension_flag; + grub_uint8_t checksum; +} __attribute__ ((packed)); + typedef enum grub_video_driver_id { GRUB_VIDEO_DRIVER_NONE, @@ -423,6 +483,8 @@ grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_ grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); +grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info); + grub_err_t EXPORT_FUNC (grub_video_set_mode) (const char *modestring, unsigned int modemask, unsigned int modevalue); From 129185cfaae5969be4e49f5d898ed553b18d8502 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Dec 2010 18:03:34 +0000 Subject: [PATCH 05/65] move more EDID-handling functions to generic code, and make videoinfo display EDID information --- ChangeLog.vbe-autodetect | 15 +++++++++--- grub-core/commands/videoinfo.c | 31 ++++++++++++++++++++++++ grub-core/video/i386/pc/vbe.c | 36 +++++++++++++--------------- grub-core/video/video.c | 43 ++++++++++++++++++++++++++++++++++ include/grub/video.h | 6 +++++ 5 files changed, 108 insertions(+), 23 deletions(-) diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect index 0d96fc0a2..355ce00f6 100644 --- a/ChangeLog.vbe-autodetect +++ b/ChangeLog.vbe-autodetect @@ -3,24 +3,33 @@ Preferred resolution detection for VBE. * grub-core/video/video.c (grub_video_edid_checksum): New function. + (grub_video_get_edid): Likewise. + (grub_video_edid_preferred_mode): Likewise. Try EDID followed by + the Flat Panel extension, in line with the X.org VESA driver. * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info): - Likewise. + New function. (grub_vbe_bios_get_ddc_capabilities): Likewise. (grub_vbe_bios_read_edid): Likewise. - (grub_vbe_get_preferred_mode): Likewise. Try EDID followed by the - Flat Panel extension, in line with the X.org VESA driver. + (grub_vbe_get_preferred_mode): Likewise. (grub_video_vbe_setup): When the mode is "auto", try to get the preferred mode from VBE, and use the largest mode that is no larger than the preferred mode (some BIOSes expose a preferred mode that is not in their mode list!). If this fails, fall back to 640x480 as a safe conservative choice. + (grub_video_vbe_get_edid): New function. + (grub_video_vbe_adapter): Add get_edid. * include/grub/video.h (struct grub_vbe_edid_info): New structure. (grub_video_edid_checksum): Add prototype. + (grub_video_get_edid): Likewise. + (grub_video_edid_preferred_mode): Likewise. * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New structure. (grub_vbe_bios_get_flat_panel_info): Add prototype. (grub_vbe_bios_get_ddc_capabilities): Likewise. (grub_vbe_bios_read_edid): Likewise. + * grub-core/commands/videoinfo.c (print_edid): New function. + (grub_cmd_videoinfo): Print EDID if available. + * util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto". This is more appropriate on a wider range of platforms than 640x480. diff --git a/grub-core/commands/videoinfo.c b/grub-core/commands/videoinfo.c index 10f77915b..56df943ec 100644 --- a/grub-core/commands/videoinfo.c +++ b/grub-core/commands/videoinfo.c @@ -77,6 +77,30 @@ hook (const struct grub_video_mode_info *info) return 0; } +static void +print_edid (struct grub_video_edid_info *edid_info) +{ + unsigned int edid_width, edid_height; + + if (grub_video_edid_checksum (edid_info)) + { + grub_printf (" EDID checksum invalid\n"); + grub_errno = GRUB_ERR_NONE; + return; + } + + grub_printf (" EDID version: %u.%u\n", + edid_info->version, edid_info->revision); + if (grub_video_edid_preferred_mode (edid_info, &edid_width, &edid_height) + == GRUB_ERR_NONE) + grub_printf (" Preferred mode: %ux%u\n", edid_width, edid_height); + else + { + grub_printf (" No preferred mode available\n"); + grub_errno = GRUB_ERR_NONE; + } +} + static grub_err_t grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) @@ -120,6 +144,8 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), FOR_VIDEO_ADAPTERS (adapter) { + struct grub_video_edid_info edid_info; + grub_printf ("Adapter '%s':\n", adapter->name); if (!adapter->iterate) @@ -143,6 +169,11 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), adapter->iterate (hook); + if (adapter->get_edid (&edid_info) == GRUB_ERR_NONE) + print_edid (&edid_info); + else + grub_errno = GRUB_ERR_NONE; + if (adapter->id != id) { if (adapter->fini ()) diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index e2dcc151e..c6bb733a9 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -389,26 +389,12 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) == GRUB_VBE_STATUS_OK) { - status = grub_vbe_bios_read_edid (&edid_info); - /* Bit 1 in the Feature Support field indicates that the first - Detailed Timing Description is the preferred timing mode. */ - if (status == GRUB_VBE_STATUS_OK - && grub_video_edid_checksum (&edid_info) == GRUB_ERR_NONE - && edid_info.version == 1 /* we don't understand later versions */ - && (edid_info.feature_support - & GRUB_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE) - && edid_info.detailed_timings[0].pixel_clock) - { - *width = edid_info.detailed_timings[0].horizontal_active_lo - | (((unsigned int) - (edid_info.detailed_timings[0].horizontal_hi & 0xf0)) - << 4); - *height = edid_info.detailed_timings[0].vertical_active_lo - | (((unsigned int) - (edid_info.detailed_timings[0].vertical_hi & 0xf0)) - << 4); - return GRUB_ERR_NONE; - } + if (grub_video_get_edid (&edid_info) == GRUB_ERR_NONE + && grub_video_edid_preferred_mode (&edid_info, width, height) + == GRUB_ERR_NONE) + return GRUB_ERR_NONE; + + grub_errno = GRUB_ERR_NONE; } status = grub_vbe_bios_get_flat_panel_info (&flat_panel_info); @@ -978,6 +964,15 @@ grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info, return grub_video_fb_get_info_and_fini (mode_info, framebuf); } +static grub_err_t +grub_video_vbe_get_edid (struct grub_video_edid_info *edid_info) +{ + if (grub_vbe_bios_read_edid (edid_info) != GRUB_VBE_STATUS_OK) + return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available"); + + return GRUB_ERR_NONE; +} + static void grub_video_vbe_print_adapter_specific_info (void) { @@ -1022,6 +1017,7 @@ static struct grub_video_adapter grub_video_vbe_adapter = .set_active_render_target = grub_video_fb_set_active_render_target, .get_active_render_target = grub_video_fb_get_active_render_target, .iterate = grub_video_vbe_iterate, + .get_edid = grub_video_vbe_get_edid, .print_adapter_specific_info = grub_video_vbe_print_adapter_specific_info, .next = 0 diff --git a/grub-core/video/video.c b/grub-core/video/video.c index f3ecab94d..84e98bb67 100644 --- a/grub-core/video/video.c +++ b/grub-core/video/video.c @@ -393,6 +393,49 @@ grub_video_edid_checksum (struct grub_video_edid_info *edid_info) return grub_errno; } +grub_err_t +grub_video_get_edid (struct grub_video_edid_info *edid_info) +{ + if (! grub_video_adapter_active) + return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); + + if (! grub_video_adapter_active->get_edid) + return grub_error (GRUB_ERR_BAD_DEVICE, + "EDID information unavailable for this video mode"); + + if (grub_video_adapter_active->get_edid (edid_info) != GRUB_ERR_NONE) + return grub_errno; + if (grub_video_edid_checksum (edid_info) != GRUB_ERR_NONE) + return grub_errno; + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, + unsigned int *width, unsigned int *height) +{ + /* Bit 1 in the Feature Support field indicates that the first + Detailed Timing Description is the preferred timing mode. */ + if (edid_info->version == 1 /* we don't understand later versions */ + && (edid_info->feature_support + & GRUB_VIDEO_EDID_FEATURE_PREFERRED_TIMING_MODE) + && edid_info->detailed_timings[0].pixel_clock) + { + *width = edid_info->detailed_timings[0].horizontal_active_lo + | (((unsigned int) + (edid_info->detailed_timings[0].horizontal_hi & 0xf0)) + << 4); + *height = edid_info->detailed_timings[0].vertical_active_lo + | (((unsigned int) + (edid_info->detailed_timings[0].vertical_hi & 0xf0)) + << 4); + return GRUB_ERR_NONE; + } + + return grub_error (GRUB_ERR_BAD_DEVICE, "no preferred mode available"); +} + /* Parse x[x]*/ static grub_err_t parse_modespec (const char *current_mode, int *width, int *height, int *depth) diff --git a/include/grub/video.h b/include/grub/video.h index 2cf1424c4..2251ed5f4 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -371,6 +371,8 @@ struct grub_video_adapter int (*iterate) (int (*hook) (const struct grub_video_mode_info *info)); + grub_err_t (*get_edid) (struct grub_video_edid_info *edid_info); + void (*print_adapter_specific_info) (void); }; typedef struct grub_video_adapter *grub_video_adapter_t; @@ -484,6 +486,10 @@ grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_ grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info); +grub_err_t grub_video_get_edid (struct grub_video_edid_info *edid_info); +grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, + unsigned int *width, + unsigned int *height); grub_err_t EXPORT_FUNC (grub_video_set_mode) (const char *modestring, unsigned int modemask, From ef429417b2297c508685d9b1cc43e0bee74f0f44 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Dec 2010 18:08:27 +0000 Subject: [PATCH 06/65] mention struct grub_video_adapter change --- ChangeLog.vbe-autodetect | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect index 355ce00f6..d8034b885 100644 --- a/ChangeLog.vbe-autodetect +++ b/ChangeLog.vbe-autodetect @@ -19,6 +19,7 @@ (grub_video_vbe_get_edid): New function. (grub_video_vbe_adapter): Add get_edid. * include/grub/video.h (struct grub_vbe_edid_info): New structure. + (struct grub_video_adapter): Add get_edid. (grub_video_edid_checksum): Add prototype. (grub_video_get_edid): Likewise. (grub_video_edid_preferred_mode): Likewise. From 015e21571c2ecaacb7eb59c2cfde566d1290c445 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Dec 2010 19:03:28 +0000 Subject: [PATCH 07/65] check that adapter->get_edid is non-NULL --- grub-core/commands/videoinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/commands/videoinfo.c b/grub-core/commands/videoinfo.c index 56df943ec..9bd0a0e78 100644 --- a/grub-core/commands/videoinfo.c +++ b/grub-core/commands/videoinfo.c @@ -169,7 +169,7 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)), adapter->iterate (hook); - if (adapter->get_edid (&edid_info) == GRUB_ERR_NONE) + if (adapter->get_edid && adapter->get_edid (&edid_info) == GRUB_ERR_NONE) print_edid (&edid_info); else grub_errno = GRUB_ERR_NONE; From 13fc463f17281442f13c5ed3dc586f22efaaa2af Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 15 Jan 2011 14:18:16 -0600 Subject: [PATCH 08/65] Make new grub_vbe_bios_* functions static. --- ChangeLog.vbe-autodetect | 5 +---- grub-core/video/i386/pc/vbe.c | 6 +++--- include/grub/i386/pc/vbe.h | 9 --------- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect index d8034b885..46aacef7b 100644 --- a/ChangeLog.vbe-autodetect +++ b/ChangeLog.vbe-autodetect @@ -1,4 +1,4 @@ -2010-12-14 Colin Watson +2011-01-15 Colin Watson Preferred resolution detection for VBE. @@ -25,9 +25,6 @@ (grub_video_edid_preferred_mode): Likewise. * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New structure. - (grub_vbe_bios_get_flat_panel_info): Add prototype. - (grub_vbe_bios_get_ddc_capabilities): Likewise. - (grub_vbe_bios_read_edid): Likewise. * grub-core/commands/videoinfo.c (print_edid): New function. (grub_cmd_videoinfo): Print EDID if available. diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index c6bb733a9..29b67beeb 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -274,7 +274,7 @@ grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset, } /* Call VESA BIOS 0x4f11 to get flat panel information, return status. */ -grub_vbe_status_t +static grub_vbe_status_t grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_info) { struct grub_bios_int_registers regs; @@ -289,7 +289,7 @@ grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_i } /* Call VESA BIOS 0x4f15 to get DDC availability, return status. */ -grub_vbe_status_t +static grub_vbe_status_t grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level) { struct grub_bios_int_registers regs; @@ -307,7 +307,7 @@ grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level) } /* Call VESA BIOS 0x4f15 to read EDID information, return status. */ -grub_vbe_status_t +static grub_vbe_status_t grub_vbe_bios_read_edid (struct grub_video_edid_info *edid_info) { struct grub_bios_int_registers regs; diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index 0422558db..09ad7eb64 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -214,15 +214,6 @@ grub_vbe_bios_get_scanline_length (grub_uint32_t *length); grub_vbe_status_t grub_vbe_bios_get_display_start (grub_uint32_t *x, grub_uint32_t *y); -/* Call VESA BIOS 0x4f11 to get flat panel information, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_info); -/* Call VESA BIOS 0x4f15 to get DDC availability, return status. */ -grub_vbe_status_t -grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level); -/* Call VESA BIOS 0x4f15 to read EDID information, return status. */ -grub_vbe_status_t -grub_vbe_bios_read_edid (struct grub_video_edid_info *edid_data); grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *width); From 4f8ba1461b82f886557293c26da82fe590d556cd Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 17 Jan 2011 11:56:36 +0000 Subject: [PATCH 09/65] Use low memory scratch area for EDID and FP calls. --- grub-core/video/i386/pc/vbe.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index 29b67beeb..ea60c6074 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -383,7 +383,12 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) grub_vbe_status_t status; grub_uint8_t ddc_level; struct grub_video_edid_info edid_info; - struct grub_vbe_flat_panel_info flat_panel_info; + struct grub_vbe_flat_panel_info *flat_panel_info; + + /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ + flat_panel_info = (struct grub_vbe_flat_panel_info *) + (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + sizeof (struct grub_video_edid_info)); + grub_memset (flat_panel_info, 0, sizeof (*flat_panel_info)); if (controller_info.version >= 0x200 && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) @@ -397,7 +402,7 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) grub_errno = GRUB_ERR_NONE; } - status = grub_vbe_bios_get_flat_panel_info (&flat_panel_info); + status = grub_vbe_bios_get_flat_panel_info (flat_panel_info); if (status == GRUB_VBE_STATUS_OK) { *width = flat_panel_info.horizontal_size; @@ -967,9 +972,18 @@ grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info, static grub_err_t grub_video_vbe_get_edid (struct grub_video_edid_info *edid_info) { - if (grub_vbe_bios_read_edid (edid_info) != GRUB_VBE_STATUS_OK) + struct grub_video_edid_info *edid_info_lowmem; + + /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ + edid_info_lowmem = + (struct grub_video_edid_info *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + grub_memset (edid_info_lowmem, 0, sizeof (*edid_info_lowmem)); + + if (grub_vbe_bios_read_edid (edid_info_lowmem) != GRUB_VBE_STATUS_OK) return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available"); + grub_memcpy (edid_info, edid_info_lowmem, sizeof (*edid_info)); + return GRUB_ERR_NONE; } From cb918eddf4fd5c2d2d07ac5da6fa8074604b3e5f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 17 Jan 2011 12:05:12 +0000 Subject: [PATCH 10/65] fix FP info handling --- grub-core/video/i386/pc/vbe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index ea60c6074..c2b35a851 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -405,8 +405,8 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) status = grub_vbe_bios_get_flat_panel_info (flat_panel_info); if (status == GRUB_VBE_STATUS_OK) { - *width = flat_panel_info.horizontal_size; - *height = flat_panel_info.vertical_size; + *width = flat_panel_info->horizontal_size; + *height = flat_panel_info->vertical_size; return GRUB_ERR_NONE; } From 9b300caf8455dd0b8c3910330b063ff5777f0a36 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 17 Jan 2011 12:07:47 +0000 Subject: [PATCH 11/65] grub_video_get_edid is not usable from grub_vbe_get_preferred_mode, as a video adapter has not necessarily yet been set. Use grub_video_vbe_get_edid and grub_video_edid_checksum directly instead. Remove grub_video_get_edid as it now has no users. Reported by: Marjo Mercado. --- ChangeLog.vbe-autodetect | 4 +--- grub-core/video/i386/pc/vbe.c | 39 ++++++++++++++++++----------------- grub-core/video/video.c | 18 ---------------- include/grub/video.h | 1 - 4 files changed, 21 insertions(+), 41 deletions(-) diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect index 46aacef7b..3341e8cc3 100644 --- a/ChangeLog.vbe-autodetect +++ b/ChangeLog.vbe-autodetect @@ -1,9 +1,8 @@ -2011-01-15 Colin Watson +2011-01-17 Colin Watson Preferred resolution detection for VBE. * grub-core/video/video.c (grub_video_edid_checksum): New function. - (grub_video_get_edid): Likewise. (grub_video_edid_preferred_mode): Likewise. Try EDID followed by the Flat Panel extension, in line with the X.org VESA driver. * grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info): @@ -21,7 +20,6 @@ * include/grub/video.h (struct grub_vbe_edid_info): New structure. (struct grub_video_adapter): Add get_edid. (grub_video_edid_checksum): Add prototype. - (grub_video_get_edid): Likewise. (grub_video_edid_preferred_mode): Likewise. * include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New structure. diff --git a/grub-core/video/i386/pc/vbe.c b/grub-core/video/i386/pc/vbe.c index c2b35a851..f94b06060 100644 --- a/grub-core/video/i386/pc/vbe.c +++ b/grub-core/video/i386/pc/vbe.c @@ -377,6 +377,24 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) return GRUB_ERR_NONE; } +static grub_err_t +grub_video_vbe_get_edid (struct grub_video_edid_info *edid_info) +{ + struct grub_video_edid_info *edid_info_lowmem; + + /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ + edid_info_lowmem = + (struct grub_video_edid_info *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + grub_memset (edid_info_lowmem, 0, sizeof (*edid_info_lowmem)); + + if (grub_vbe_bios_read_edid (edid_info_lowmem) != GRUB_VBE_STATUS_OK) + return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available"); + + grub_memcpy (edid_info, edid_info_lowmem, sizeof (*edid_info)); + + return GRUB_ERR_NONE; +} + static grub_err_t grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) { @@ -394,7 +412,8 @@ grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height) && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff) == GRUB_VBE_STATUS_OK) { - if (grub_video_get_edid (&edid_info) == GRUB_ERR_NONE + if (grub_video_vbe_get_edid (&edid_info) == GRUB_ERR_NONE + && grub_video_edid_checksum (&edid_info) == GRUB_ERR_NONE && grub_video_edid_preferred_mode (&edid_info, width, height) == GRUB_ERR_NONE) return GRUB_ERR_NONE; @@ -969,24 +988,6 @@ grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info, return grub_video_fb_get_info_and_fini (mode_info, framebuf); } -static grub_err_t -grub_video_vbe_get_edid (struct grub_video_edid_info *edid_info) -{ - struct grub_video_edid_info *edid_info_lowmem; - - /* Use low memory scratch area as temporary storage for VESA BIOS calls. */ - edid_info_lowmem = - (struct grub_video_edid_info *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - grub_memset (edid_info_lowmem, 0, sizeof (*edid_info_lowmem)); - - if (grub_vbe_bios_read_edid (edid_info_lowmem) != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available"); - - grub_memcpy (edid_info, edid_info_lowmem, sizeof (*edid_info)); - - return GRUB_ERR_NONE; -} - static void grub_video_vbe_print_adapter_specific_info (void) { diff --git a/grub-core/video/video.c b/grub-core/video/video.c index 84e98bb67..01bdd1ff3 100644 --- a/grub-core/video/video.c +++ b/grub-core/video/video.c @@ -393,24 +393,6 @@ grub_video_edid_checksum (struct grub_video_edid_info *edid_info) return grub_errno; } -grub_err_t -grub_video_get_edid (struct grub_video_edid_info *edid_info) -{ - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "no video mode activated"); - - if (! grub_video_adapter_active->get_edid) - return grub_error (GRUB_ERR_BAD_DEVICE, - "EDID information unavailable for this video mode"); - - if (grub_video_adapter_active->get_edid (edid_info) != GRUB_ERR_NONE) - return grub_errno; - if (grub_video_edid_checksum (edid_info) != GRUB_ERR_NONE) - return grub_errno; - - return GRUB_ERR_NONE; -} - grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, unsigned int *width, unsigned int *height) diff --git a/include/grub/video.h b/include/grub/video.h index 2251ed5f4..f42730a7d 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -486,7 +486,6 @@ grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_ grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info); -grub_err_t grub_video_get_edid (struct grub_video_edid_info *edid_info); grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, unsigned int *width, unsigned int *height); From 421284f2998aa3e9134372379a2bd03de08a2740 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 30 Mar 2011 10:19:08 +0100 Subject: [PATCH 12/65] * docs/grub.texi (Simple configuration): Update GRUB_GFXMODE documentation. --- ChangeLog.vbe-autodetect | 2 ++ docs/grub.texi | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.vbe-autodetect b/ChangeLog.vbe-autodetect index 3341e8cc3..6308e5793 100644 --- a/ChangeLog.vbe-autodetect +++ b/ChangeLog.vbe-autodetect @@ -29,3 +29,5 @@ * util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto". This is more appropriate on a wider range of platforms than 640x480. + * docs/grub.texi (Simple configuration): Update GRUB_GFXMODE + documentation. diff --git a/docs/grub.texi b/docs/grub.texi index 54a2d8791..885bb4731 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1140,7 +1140,8 @@ listed in @file{/boot/grub/video.lst}. Set the resolution used on the @samp{gfxterm} graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be -available. The default is @samp{640x480}. +available. The default is @samp{auto}, which tries to select a preferred +resolution. @item GRUB_BACKGROUND Set a background image for use with the @samp{gfxterm} graphical terminal. From 16a2bab03c78d1f727ab48fe9af47abe6bea7b22 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 10 Jul 2011 15:32:43 +0200 Subject: [PATCH 13/65] * util/grub-install.in: Source grub-mkconfig_lib. --- ChangeLog | 4 ++++ util/grub-install.in | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 33c5b0b92..96b48f2fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-10 Vladimir Serbinenko + + * util/grub-install.in: Source grub-mkconfig_lib. + 2011-07-08 Vladimir Serbinenko Remove getroot.c from core on emu platform. diff --git a/util/grub-install.in b/util/grub-install.in index 09894d0d0..711c9c7e2 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -59,6 +59,8 @@ update_nvram=yes removable=no efi_quiet= +. ${libdir}/@PACKAGE@/grub-mkconfig_lib + # Get GRUB_DISTRIBUTOR. if test -f "${sysconfdir}/default/grub" ; then . "${sysconfdir}/default/grub" From c4edd548324dd0c1bfdd5d8cc4566de25074fdb6 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 10 Jul 2011 15:33:57 +0200 Subject: [PATCH 14/65] * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix incorrect memory usage. --- ChangeLog | 5 +++++ grub-core/disk/efi/efidisk.c | 9 +++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96b48f2fe..cf2354f6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-10 Vladimir Serbinenko + + * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix + incorrect memory usage. + 2011-07-10 Vladimir Serbinenko * util/grub-install.in: Source grub-mkconfig_lib. diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index 85969cc1d..0baeb8e4b 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -709,7 +709,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) && (GRUB_EFI_DEVICE_PATH_SUBTYPE (ldp) == GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE)) { - grub_partition_t tpart = NULL; + char *partition_name = NULL; char *device_name; grub_efi_device_path_t *dup_dp, *dup_ldp; grub_efi_hard_drive_device_path_t hd; @@ -722,7 +722,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) if (grub_partition_get_start (part) == hd.partition_start && grub_partition_get_len (part) == hd.partition_size) { - tpart = part; + partition_name = grub_partition_get_name (part); return 1; } @@ -760,17 +760,14 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) } else { - char *partition_name; - grub_partition_iterate (parent, find_partition); - if (! tpart) + if (! partition_name) { grub_disk_close (parent); return 0; } - partition_name = grub_partition_get_name (tpart); device_name = grub_xasprintf ("%s,%s", parent->name, partition_name); grub_free (partition_name); } From e4bcf6258cd128aa81257ca8dd217596f9cd5771 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 10 Jul 2011 15:56:56 +0200 Subject: [PATCH 15/65] * po/POTFILES.in: Regenerate. --- ChangeLog | 4 + po/POTFILES.in | 1076 ++++++++++++++++++++++++------------------------ 2 files changed, 542 insertions(+), 538 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf2354f6d..84167f226 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-10 Vladimir Serbinenko + + * po/POTFILES.in: Regenerate. + 2011-07-10 Vladimir Serbinenko * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name): Fix diff --git a/po/POTFILES.in b/po/POTFILES.in index 83cb48b2c..ebb0aadaa 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,538 +1,538 @@ -grub-core/boot/decompressor/minilib.c -grub-core/boot/decompressor/none.c -grub-core/boot/decompressor/xz.c -grub-core/bus/bonito.c -grub-core/bus/cs5536.c -grub-core/bus/emu/pci.c -grub-core/bus/pci.c -grub-core/bus/usb/emu/usb.c -grub-core/bus/usb/ohci.c -grub-core/bus/usb/serial/common.c -grub-core/bus/usb/serial/ftdi.c -grub-core/bus/usb/serial/pl2303.c -grub-core/bus/usb/uhci.c -grub-core/bus/usb/usb.c -grub-core/bus/usb/usbhub.c -grub-core/bus/usb/usbtrans.c -grub-core/commands/acpi.c -grub-core/commands/acpihalt.c -grub-core/commands/arc/lsdev.c -grub-core/commands/blocklist.c -grub-core/commands/boot.c -grub-core/commands/cat.c -grub-core/commands/cmp.c -grub-core/commands/configfile.c -grub-core/commands/date.c -grub-core/commands/echo.c -grub-core/commands/efi/acpi.c -grub-core/commands/efi/fixvideo.c -grub-core/commands/efi/loadbios.c -grub-core/commands/efi/lsefimmap.c -grub-core/commands/efi/lsefisystab.c -grub-core/commands/efi/lssal.c -grub-core/commands/extcmd.c -grub-core/commands/gptsync.c -grub-core/commands/halt.c -grub-core/commands/hashsum.c -grub-core/commands/hdparm.c -grub-core/commands/help.c -grub-core/commands/hexdump.c -grub-core/commands/i386/cmostest.c -grub-core/commands/i386/cpuid.c -grub-core/commands/i386/pc/acpi.c -grub-core/commands/i386/pc/drivemap.c -grub-core/commands/i386/pc/halt.c -grub-core/commands/i386/pc/lsapm.c -grub-core/commands/i386/pc/play.c -grub-core/commands/i386/pc/sendkey.c -grub-core/commands/ieee1275/suspend.c -grub-core/commands/iorw.c -grub-core/commands/keylayouts.c -grub-core/commands/keystatus.c -grub-core/commands/legacycfg.c -grub-core/commands/loadenv.c -grub-core/commands/lsacpi.c -grub-core/commands/ls.c -grub-core/commands/lsmmap.c -grub-core/commands/lspci.c -grub-core/commands/memrw.c -grub-core/commands/menuentry.c -grub-core/commands/minicmd.c -grub-core/commands/mips/loongson/lsspd.c -grub-core/commands/parttool.c -grub-core/commands/password.c -grub-core/commands/password_pbkdf2.c -grub-core/commands/probe.c -grub-core/commands/read.c -grub-core/commands/reboot.c -grub-core/commands/regexp.c -grub-core/commands/search.c -grub-core/commands/search_file.c -grub-core/commands/search_label.c -grub-core/commands/search_uuid.c -grub-core/commands/search_wrap.c -grub-core/commands/setpci.c -grub-core/commands/sleep.c -grub-core/commands/terminal.c -grub-core/commands/test.c -grub-core/commands/testload.c -grub-core/commands/time.c -grub-core/commands/true.c -grub-core/commands/usbtest.c -grub-core/commands/videoinfo.c -grub-core/commands/videotest.c -grub-core/commands/wildcard.c -grub-core/commands/xnu_uuid.c -grub-core/disk/AFSplitter.c -grub-core/disk/ahci.c -grub-core/disk/arc/arcdisk.c -grub-core/disk/ata.c -grub-core/disk/cryptodisk.c -grub-core/disk/dmraid_nvidia.c -grub-core/disk/efi/efidisk.c -grub-core/disk/geli.c -grub-core/disk/host.c -grub-core/disk/i386/pc/biosdisk.c -grub-core/disk/ieee1275/nand.c -grub-core/disk/ieee1275/ofdisk.c -grub-core/disk/loopback.c -grub-core/disk/luks.c -grub-core/disk/lvm.c -grub-core/disk/mdraid1x_linux.c -grub-core/disk/mdraid_linux.c -grub-core/disk/memdisk.c -grub-core/disk/pata.c -grub-core/disk/raid5_recover.c -grub-core/disk/raid6_recover.c -grub-core/disk/raid.c -grub-core/disk/scsi.c -grub-core/disk/usbms.c -grub-core/efiemu/i386/coredetect.c -grub-core/efiemu/i386/loadcore32.c -grub-core/efiemu/i386/loadcore64.c -grub-core/efiemu/i386/nocfgtables.c -grub-core/efiemu/i386/pc/cfgtables.c -grub-core/efiemu/loadcore32.c -grub-core/efiemu/loadcore64.c -grub-core/efiemu/loadcore.c -grub-core/efiemu/loadcore_common.c -grub-core/efiemu/main.c -grub-core/efiemu/mm.c -grub-core/efiemu/pnvram.c -grub-core/efiemu/prepare32.c -grub-core/efiemu/prepare64.c -grub-core/efiemu/prepare.c -grub-core/efiemu/runtime/efiemu.c -grub-core/efiemu/symbols.c -grub-core/font/font.c -grub-core/font/font_cmd.c -grub-core/fs/affs.c -grub-core/fs/afs_be.c -grub-core/fs/afs.c -grub-core/fs/befs_be.c -grub-core/fs/befs.c -grub-core/fs/btrfs.c -grub-core/fs/cpio.c -grub-core/fs/ext2.c -grub-core/fs/fat.c -grub-core/fs/fshelp.c -grub-core/fs/hfs.c -grub-core/fs/hfsplus.c -grub-core/fs/iso9660.c -grub-core/fs/jfs.c -grub-core/fs/minix2.c -grub-core/fs/minix3.c -grub-core/fs/minix.c -grub-core/fs/nilfs2.c -grub-core/fs/ntfs.c -grub-core/fs/ntfscomp.c -grub-core/fs/reiserfs.c -grub-core/fs/romfs.c -grub-core/fs/sfs.c -grub-core/fs/squash4.c -grub-core/fs/tar.c -grub-core/fs/udf.c -grub-core/fs/ufs2.c -grub-core/fs/ufs.c -grub-core/fs/xfs.c -grub-core/fs/zfs/zfs.c -grub-core/fs/zfs/zfs_fletcher.c -grub-core/fs/zfs/zfsinfo.c -grub-core/fs/zfs/zfs_lzjb.c -grub-core/fs/zfs/zfs_sha256.c -grub-core/gentrigtables.c -grub-core/gettext/gettext.c -grub-core/gfxmenu/font.c -grub-core/gfxmenu/gfxmenu.c -grub-core/gfxmenu/gui_box.c -grub-core/gfxmenu/gui_canvas.c -grub-core/gfxmenu/gui_circular_progress.c -grub-core/gfxmenu/gui_image.c -grub-core/gfxmenu/gui_label.c -grub-core/gfxmenu/gui_list.c -grub-core/gfxmenu/gui_progress_bar.c -grub-core/gfxmenu/gui_string_util.c -grub-core/gfxmenu/gui_util.c -grub-core/gfxmenu/icon_manager.c -grub-core/gfxmenu/model.c -grub-core/gfxmenu/theme_loader.c -grub-core/gfxmenu/view.c -grub-core/gfxmenu/widget-box.c -grub-core/gnulib/alloca.c -grub-core/gnulib/argp-ba.c -grub-core/gnulib/argp-eexst.c -grub-core/gnulib/argp-fmtstream.c -grub-core/gnulib/argp-fs-xinl.c -grub-core/gnulib/argp-help.c -grub-core/gnulib/argp-parse.c -grub-core/gnulib/argp-pin.c -grub-core/gnulib/argp-pv.c -grub-core/gnulib/argp-pvh.c -grub-core/gnulib/argp-xinl.c -grub-core/gnulib/asnprintf.c -grub-core/gnulib/basename-lgpl.c -grub-core/gnulib/btowc.c -grub-core/gnulib/dirname-lgpl.c -grub-core/gnulib/error.c -grub-core/gnulib/fnmatch.c -grub-core/gnulib/fnmatch_loop.c -grub-core/gnulib/getdelim.c -grub-core/gnulib/getline.c -grub-core/gnulib/getopt1.c -grub-core/gnulib/getopt.c -grub-core/gnulib/localcharset.c -grub-core/gnulib/malloc.c -grub-core/gnulib/mbrtowc.c -grub-core/gnulib/mbsinit.c -grub-core/gnulib/mbsrtowcs.c -grub-core/gnulib/mbsrtowcs-state.c -grub-core/gnulib/memchr.c -grub-core/gnulib/mempcpy.c -grub-core/gnulib/nl_langinfo.c -grub-core/gnulib/printf-args.c -grub-core/gnulib/printf-parse.c -grub-core/gnulib/progname.c -grub-core/gnulib/rawmemchr.c -grub-core/gnulib/realloc.c -grub-core/gnulib/regcomp.c -grub-core/gnulib/regex.c -grub-core/gnulib/regexec.c -grub-core/gnulib/regex_internal.c -grub-core/gnulib/sleep.c -grub-core/gnulib/stdio-write.c -grub-core/gnulib/strcasecmp.c -grub-core/gnulib/strchrnul.c -grub-core/gnulib/strerror.c -grub-core/gnulib/stripslash.c -grub-core/gnulib/strncasecmp.c -grub-core/gnulib/strndup.c -grub-core/gnulib/strnlen1.c -grub-core/gnulib/strnlen.c -grub-core/gnulib/vasnprintf.c -grub-core/gnulib/vsnprintf.c -grub-core/gnulib/wcrtomb.c -grub-core/hello/hello.c -grub-core/hook/datehook.c -grub-core/io/bufio.c -grub-core/io/gzio.c -grub-core/io/xzio.c -grub-core/kern/command.c -grub-core/kern/corecmd.c -grub-core/kern/device.c -grub-core/kern/disk.c -grub-core/kern/dl.c -grub-core/kern/efi/efi.c -grub-core/kern/efi/init.c -grub-core/kern/efi/mm.c -grub-core/kern/elf.c -grub-core/kern/emu/cache.c -grub-core/kern/emu/console.c -grub-core/kern/emu/full.c -grub-core/kern/emu/getroot.c -grub-core/kern/emu/hostdisk.c -grub-core/kern/emu/hostfs.c -grub-core/kern/emu/lite.c -grub-core/kern/emu/main.c -grub-core/kern/emu/misc.c -grub-core/kern/emu/mm.c -grub-core/kern/emu/raid.c -grub-core/kern/emu/time.c -grub-core/kern/env.c -grub-core/kern/err.c -grub-core/kern/file.c -grub-core/kern/fs.c -grub-core/kern/generic/millisleep.c -grub-core/kern/generic/rtc_get_time_ms.c -grub-core/kern/i386/coreboot/init.c -grub-core/kern/i386/coreboot/mmap.c -grub-core/kern/i386/dl.c -grub-core/kern/i386/efi/init.c -grub-core/kern/i386/multiboot_mmap.c -grub-core/kern/i386/pc/init.c -grub-core/kern/i386/pc/mmap.c -grub-core/kern/i386/pit.c -grub-core/kern/i386/qemu/mmap.c -grub-core/kern/i386/tsc.c -grub-core/kern/ia64/dl.c -grub-core/kern/ia64/dl_helper.c -grub-core/kern/ia64/efi/init.c -grub-core/kern/ieee1275/cmain.c -grub-core/kern/ieee1275/ieee1275.c -grub-core/kern/ieee1275/init.c -grub-core/kern/ieee1275/mmap.c -grub-core/kern/ieee1275/openfw.c -grub-core/kern/list.c -grub-core/kern/main.c -grub-core/kern/mips/arc/init.c -grub-core/kern/mips/dl.c -grub-core/kern/mips/init.c -grub-core/kern/mips/loongson/init.c -grub-core/kern/mips/qemu_mips/init.c -grub-core/kern/misc.c -grub-core/kern/mm.c -grub-core/kern/parser.c -grub-core/kern/partition.c -grub-core/kern/powerpc/dl.c -grub-core/kern/rescue_parser.c -grub-core/kern/rescue_reader.c -grub-core/kern/sparc64/dl.c -grub-core/kern/sparc64/ieee1275/ieee1275.c -grub-core/kern/term.c -grub-core/kern/time.c -grub-core/kern/vga_init.c -grub-core/kern/x86_64/dl.c -grub-core/lib/arc/datetime.c -grub-core/lib/arg.c -grub-core/lib/cmdline.c -grub-core/lib/cmos_datetime.c -grub-core/lib/crc.c -grub-core/lib/crypto.c -grub-core/lib/efi/datetime.c -grub-core/lib/efi/halt.c -grub-core/lib/efi/relocator.c -grub-core/lib/emu/halt.c -grub-core/lib/envblk.c -grub-core/lib/hexdump.c -grub-core/lib/i386/halt.c -grub-core/lib/i386/pc/biosnum.c -grub-core/lib/i386/pc/vesa_modes_table.c -grub-core/lib/i386/relocator.c -grub-core/lib/ieee1275/cmos.c -grub-core/lib/ieee1275/datetime.c -grub-core/lib/ieee1275/halt.c -grub-core/lib/ieee1275/relocator.c -grub-core/lib/legacy_parse.c -grub-core/lib/libgcrypt/cipher/ac.c -grub-core/lib/libgcrypt/cipher/arcfour.c -grub-core/lib/libgcrypt/cipher/blowfish.c -grub-core/lib/libgcrypt/cipher/camellia.c -grub-core/lib/libgcrypt/cipher/camellia-glue.c -grub-core/lib/libgcrypt/cipher/cast5.c -grub-core/lib/libgcrypt/cipher/cipher.c -grub-core/lib/libgcrypt/cipher/crc.c -grub-core/lib/libgcrypt/cipher/des.c -grub-core/lib/libgcrypt/cipher/dsa.c -grub-core/lib/libgcrypt/cipher/ecc.c -grub-core/lib/libgcrypt/cipher/elgamal.c -grub-core/lib/libgcrypt/cipher/hash-common.c -grub-core/lib/libgcrypt/cipher/hmac-tests.c -grub-core/lib/libgcrypt/cipher/md4.c -grub-core/lib/libgcrypt/cipher/md5.c -grub-core/lib/libgcrypt/cipher/md.c -grub-core/lib/libgcrypt/cipher/primegen.c -grub-core/lib/libgcrypt/cipher/pubkey.c -grub-core/lib/libgcrypt/cipher/rfc2268.c -grub-core/lib/libgcrypt/cipher/rijndael.c -grub-core/lib/libgcrypt/cipher/rmd160.c -grub-core/lib/libgcrypt/cipher/rsa.c -grub-core/lib/libgcrypt/cipher/seed.c -grub-core/lib/libgcrypt/cipher/serpent.c -grub-core/lib/libgcrypt/cipher/sha1.c -grub-core/lib/libgcrypt/cipher/sha256.c -grub-core/lib/libgcrypt/cipher/sha512.c -grub-core/lib/libgcrypt/cipher/tiger.c -grub-core/lib/libgcrypt/cipher/twofish.c -grub-core/lib/libgcrypt/cipher/whirlpool.c -grub-core/lib/libgcrypt-grub/cipher/arcfour.c -grub-core/lib/libgcrypt-grub/cipher/blowfish.c -grub-core/lib/libgcrypt-grub/cipher/camellia.c -grub-core/lib/libgcrypt-grub/cipher/camellia-glue.c -grub-core/lib/libgcrypt-grub/cipher/cast5.c -grub-core/lib/libgcrypt-grub/cipher/crc.c -grub-core/lib/libgcrypt-grub/cipher/des.c -grub-core/lib/libgcrypt-grub/cipher/dsa.c -grub-core/lib/libgcrypt-grub/cipher/ecc.c -grub-core/lib/libgcrypt-grub/cipher/elgamal.c -grub-core/lib/libgcrypt-grub/cipher/init.c -grub-core/lib/libgcrypt-grub/cipher/md4.c -grub-core/lib/libgcrypt-grub/cipher/md5.c -grub-core/lib/libgcrypt-grub/cipher/primegen.c -grub-core/lib/libgcrypt-grub/cipher/rfc2268.c -grub-core/lib/libgcrypt-grub/cipher/rijndael.c -grub-core/lib/libgcrypt-grub/cipher/rmd160.c -grub-core/lib/libgcrypt-grub/cipher/rsa.c -grub-core/lib/libgcrypt-grub/cipher/seed.c -grub-core/lib/libgcrypt-grub/cipher/serpent.c -grub-core/lib/libgcrypt-grub/cipher/sha1.c -grub-core/lib/libgcrypt-grub/cipher/sha256.c -grub-core/lib/libgcrypt-grub/cipher/sha512.c -grub-core/lib/libgcrypt-grub/cipher/tiger.c -grub-core/lib/libgcrypt-grub/cipher/twofish.c -grub-core/lib/libgcrypt-grub/cipher/whirlpool.c -grub-core/lib/LzFind.c -grub-core/lib/LzmaDec.c -grub-core/lib/LzmaEnc.c -grub-core/lib/mips/relocator.c -grub-core/lib/pbkdf2.c -grub-core/lib/powerpc/relocator.c -grub-core/lib/reed_solomon.c -grub-core/lib/relocator.c -grub-core/lib/xzembed/xz_dec_bcj.c -grub-core/lib/xzembed/xz_dec_lzma2.c -grub-core/lib/xzembed/xz_dec_stream.c -grub-core/loader/aout.c -grub-core/loader/efi/appleloader.c -grub-core/loader/efi/chainloader.c -grub-core/loader/i386/bsd32.c -grub-core/loader/i386/bsd64.c -grub-core/loader/i386/bsd.c -grub-core/loader/i386/bsd_pagetable.c -grub-core/loader/i386/bsdXX.c -grub-core/loader/i386/coreboot/chainloader.c -grub-core/loader/i386/linux.c -grub-core/loader/i386/multiboot_mbi.c -grub-core/loader/i386/pc/chainloader.c -grub-core/loader/i386/pc/freedos.c -grub-core/loader/i386/pc/linux.c -grub-core/loader/i386/pc/ntldr.c -grub-core/loader/i386/xnu.c -grub-core/loader/ia64/efi/linux.c -grub-core/loader/macho32.c -grub-core/loader/macho64.c -grub-core/loader/macho.c -grub-core/loader/machoXX.c -grub-core/loader/mips/linux.c -grub-core/loader/multiboot.c -grub-core/loader/multiboot_elfxx.c -grub-core/loader/multiboot_mbi2.c -grub-core/loader/powerpc/ieee1275/linux.c -grub-core/loader/sparc64/ieee1275/linux.c -grub-core/loader/xnu.c -grub-core/loader/xnu_resume.c -grub-core/mmap/efi/mmap.c -grub-core/mmap/i386/mmap.c -grub-core/mmap/i386/pc/mmap.c -grub-core/mmap/i386/uppermem.c -grub-core/mmap/mips/uppermem.c -grub-core/mmap/mmap.c -grub-core/net/arp.c -grub-core/net/bootp.c -grub-core/net/drivers/efi/efinet.c -grub-core/net/drivers/emu/emunet.c -grub-core/net/drivers/i386/pc/pxe.c -grub-core/net/drivers/ieee1275/ofnet.c -grub-core/net/ethernet.c -grub-core/net/ip.c -grub-core/net/netbuff.c -grub-core/net/net.c -grub-core/net/tftp.c -grub-core/net/udp.c -grub-core/normal/auth.c -grub-core/normal/autofs.c -grub-core/normal/charset.c -grub-core/normal/cmdline.c -grub-core/normal/color.c -grub-core/normal/completion.c -grub-core/normal/context.c -grub-core/normal/crypto.c -grub-core/normal/datetime.c -grub-core/normal/dyncmd.c -grub-core/normal/main.c -grub-core/normal/menu.c -grub-core/normal/menu_entry.c -grub-core/normal/menu_text.c -grub-core/normal/misc.c -grub-core/normal/term.c -grub-core/partmap/acorn.c -grub-core/partmap/amiga.c -grub-core/partmap/apple.c -grub-core/partmap/bsdlabel.c -grub-core/partmap/dvh.c -grub-core/partmap/gpt.c -grub-core/partmap/msdos.c -grub-core/partmap/sun.c -grub-core/partmap/sunpc.c -grub-core/parttool/msdospart.c -grub-core/script/argv.c -grub-core/script/execute.c -grub-core/script/function.c -grub-core/script/lexer.c -grub-core/script/main.c -grub-core/script/script.c -grub-core/term/arc/console.c -grub-core/term/at_keyboard.c -grub-core/term/efi/console.c -grub-core/term/gfxterm.c -grub-core/term/i386/pc/console.c -grub-core/term/i386/pc/vga_text.c -grub-core/term/i386/vga_common.c -grub-core/term/ieee1275/ofconsole.c -grub-core/term/ns8250.c -grub-core/term/serial.c -grub-core/term/terminfo.c -grub-core/term/tparm.c -grub-core/term/usb_keyboard.c -grub-core/tests/example_functional_test.c -grub-core/tests/lib/functional_test.c -grub-core/tests/lib/test.c -grub-core/tests/test_blockarg.c -grub-core/unidata.c -grub-core/video/bitmap.c -grub-core/video/bitmap_scale.c -grub-core/video/bochs.c -grub-core/video/cirrus.c -grub-core/video/colors.c -grub-core/video/efi_gop.c -grub-core/video/efi_uga.c -grub-core/video/emu/sdl.c -grub-core/video/fb/fbblit.c -grub-core/video/fb/fbfill.c -grub-core/video/fb/fbutil.c -grub-core/video/fb/video_fb.c -grub-core/video/i386/pc/vbe.c -grub-core/video/i386/pc/vga.c -grub-core/video/ieee1275.c -grub-core/video/readers/jpeg.c -grub-core/video/readers/png.c -grub-core/video/readers/tga.c -grub-core/video/sis315_init.c -grub-core/video/sis315pro.c -grub-core/video/sm712.c -grub-core/video/sm712_init.c -grub-core/video/video.c -tests/example_unit_test.c -tests/lib/unit_test.c -util/bin2h.c -util/deviceiter.c -util/devicemap.c -util/grub-editenv.c -util/grub-fstest.c -util/grub-macho2img.c -util/grub-menulst2cfg.c -util/grub-mkdevicemap.c -util/grub-mkfont.c -util/grub-mkimage.c -util/grub-mkimagexx.c -util/grub-mklayout.c -util/grub-mkpasswd-pbkdf2.c -util/grub-mkrelpath.c -util/grub-pe2elf.c -util/grub-probe.c -util/grub-script-check.c -util/grub-setup.c -util/ieee1275/devicemap.c -util/ieee1275/grub-ofpathname.c -util/ieee1275/ofpath.c -util/lvm.c -util/misc.c -util/resolve.c +./grub-core/boot/decompressor/minilib.c +./grub-core/boot/decompressor/none.c +./grub-core/boot/decompressor/xz.c +./grub-core/bus/bonito.c +./grub-core/bus/cs5536.c +./grub-core/bus/emu/pci.c +./grub-core/bus/pci.c +./grub-core/bus/usb/emu/usb.c +./grub-core/bus/usb/ohci.c +./grub-core/bus/usb/serial/common.c +./grub-core/bus/usb/serial/ftdi.c +./grub-core/bus/usb/serial/pl2303.c +./grub-core/bus/usb/uhci.c +./grub-core/bus/usb/usb.c +./grub-core/bus/usb/usbhub.c +./grub-core/bus/usb/usbtrans.c +./grub-core/commands/acpi.c +./grub-core/commands/acpihalt.c +./grub-core/commands/arc/lsdev.c +./grub-core/commands/blocklist.c +./grub-core/commands/boot.c +./grub-core/commands/cat.c +./grub-core/commands/cmp.c +./grub-core/commands/configfile.c +./grub-core/commands/date.c +./grub-core/commands/echo.c +./grub-core/commands/efi/acpi.c +./grub-core/commands/efi/fixvideo.c +./grub-core/commands/efi/loadbios.c +./grub-core/commands/efi/lsefimmap.c +./grub-core/commands/efi/lsefisystab.c +./grub-core/commands/efi/lssal.c +./grub-core/commands/extcmd.c +./grub-core/commands/gptsync.c +./grub-core/commands/halt.c +./grub-core/commands/hashsum.c +./grub-core/commands/hdparm.c +./grub-core/commands/help.c +./grub-core/commands/hexdump.c +./grub-core/commands/i386/cmostest.c +./grub-core/commands/i386/cpuid.c +./grub-core/commands/i386/pc/acpi.c +./grub-core/commands/i386/pc/drivemap.c +./grub-core/commands/i386/pc/halt.c +./grub-core/commands/i386/pc/lsapm.c +./grub-core/commands/i386/pc/play.c +./grub-core/commands/i386/pc/sendkey.c +./grub-core/commands/ieee1275/suspend.c +./grub-core/commands/iorw.c +./grub-core/commands/keylayouts.c +./grub-core/commands/keystatus.c +./grub-core/commands/legacycfg.c +./grub-core/commands/loadenv.c +./grub-core/commands/lsacpi.c +./grub-core/commands/ls.c +./grub-core/commands/lsmmap.c +./grub-core/commands/lspci.c +./grub-core/commands/memrw.c +./grub-core/commands/menuentry.c +./grub-core/commands/minicmd.c +./grub-core/commands/mips/loongson/lsspd.c +./grub-core/commands/parttool.c +./grub-core/commands/password.c +./grub-core/commands/password_pbkdf2.c +./grub-core/commands/probe.c +./grub-core/commands/read.c +./grub-core/commands/reboot.c +./grub-core/commands/regexp.c +./grub-core/commands/search.c +./grub-core/commands/search_file.c +./grub-core/commands/search_label.c +./grub-core/commands/search_uuid.c +./grub-core/commands/search_wrap.c +./grub-core/commands/setpci.c +./grub-core/commands/sleep.c +./grub-core/commands/terminal.c +./grub-core/commands/test.c +./grub-core/commands/testload.c +./grub-core/commands/time.c +./grub-core/commands/true.c +./grub-core/commands/usbtest.c +./grub-core/commands/videoinfo.c +./grub-core/commands/videotest.c +./grub-core/commands/wildcard.c +./grub-core/commands/xnu_uuid.c +./grub-core/disk/AFSplitter.c +./grub-core/disk/ahci.c +./grub-core/disk/arc/arcdisk.c +./grub-core/disk/ata.c +./grub-core/disk/cryptodisk.c +./grub-core/disk/dmraid_nvidia.c +./grub-core/disk/efi/efidisk.c +./grub-core/disk/geli.c +./grub-core/disk/host.c +./grub-core/disk/i386/pc/biosdisk.c +./grub-core/disk/ieee1275/nand.c +./grub-core/disk/ieee1275/ofdisk.c +./grub-core/disk/loopback.c +./grub-core/disk/luks.c +./grub-core/disk/lvm.c +./grub-core/disk/mdraid1x_linux.c +./grub-core/disk/mdraid_linux.c +./grub-core/disk/memdisk.c +./grub-core/disk/pata.c +./grub-core/disk/raid5_recover.c +./grub-core/disk/raid6_recover.c +./grub-core/disk/raid.c +./grub-core/disk/scsi.c +./grub-core/disk/usbms.c +./grub-core/efiemu/i386/coredetect.c +./grub-core/efiemu/i386/loadcore32.c +./grub-core/efiemu/i386/loadcore64.c +./grub-core/efiemu/i386/nocfgtables.c +./grub-core/efiemu/i386/pc/cfgtables.c +./grub-core/efiemu/loadcore32.c +./grub-core/efiemu/loadcore64.c +./grub-core/efiemu/loadcore.c +./grub-core/efiemu/loadcore_common.c +./grub-core/efiemu/main.c +./grub-core/efiemu/mm.c +./grub-core/efiemu/pnvram.c +./grub-core/efiemu/prepare32.c +./grub-core/efiemu/prepare64.c +./grub-core/efiemu/prepare.c +./grub-core/efiemu/runtime/efiemu.c +./grub-core/efiemu/symbols.c +./grub-core/font/font.c +./grub-core/font/font_cmd.c +./grub-core/fs/affs.c +./grub-core/fs/afs_be.c +./grub-core/fs/afs.c +./grub-core/fs/befs_be.c +./grub-core/fs/befs.c +./grub-core/fs/btrfs.c +./grub-core/fs/cpio.c +./grub-core/fs/ext2.c +./grub-core/fs/fat.c +./grub-core/fs/fshelp.c +./grub-core/fs/hfs.c +./grub-core/fs/hfsplus.c +./grub-core/fs/iso9660.c +./grub-core/fs/jfs.c +./grub-core/fs/minix2.c +./grub-core/fs/minix3.c +./grub-core/fs/minix.c +./grub-core/fs/nilfs2.c +./grub-core/fs/ntfs.c +./grub-core/fs/ntfscomp.c +./grub-core/fs/reiserfs.c +./grub-core/fs/romfs.c +./grub-core/fs/sfs.c +./grub-core/fs/squash4.c +./grub-core/fs/tar.c +./grub-core/fs/udf.c +./grub-core/fs/ufs2.c +./grub-core/fs/ufs.c +./grub-core/fs/xfs.c +./grub-core/fs/zfs/zfs.c +./grub-core/fs/zfs/zfs_fletcher.c +./grub-core/fs/zfs/zfsinfo.c +./grub-core/fs/zfs/zfs_lzjb.c +./grub-core/fs/zfs/zfs_sha256.c +./grub-core/gentrigtables.c +./grub-core/gettext/gettext.c +./grub-core/gfxmenu/font.c +./grub-core/gfxmenu/gfxmenu.c +./grub-core/gfxmenu/gui_box.c +./grub-core/gfxmenu/gui_canvas.c +./grub-core/gfxmenu/gui_circular_progress.c +./grub-core/gfxmenu/gui_image.c +./grub-core/gfxmenu/gui_label.c +./grub-core/gfxmenu/gui_list.c +./grub-core/gfxmenu/gui_progress_bar.c +./grub-core/gfxmenu/gui_string_util.c +./grub-core/gfxmenu/gui_util.c +./grub-core/gfxmenu/icon_manager.c +./grub-core/gfxmenu/model.c +./grub-core/gfxmenu/theme_loader.c +./grub-core/gfxmenu/view.c +./grub-core/gfxmenu/widget-box.c +./grub-core/gnulib/alloca.c +./grub-core/gnulib/argp-ba.c +./grub-core/gnulib/argp-eexst.c +./grub-core/gnulib/argp-fmtstream.c +./grub-core/gnulib/argp-fs-xinl.c +./grub-core/gnulib/argp-help.c +./grub-core/gnulib/argp-parse.c +./grub-core/gnulib/argp-pin.c +./grub-core/gnulib/argp-pv.c +./grub-core/gnulib/argp-pvh.c +./grub-core/gnulib/argp-xinl.c +./grub-core/gnulib/asnprintf.c +./grub-core/gnulib/basename-lgpl.c +./grub-core/gnulib/btowc.c +./grub-core/gnulib/dirname-lgpl.c +./grub-core/gnulib/error.c +./grub-core/gnulib/fnmatch.c +./grub-core/gnulib/fnmatch_loop.c +./grub-core/gnulib/getdelim.c +./grub-core/gnulib/getline.c +./grub-core/gnulib/getopt1.c +./grub-core/gnulib/getopt.c +./grub-core/gnulib/localcharset.c +./grub-core/gnulib/malloc.c +./grub-core/gnulib/mbrtowc.c +./grub-core/gnulib/mbsinit.c +./grub-core/gnulib/mbsrtowcs.c +./grub-core/gnulib/mbsrtowcs-state.c +./grub-core/gnulib/memchr.c +./grub-core/gnulib/mempcpy.c +./grub-core/gnulib/nl_langinfo.c +./grub-core/gnulib/printf-args.c +./grub-core/gnulib/printf-parse.c +./grub-core/gnulib/progname.c +./grub-core/gnulib/rawmemchr.c +./grub-core/gnulib/realloc.c +./grub-core/gnulib/regcomp.c +./grub-core/gnulib/regex.c +./grub-core/gnulib/regexec.c +./grub-core/gnulib/regex_internal.c +./grub-core/gnulib/sleep.c +./grub-core/gnulib/stdio-write.c +./grub-core/gnulib/strcasecmp.c +./grub-core/gnulib/strchrnul.c +./grub-core/gnulib/strerror.c +./grub-core/gnulib/stripslash.c +./grub-core/gnulib/strncasecmp.c +./grub-core/gnulib/strndup.c +./grub-core/gnulib/strnlen1.c +./grub-core/gnulib/strnlen.c +./grub-core/gnulib/vasnprintf.c +./grub-core/gnulib/vsnprintf.c +./grub-core/gnulib/wcrtomb.c +./grub-core/hello/hello.c +./grub-core/hook/datehook.c +./grub-core/io/bufio.c +./grub-core/io/gzio.c +./grub-core/io/xzio.c +./grub-core/kern/command.c +./grub-core/kern/corecmd.c +./grub-core/kern/device.c +./grub-core/kern/disk.c +./grub-core/kern/dl.c +./grub-core/kern/efi/efi.c +./grub-core/kern/efi/init.c +./grub-core/kern/efi/mm.c +./grub-core/kern/elf.c +./grub-core/kern/emu/cache.c +./grub-core/kern/emu/console.c +./grub-core/kern/emu/full.c +./grub-core/kern/emu/hostdisk.c +./grub-core/kern/emu/hostfs.c +./grub-core/kern/emu/lite.c +./grub-core/kern/emu/main.c +./grub-core/kern/emu/misc.c +./grub-core/kern/emu/mm.c +./grub-core/kern/emu/time.c +./grub-core/kern/env.c +./grub-core/kern/err.c +./grub-core/kern/file.c +./grub-core/kern/fs.c +./grub-core/kern/generic/millisleep.c +./grub-core/kern/generic/rtc_get_time_ms.c +./grub-core/kern/i386/coreboot/init.c +./grub-core/kern/i386/coreboot/mmap.c +./grub-core/kern/i386/dl.c +./grub-core/kern/i386/efi/init.c +./grub-core/kern/i386/multiboot_mmap.c +./grub-core/kern/i386/pc/init.c +./grub-core/kern/i386/pc/mmap.c +./grub-core/kern/i386/pit.c +./grub-core/kern/i386/qemu/mmap.c +./grub-core/kern/i386/tsc.c +./grub-core/kern/ia64/dl.c +./grub-core/kern/ia64/dl_helper.c +./grub-core/kern/ia64/efi/init.c +./grub-core/kern/ieee1275/cmain.c +./grub-core/kern/ieee1275/ieee1275.c +./grub-core/kern/ieee1275/init.c +./grub-core/kern/ieee1275/mmap.c +./grub-core/kern/ieee1275/openfw.c +./grub-core/kern/list.c +./grub-core/kern/main.c +./grub-core/kern/mips/arc/init.c +./grub-core/kern/mips/dl.c +./grub-core/kern/mips/init.c +./grub-core/kern/mips/loongson/init.c +./grub-core/kern/mips/qemu_mips/init.c +./grub-core/kern/misc.c +./grub-core/kern/mm.c +./grub-core/kern/parser.c +./grub-core/kern/partition.c +./grub-core/kern/powerpc/dl.c +./grub-core/kern/rescue_parser.c +./grub-core/kern/rescue_reader.c +./grub-core/kern/sparc64/dl.c +./grub-core/kern/sparc64/ieee1275/ieee1275.c +./grub-core/kern/term.c +./grub-core/kern/time.c +./grub-core/kern/vga_init.c +./grub-core/kern/x86_64/dl.c +./grub-core/lib/arc/datetime.c +./grub-core/lib/arg.c +./grub-core/lib/cmdline.c +./grub-core/lib/cmos_datetime.c +./grub-core/lib/crc.c +./grub-core/lib/crypto.c +./grub-core/lib/efi/datetime.c +./grub-core/lib/efi/halt.c +./grub-core/lib/efi/relocator.c +./grub-core/lib/emu/halt.c +./grub-core/lib/envblk.c +./grub-core/lib/hexdump.c +./grub-core/lib/i386/halt.c +./grub-core/lib/i386/pc/biosnum.c +./grub-core/lib/i386/pc/vesa_modes_table.c +./grub-core/lib/i386/relocator.c +./grub-core/lib/ieee1275/cmos.c +./grub-core/lib/ieee1275/datetime.c +./grub-core/lib/ieee1275/halt.c +./grub-core/lib/ieee1275/relocator.c +./grub-core/lib/legacy_parse.c +./grub-core/lib/libgcrypt/cipher/ac.c +./grub-core/lib/libgcrypt/cipher/arcfour.c +./grub-core/lib/libgcrypt/cipher/blowfish.c +./grub-core/lib/libgcrypt/cipher/camellia.c +./grub-core/lib/libgcrypt/cipher/camellia-glue.c +./grub-core/lib/libgcrypt/cipher/cast5.c +./grub-core/lib/libgcrypt/cipher/cipher.c +./grub-core/lib/libgcrypt/cipher/crc.c +./grub-core/lib/libgcrypt/cipher/des.c +./grub-core/lib/libgcrypt/cipher/dsa.c +./grub-core/lib/libgcrypt/cipher/ecc.c +./grub-core/lib/libgcrypt/cipher/elgamal.c +./grub-core/lib/libgcrypt/cipher/hash-common.c +./grub-core/lib/libgcrypt/cipher/hmac-tests.c +./grub-core/lib/libgcrypt/cipher/md4.c +./grub-core/lib/libgcrypt/cipher/md5.c +./grub-core/lib/libgcrypt/cipher/md.c +./grub-core/lib/libgcrypt/cipher/primegen.c +./grub-core/lib/libgcrypt/cipher/pubkey.c +./grub-core/lib/libgcrypt/cipher/rfc2268.c +./grub-core/lib/libgcrypt/cipher/rijndael.c +./grub-core/lib/libgcrypt/cipher/rmd160.c +./grub-core/lib/libgcrypt/cipher/rsa.c +./grub-core/lib/libgcrypt/cipher/seed.c +./grub-core/lib/libgcrypt/cipher/serpent.c +./grub-core/lib/libgcrypt/cipher/sha1.c +./grub-core/lib/libgcrypt/cipher/sha256.c +./grub-core/lib/libgcrypt/cipher/sha512.c +./grub-core/lib/libgcrypt/cipher/tiger.c +./grub-core/lib/libgcrypt/cipher/twofish.c +./grub-core/lib/libgcrypt/cipher/whirlpool.c +./grub-core/lib/libgcrypt-grub/cipher/arcfour.c +./grub-core/lib/libgcrypt-grub/cipher/blowfish.c +./grub-core/lib/libgcrypt-grub/cipher/camellia.c +./grub-core/lib/libgcrypt-grub/cipher/camellia-glue.c +./grub-core/lib/libgcrypt-grub/cipher/cast5.c +./grub-core/lib/libgcrypt-grub/cipher/crc.c +./grub-core/lib/libgcrypt-grub/cipher/des.c +./grub-core/lib/libgcrypt-grub/cipher/dsa.c +./grub-core/lib/libgcrypt-grub/cipher/ecc.c +./grub-core/lib/libgcrypt-grub/cipher/elgamal.c +./grub-core/lib/libgcrypt-grub/cipher/init.c +./grub-core/lib/libgcrypt-grub/cipher/md4.c +./grub-core/lib/libgcrypt-grub/cipher/md5.c +./grub-core/lib/libgcrypt-grub/cipher/primegen.c +./grub-core/lib/libgcrypt-grub/cipher/rfc2268.c +./grub-core/lib/libgcrypt-grub/cipher/rijndael.c +./grub-core/lib/libgcrypt-grub/cipher/rmd160.c +./grub-core/lib/libgcrypt-grub/cipher/rsa.c +./grub-core/lib/libgcrypt-grub/cipher/seed.c +./grub-core/lib/libgcrypt-grub/cipher/serpent.c +./grub-core/lib/libgcrypt-grub/cipher/sha1.c +./grub-core/lib/libgcrypt-grub/cipher/sha256.c +./grub-core/lib/libgcrypt-grub/cipher/sha512.c +./grub-core/lib/libgcrypt-grub/cipher/tiger.c +./grub-core/lib/libgcrypt-grub/cipher/twofish.c +./grub-core/lib/libgcrypt-grub/cipher/whirlpool.c +./grub-core/lib/LzFind.c +./grub-core/lib/LzmaDec.c +./grub-core/lib/LzmaEnc.c +./grub-core/lib/mips/relocator.c +./grub-core/lib/pbkdf2.c +./grub-core/lib/powerpc/relocator.c +./grub-core/lib/reed_solomon.c +./grub-core/lib/relocator.c +./grub-core/lib/xzembed/xz_dec_bcj.c +./grub-core/lib/xzembed/xz_dec_lzma2.c +./grub-core/lib/xzembed/xz_dec_stream.c +./grub-core/loader/aout.c +./grub-core/loader/efi/appleloader.c +./grub-core/loader/efi/chainloader.c +./grub-core/loader/i386/bsd32.c +./grub-core/loader/i386/bsd64.c +./grub-core/loader/i386/bsd.c +./grub-core/loader/i386/bsd_pagetable.c +./grub-core/loader/i386/bsdXX.c +./grub-core/loader/i386/coreboot/chainloader.c +./grub-core/loader/i386/linux.c +./grub-core/loader/i386/multiboot_mbi.c +./grub-core/loader/i386/pc/chainloader.c +./grub-core/loader/i386/pc/freedos.c +./grub-core/loader/i386/pc/linux.c +./grub-core/loader/i386/pc/ntldr.c +./grub-core/loader/i386/xnu.c +./grub-core/loader/ia64/efi/linux.c +./grub-core/loader/macho32.c +./grub-core/loader/macho64.c +./grub-core/loader/macho.c +./grub-core/loader/machoXX.c +./grub-core/loader/mips/linux.c +./grub-core/loader/multiboot.c +./grub-core/loader/multiboot_elfxx.c +./grub-core/loader/multiboot_mbi2.c +./grub-core/loader/powerpc/ieee1275/linux.c +./grub-core/loader/sparc64/ieee1275/linux.c +./grub-core/loader/xnu.c +./grub-core/loader/xnu_resume.c +./grub-core/mmap/efi/mmap.c +./grub-core/mmap/i386/mmap.c +./grub-core/mmap/i386/pc/mmap.c +./grub-core/mmap/i386/uppermem.c +./grub-core/mmap/mips/uppermem.c +./grub-core/mmap/mmap.c +./grub-core/net/arp.c +./grub-core/net/bootp.c +./grub-core/net/drivers/efi/efinet.c +./grub-core/net/drivers/emu/emunet.c +./grub-core/net/drivers/i386/pc/pxe.c +./grub-core/net/drivers/ieee1275/ofnet.c +./grub-core/net/ethernet.c +./grub-core/net/ip.c +./grub-core/net/netbuff.c +./grub-core/net/net.c +./grub-core/net/tftp.c +./grub-core/net/udp.c +./grub-core/normal/auth.c +./grub-core/normal/autofs.c +./grub-core/normal/charset.c +./grub-core/normal/cmdline.c +./grub-core/normal/color.c +./grub-core/normal/completion.c +./grub-core/normal/context.c +./grub-core/normal/crypto.c +./grub-core/normal/datetime.c +./grub-core/normal/dyncmd.c +./grub-core/normal/main.c +./grub-core/normal/menu.c +./grub-core/normal/menu_entry.c +./grub-core/normal/menu_text.c +./grub-core/normal/misc.c +./grub-core/normal/term.c +./grub-core/partmap/acorn.c +./grub-core/partmap/amiga.c +./grub-core/partmap/apple.c +./grub-core/partmap/bsdlabel.c +./grub-core/partmap/dvh.c +./grub-core/partmap/gpt.c +./grub-core/partmap/msdos.c +./grub-core/partmap/sun.c +./grub-core/partmap/sunpc.c +./grub-core/parttool/msdospart.c +./grub-core/script/argv.c +./grub-core/script/execute.c +./grub-core/script/function.c +./grub-core/script/lexer.c +./grub-core/script/main.c +./grub-core/script/script.c +./grub-core/term/arc/console.c +./grub-core/term/at_keyboard.c +./grub-core/term/efi/console.c +./grub-core/term/gfxterm.c +./grub-core/term/i386/pc/console.c +./grub-core/term/i386/pc/vga_text.c +./grub-core/term/i386/vga_common.c +./grub-core/term/ieee1275/ofconsole.c +./grub-core/term/ns8250.c +./grub-core/term/serial.c +./grub-core/term/terminfo.c +./grub-core/term/tparm.c +./grub-core/term/usb_keyboard.c +./grub-core/tests/example_functional_test.c +./grub-core/tests/lib/functional_test.c +./grub-core/tests/lib/test.c +./grub-core/tests/test_blockarg.c +./grub-core/unidata.c +./grub-core/video/bitmap.c +./grub-core/video/bitmap_scale.c +./grub-core/video/bochs.c +./grub-core/video/cirrus.c +./grub-core/video/colors.c +./grub-core/video/efi_gop.c +./grub-core/video/efi_uga.c +./grub-core/video/emu/sdl.c +./grub-core/video/fb/fbblit.c +./grub-core/video/fb/fbfill.c +./grub-core/video/fb/fbutil.c +./grub-core/video/fb/video_fb.c +./grub-core/video/i386/pc/vbe.c +./grub-core/video/i386/pc/vga.c +./grub-core/video/ieee1275.c +./grub-core/video/readers/jpeg.c +./grub-core/video/readers/png.c +./grub-core/video/readers/tga.c +./grub-core/video/sis315_init.c +./grub-core/video/sis315pro.c +./grub-core/video/sm712.c +./grub-core/video/sm712_init.c +./grub-core/video/video.c +./tests/example_unit_test.c +./tests/lib/unit_test.c +./util/bin2h.c +./util/deviceiter.c +./util/devicemap.c +./util/getroot.c +./util/grub-editenv.c +./util/grub-fstest.c +./util/grub-macho2img.c +./util/grub-menulst2cfg.c +./util/grub-mkdevicemap.c +./util/grub-mkfont.c +./util/grub-mkimage.c +./util/grub-mkimagexx.c +./util/grub-mklayout.c +./util/grub-mkpasswd-pbkdf2.c +./util/grub-mkrelpath.c +./util/grub-pe2elf.c +./util/grub-probe.c +./util/grub-script-check.c +./util/grub-setup.c +./util/ieee1275/devicemap.c +./util/ieee1275/grub-ofpathname.c +./util/ieee1275/ofpath.c +./util/lvm.c +./util/misc.c +./util/raid.c +./util/resolve.c From ca5572a9ad872fd26712d0fbae1ab63adc64787b Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 10 Jul 2011 16:06:31 +0200 Subject: [PATCH 16/65] * util/grub-install.in: Recognize ESP mounted at /boot/EFI. --- ChangeLog | 4 ++++ util/grub-install.in | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 84167f226..0b386157c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-10 Vladimir Serbinenko + + * util/grub-install.in: Recognize ESP mounted at /boot/EFI. + 2011-07-10 Vladimir Serbinenko * po/POTFILES.in: Regenerate. diff --git a/util/grub-install.in b/util/grub-install.in index 711c9c7e2..1e9e1a2fd 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -335,6 +335,12 @@ if [ x"$platform" = xefi ]; then if test "x$install_device" != "x`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}"`"; then efidir="${bootdir}/efi" fi + elif test -d "${bootdir}/EFI"; then + install_device="`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}/EFI"`" + # Is it a mount point? + if test "x$install_device" != "x`"$grub_mkdevicemap" --device-map=/dev/stdout | "$grub_probe" --target=device --device-map=/dev/stdin "${bootdir}"`"; then + efidir="${bootdir}/EFI" + fi elif test -n "$rootdir" && test "x$rootdir" != "x/"; then # The EFI System Partition may have been given directly using # --root-directory. From bf66054fb3969fffed65b0fa6dea535ae368a0f8 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 23 Jul 2011 16:44:40 +0200 Subject: [PATCH 17/65] * grub-core/kern/mips/cache_flush.S [GRUB_MACHINE_MIPS_LOONGSON]: Flush all four ways. --- ChangeLog | 5 +++++ grub-core/kern/mips/cache_flush.S | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index e4ca1a6c3..55f097965 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-23 Vladimir Serbinenko + + * grub-core/kern/mips/cache_flush.S [GRUB_MACHINE_MIPS_LOONGSON]: Flush + all four ways. + 2011-07-21 Colin Watson Preferred resolution detection for VBE. diff --git a/grub-core/kern/mips/cache_flush.S b/grub-core/kern/mips/cache_flush.S index a352fd8ba..c03c337b5 100644 --- a/grub-core/kern/mips/cache_flush.S +++ b/grub-core/kern/mips/cache_flush.S @@ -9,6 +9,13 @@ subu $t1, $t3, $t2 1: cache 1, 0($t0) + /* All four ways. */ +#ifdef GRUB_MACHINE_MIPS_LOONGSON + cache 1, 1($t0) + cache 1, 2($t0) + cache 1, 3($t0) +#endif + addiu $t1, $t1, -0x4 bne $t1, $zero, 1b addiu $t0, $t0, 0x4 From a1167439107cc51d864452c7249c994f6b5b2ce1 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 23 Jul 2011 17:14:38 +0200 Subject: [PATCH 18/65] * include/grub/mips/kernel.h: Fix define conflict. --- ChangeLog | 4 ++++ include/grub/mips/kernel.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55f097965..15e7344f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-23 Vladimir Serbinenko + + * include/grub/mips/kernel.h: Fix define conflict. + 2011-07-23 Vladimir Serbinenko * grub-core/kern/mips/cache_flush.S [GRUB_MACHINE_MIPS_LOONGSON]: Flush diff --git a/include/grub/mips/kernel.h b/include/grub/mips/kernel.h index d82d0a97d..d351f17cb 100644 --- a/include/grub/mips/kernel.h +++ b/include/grub/mips/kernel.h @@ -16,8 +16,8 @@ * along with GRUB. If not, see . */ -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 +#ifndef GRUB_KERNEL_CPU_HEADER +#define GRUB_KERNEL_CPU_HEADER 1 #include From 6be1c01fd721bbea8353e0c0ad547a2c0056640c Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 23 Jul 2011 17:18:31 +0200 Subject: [PATCH 19/65] * include/grub/video.h: add missing EXPORT_FUND on grub_video_edid_checksum and grub_video_edid_preferred_mode. --- ChangeLog | 5 +++++ include/grub/video.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15e7344f2..71c33569f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-23 Vladimir Serbinenko + + * include/grub/video.h: add missing EXPORT_FUND on + grub_video_edid_checksum and grub_video_edid_preferred_mode. + 2011-07-23 Vladimir Serbinenko * include/grub/mips/kernel.h: Fix define conflict. diff --git a/include/grub/video.h b/include/grub/video.h index b2adff11d..e30589a3d 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -486,8 +486,8 @@ grub_err_t EXPORT_FUNC (grub_video_set_active_render_target) (struct grub_video_ grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); -grub_err_t grub_video_edid_checksum (struct grub_video_edid_info *edid_info); -grub_err_t grub_video_edid_preferred_mode (struct grub_video_edid_info *edid_info, +grub_err_t EXPORT_FUNC (grub_video_edid_checksum) (struct grub_video_edid_info *edid_info); +grub_err_t EXPORT_FUNC (grub_video_edid_preferred_mode) (struct grub_video_edid_info *edid_info, unsigned int *width, unsigned int *height); From 583168a216e477bfbf6039ddc331d5827833ec08 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 23 Jul 2011 18:18:14 +0200 Subject: [PATCH 20/65] * grub-core/disk/pata.c (grub_pata_readwrite): Add missing wait. --- ChangeLog | 4 ++++ grub-core/disk/pata.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 71c33569f..2eb0c0fcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-23 Vladimir Serbinenko + + * grub-core/disk/pata.c (grub_pata_readwrite): Add missing wait. + 2011-07-23 Vladimir Serbinenko * include/grub/video.h: add missing EXPORT_FUND on diff --git a/grub-core/disk/pata.c b/grub-core/disk/pata.c index ff6f77366..c54fe91ab 100644 --- a/grub-core/disk/pata.c +++ b/grub-core/disk/pata.c @@ -177,6 +177,10 @@ grub_pata_readwrite (struct grub_ata *disk, /* Start command. */ grub_pata_regset (dev, GRUB_ATA_REG_CMD, parms->taskfile.cmd); + /* Wait for !BSY. */ + if (grub_pata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) + return grub_errno; + /* Check status. */ grub_int8_t sts = grub_pata_regget (dev, GRUB_ATA_REG_STATUS); grub_dprintf ("pata", "status=0x%x\n", sts); From b70e4cb08d055181585c9b1d3e7a0366e90d17f5 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 25 Jul 2011 07:48:19 +0200 Subject: [PATCH 21/65] * grub-core/normal/menu.c (grub_menu_execute_entry): Fix NULL dereference. --- ChangeLog | 5 +++++ grub-core/normal/menu.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2eb0c0fcd..5069e5651 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-07-23 Vladimir Serbinenko + + * grub-core/normal/menu.c (grub_menu_execute_entry): Fix NULL + dereference. + 2011-07-23 Vladimir Serbinenko * grub-core/disk/pata.c (grub_pata_readwrite): Add missing wait. diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c index 5844cb2f0..2c127794b 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -232,7 +232,8 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) grub_env_export ("chosen"); grub_free (buf); } - for (ptr = def; *ptr; ptr++) + + for (ptr = def; ptr && *ptr; ptr++) { if (ptr[0] == '>' && ptr[1] == '>') { @@ -242,10 +243,12 @@ grub_menu_execute_entry(grub_menu_entry_t entry, int auto_boot) if (ptr[0] == '>') break; } - if (ptr[0] && ptr[1]) + + if (ptr && ptr[0] && ptr[1]) grub_env_set ("default", ptr + 1); else grub_env_unset ("default"); + grub_script_execute_sourcecode (entry->sourcecode, entry->argc, entry->args); if (errs_before != grub_err_printed_errors) From c77069f5ae4107323bf71c8c9d8505048acae740 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 25 Jul 2011 07:57:29 +0200 Subject: [PATCH 22/65] * util/grub-mkrescue.in: Add missing quotes. --- ChangeLog | 6 +++++- util/grub-mkrescue.in | 14 +++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5069e5651..570de50e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2011-07-23 Vladimir Serbinenko +2011-07-25 Vladimir Serbinenko + + * util/grub-mkrescue.in: Add missing quotes. + +2011-07-25 Vladimir Serbinenko * grub-core/normal/menu.c (grub_menu_execute_entry): Fix NULL dereference. diff --git a/util/grub-mkrescue.in b/util/grub-mkrescue.in index f054c43a9..4c96dd42b 100644 --- a/util/grub-mkrescue.in +++ b/util/grub-mkrescue.in @@ -31,15 +31,15 @@ pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst self=`basename $0` -multiboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-multiboot -coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-coreboot -qemu_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-qemu -pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc -efi32_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi -efi64_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi +multiboot_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-multiboot" +coreboot_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-coreboot" +qemu_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-qemu" +pc_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-pc" +efi32_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/i386-efi" +efi64_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi" rom_directory= override_dir= -grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`" xorriso=xorriso From 922275976579ecd9ebaa88eba3fb5e8933e9c93f Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 25 Jul 2011 08:06:20 +0200 Subject: [PATCH 23/65] * util/grub-install.in: Don't use uhci outside of x86. --- ChangeLog | 4 ++++ util/grub-install.in | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 570de50e1..32dfada58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-07-25 Vladimir Serbinenko + + * util/grub-install.in: Don't use uhci outside of x86. + 2011-07-25 Vladimir Serbinenko * util/grub-mkrescue.in: Add missing quotes. diff --git a/util/grub-install.in b/util/grub-install.in index 1e9e1a2fd..3d2420b91 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -504,7 +504,11 @@ if [ "x$disk_module" = xata ]; then fi if [ "x$disk_module" = xnative ]; then - disk_module="pata ahci ohci uhci usbms" + disk_module="pata ahci ohci" + if [ "x$target_cpu" = "xi386" ] || [ "x$target_cpu" = "xx86_64" ]; then + disk_module="$disk_module uhci" + fi + disk_module="$disk_module usbms" fi # The order in this list is critical. Be careful when modifying it. From 6795300e7f230ac552c984ef051f0ae79f318bcf Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 25 Jul 2011 08:14:34 +0200 Subject: [PATCH 24/65] Support ATA disks with 4K sectors. * include/grub/ata.h (grub_ata): New member log_sector_size. * grub-core/disk/ata.c (grub_ata_dumpinfo): Show sector size. (grub_ata_identify): Read sector size. (grub_ata_readwrite): Use log_sector_size rather than hardcoded value. --- ChangeLog | 9 +++++++++ grub-core/disk/ata.c | 23 ++++++++++++++++++++--- include/grub/ata.h | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32dfada58..5c4e20c28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-07-25 Vladimir Serbinenko + + Support ATA disks with non-4K sectors. + + * include/grub/ata.h (grub_ata): New member log_sector_size. + * grub-core/disk/ata.c (grub_ata_dumpinfo): Show sector size. + (grub_ata_identify): Read sector size. + (grub_ata_readwrite): Use log_sector_size rather than hardcoded value. + 2011-07-25 Vladimir Serbinenko * util/grub-install.in: Don't use uhci outside of x86. diff --git a/grub-core/disk/ata.c b/grub-core/disk/ata.c index 8add7f4de..330635f57 100644 --- a/grub-core/disk/ata.c +++ b/grub-core/disk/ata.c @@ -57,6 +57,7 @@ grub_ata_dumpinfo (struct grub_ata *dev, char *info) { grub_dprintf ("ata", "Addressing: %d\n", dev->addr); grub_dprintf ("ata", "Sectors: %lld\n", (unsigned long long) dev->size); + grub_dprintf ("ata", "Sector size: %u\n", 1U << dev->log_sector_size); } } @@ -170,6 +171,21 @@ grub_ata_identify (struct grub_ata *dev) else dev->size = grub_le_to_cpu64(*((grub_uint64_t *) &info16[100])); + if (info16[106] & (1 << 12)) + { + grub_uint32_t secsize; + secsize = grub_le_to_cpu32 (*((grub_uint32_t *) &info16[117])); + if (secsize & (secsize - 1) || !secsize + || secsize > 1048576) + secsize = 256; + for (dev->log_sector_size = 0; + (1U << dev->log_sector_size) < secsize; + dev->log_sector_size++); + dev->log_sector_size++; + } + else + dev->log_sector_size = 9; + /* Read CHS information. */ dev->cylinders = info16[1]; dev->heads = info16[3]; @@ -314,7 +330,7 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, grub_ata_setaddress (ata, &parms, sector, batch, addressing); parms.taskfile.cmd = (! rw ? cmd : cmd_write); parms.buffer = buf; - parms.size = batch * GRUB_DISK_SECTOR_SIZE; + parms.size = batch << ata->log_sector_size; parms.write = rw; if (ata->dma) parms.dma = 1; @@ -322,9 +338,9 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, err = ata->dev->readwrite (ata, &parms, 0); if (err) return err; - if (parms.size != batch * GRUB_DISK_SECTOR_SIZE) + if (parms.size != batch << ata->log_sector_size) return grub_error (GRUB_ERR_READ_ERROR, "incomplete read"); - buf += GRUB_DISK_SECTOR_SIZE * batch; + buf += batch << ata->log_sector_size; sector += batch; nsectors += batch; } @@ -433,6 +449,7 @@ grub_ata_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); disk->total_sectors = ata->size; + disk->log_sector_size = ata->log_sector_size; disk->id = grub_make_scsi_id (id, bus, 0); diff --git a/include/grub/ata.h b/include/grub/ata.h index 6938b6a42..1a19f27aa 100644 --- a/include/grub/ata.h +++ b/include/grub/ata.h @@ -170,6 +170,7 @@ struct grub_ata /* Sector count. */ grub_uint64_t size; + grub_uint32_t log_sector_size; /* CHS maximums. */ grub_uint16_t cylinders; From 41aa28ea2a7c90c14016a122ae604c95aa4a8697 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 25 Jul 2011 08:19:30 +0200 Subject: [PATCH 25/65] New script grub-mkstandalone. * Makefile.util.def (grub-mkstandalone): New script. * docs/man/grub-mkstandalone.h2m: New file. * util/grub-mkstandalone.in: Likewise. --- ChangeLog | 10 +- Makefile.util.def | 6 ++ docs/man/grub-mkstandalone.h2m | 4 + util/grub-mkstandalone.in | 189 +++++++++++++++++++++++++++++++++ 4 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 docs/man/grub-mkstandalone.h2m create mode 100644 util/grub-mkstandalone.in diff --git a/ChangeLog b/ChangeLog index 5c4e20c28..2593d598b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,14 @@ 2011-07-25 Vladimir Serbinenko - Support ATA disks with non-4K sectors. + New script grub-mkstandalone. + + * Makefile.util.def (grub-mkstandalone): New script. + * docs/man/grub-mkstandalone.h2m: New file. + * util/grub-mkstandalone.in: Likewise. + +2011-07-25 Vladimir Serbinenko + + Support ATA disks with 4K sectors. * include/grub/ata.h (grub_ata): New member log_sector_size. * grub-core/disk/ata.c (grub_ata_dumpinfo): Show sector size. diff --git a/Makefile.util.def b/Makefile.util.def index c87020493..d86cb9761 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -412,6 +412,12 @@ script = { enable = powerpc_ieee1275; }; +script = { + mansection = 1; + name = grub-mkstandalone; + common = util/grub-mkstandalone.in; +}; + script = { mansection = 8; installdir = sbin; diff --git a/docs/man/grub-mkstandalone.h2m b/docs/man/grub-mkstandalone.h2m new file mode 100644 index 000000000..c77313978 --- /dev/null +++ b/docs/man/grub-mkstandalone.h2m @@ -0,0 +1,4 @@ +[NAME] +grub-mkstandalone \- make a memdisk-based GRUB image +[SEE ALSO] +.BR grub-mkimage (1) diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in new file mode 100644 index 000000000..aaff99051 --- /dev/null +++ b/util/grub-mkstandalone.in @@ -0,0 +1,189 @@ +#! /bin/sh +set -e + +# Make GRUB rescue image +# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# 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 . + +# Initialize some variables. +transform="@program_transform_name@" + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +PACKAGE_NAME=@PACKAGE_NAME@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_VERSION=@PACKAGE_VERSION@ +pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst" + +self=`basename $0` + +source_dirrectory= +compression=auto +format= +grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +source= + +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +argument () { + opt=$1 + shift + + if test $# -eq 0; then + echo "$0: option requires an argument -- '$opt'" 1>&2 + exit 1 + fi + echo $1 +} + +# Check the arguments. +while test $# -gt 0 +do + option=$1 + shift + + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" + exit 0 ;; + + --modules) + modules=`argument $option "$@"`; shift ;; + --modules=*) + modules=`echo "$option" | sed 's/--modules=//'` ;; + + -o | --output) + output_image=`argument $option "$@"`; shift ;; + --output=*) + output_image=`echo "$option" | sed 's/--output=//'` ;; + + --directory | -d) + source_directory=`argument $option "$@"`; shift ;; + --directory=*) + source_directory=`echo "$option" | sed 's/--rom-directory=//'` ;; + + --grub-mkimage) + grub_mkimage=`argument $option "$@"`; shift ;; + --grub-mkimage=*) + grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; + + --compression | -C) + compression=`argument $option "$@"`; shift ;; + --compression=*) + compression=`echo "${option}/" | sed 's/--xorriso=//'` ;; + + --format | -O) + format=`argument $option "$@"`; shift ;; + --format=*) + format=`echo "${option}/" | sed 's/--xorriso=//'` ;; + + *) + source="${source} ${option} $@"; break ;; + esac +done + +if [ "x${output_image}" = x ] ; then + echo "output file must be given" >&2 + usage + exit 1 +fi + +if [ "x${format}" = x ] ; then + echo "format must be given" >&2 + usage + exit 1 +fi + +if [ "x$source_directory" = x ] ; then + cpu="`echo $format | awk -F - '{ print $1; }'`" + platform="`echo $format | awk -F - '{ print $2; }'`" + case "$platform" in + yeeloong | fuloong) + platform=loongson ;; + esac + case "$cpu-$platform" in + mips-loongson) + cpu=mipsel ;; + esac + source_directory="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/$cpu-$platform" +fi + +set $grub_mkimage dummy +if test -f "$1"; then + : +else + echo "$1: Not found." 1>&2 + exit 1 +fi + +memdisk_dir="`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1 +mkdir -p "${memdisk_dir}"/boot/grub + +for file in "${source_directory}/"*.mod "${source_directory}/"efiemu32.o "${source_directory}/"efiemu64.o; do + if test -f "$file"; then + cp -f "$file" "${memdisk_dir}"/boot/grub/ + fi +done +for file in ${pkglib_DATA}; do + if test -f "${source_directory}/${file}"; then + cp -f "${source_directory}/${file}" "${memdisk_dir}"/boot/grub/ + fi +done + +mkdir -p "${memdisk_dir}"/boot/grub/locale +for file in "${source_directory}"/po/*.mo; do + if test -f "$file"; then + cp -f "$file" "${memdisk_dir}"/boot/grub/locale/ + fi +done + +for file in $source; do + cp -f "$file" "${memdisk_dir}"/"$file"; +done + +memdisk_img=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 + +(cd "${memdisk_dir}"; tar -cf - * $source) > "${memdisk_img}" +rm -rf "${memdisk_dir}" +$grub_mkimage -O "${format}" -C "$compression" -d "${source_directory}" -m "${memdisk_img}" -o "$output_image" --prefix='(memdisk)/boot/grub' memdisk tar $modules +rm -rf "${memdisk_img}" + +exit 0 From 303b6246a3a44d51cf9263b754efbfe0e5f4272a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 26 Jul 2011 11:59:47 +0100 Subject: [PATCH 26/65] * util/grub-install.in: Don't source grub-mkconfig_lib until after processing arguments (otherwise help2man fails when GRUB has not yet been installed). --- ChangeLog | 6 ++++++ util/grub-install.in | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2593d598b..fa33902ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-26 Colin Watson + + * util/grub-install.in: Don't source grub-mkconfig_lib until after + processing arguments (otherwise help2man fails when GRUB has not yet + been installed). + 2011-07-25 Vladimir Serbinenko New script grub-mkstandalone. diff --git a/util/grub-install.in b/util/grub-install.in index 3d2420b91..f9e1510d1 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -59,8 +59,6 @@ update_nvram=yes removable=no efi_quiet= -. ${libdir}/@PACKAGE@/grub-mkconfig_lib - # Get GRUB_DISTRIBUTOR. if test -f "${sysconfdir}/default/grub" ; then . "${sysconfdir}/default/grub" @@ -265,6 +263,8 @@ do esac done +. ${libdir}/@PACKAGE@/grub-mkconfig_lib + if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \ || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then echo "install_device not specified." 1>&2 From 20168fcafeed3d87f437914a09e35a926c009faa Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 26 Jul 2011 16:19:47 +0100 Subject: [PATCH 27/65] * configure.ac: The Loongson port requires grub-mkfont due to its use of -DUSE_ASCII_FAILBACK. Raise an error if it is not going to be built. --- ChangeLog | 6 ++++++ configure.ac | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index fa33902ab..19e034dc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-26 Colin Watson + + * configure.ac: The Loongson port requires grub-mkfont due to its + use of -DUSE_ASCII_FAILBACK. Raise an error if it is not going to + be built. + 2011-07-26 Colin Watson * util/grub-install.in: Don't source grub-mkconfig_lib until after diff --git a/configure.ac b/configure.ac index f674a90aa..e6d726548 100644 --- a/configure.ac +++ b/configure.ac @@ -866,6 +866,9 @@ enable_grub_mkfont=yes else enable_grub_mkfont=no fi +if test x"$enable_grub_mkfont" = xno && test "x$platform" = xloongson; then + AC_MSG_ERROR([loongson port needs grub-mkfont]) +fi AC_SUBST([enable_grub_mkfont]) AC_SUBST([freetype_cflags]) AC_SUBST([freetype_libs]) From 66816d85565bc362b07ce0c623c3379d6b21119e Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Wed, 3 Aug 2011 13:30:46 +0200 Subject: [PATCH 28/65] 2011-08-03 Robert Millan * include/grub/zfs/zap_leaf.h (typedef union zap_leaf_chunk): Mark la_array as packed. Reported by: Zachary Bedell --- ChangeLog | 6 ++++++ include/grub/zfs/zap_leaf.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 19e034dc0..184b0d763 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-08-03 Robert Millan + + * include/grub/zfs/zap_leaf.h (typedef union zap_leaf_chunk): Mark + la_array as packed. + Reported by: Zachary Bedell + 2011-07-26 Colin Watson * configure.ac: The Loongson port requires grub-mkfont due to its diff --git a/include/grub/zfs/zap_leaf.h b/include/grub/zfs/zap_leaf.h index 1ef654054..5adfdc290 100644 --- a/include/grub/zfs/zap_leaf.h +++ b/include/grub/zfs/zap_leaf.h @@ -90,7 +90,7 @@ typedef union zap_leaf_chunk { { grub_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES]; grub_uint64_t la_array64; - }; + } __attribute__ ((packed)); grub_uint16_t la_next; /* next blk or CHAIN_END */ } l_array; struct zap_leaf_free { From 6dc212f953b2ff19245a125a938e35b8b0f929ba Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Wed, 10 Aug 2011 22:24:02 +0200 Subject: [PATCH 29/65] 2011-08-10 Robert Millan Detect LSI MegaRAID SAS (`mfi') devices on GNU/kFreeBSD. * util/deviceiter.c [__FreeBSD_kernel__] (get_mfi_disk_name): New function. [__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for mfi (/dev/mfid[0-9]+) devices using get_mfi_disk_name(). --- ChangeLog | 9 +++++++++ util/deviceiter.c | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index 184b0d763..039621768 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-08-10 Robert Millan + + Detect LSI MegaRAID SAS (`mfi') devices on GNU/kFreeBSD. + + * util/deviceiter.c [__FreeBSD_kernel__] (get_mfi_disk_name): New + function. + [__FreeBSD_kernel__] (grub_util_iterate_devices): Scan for mfi + (/dev/mfid[0-9]+) devices using get_mfi_disk_name(). + 2011-08-03 Robert Millan * include/grub/zfs/zap_leaf.h (typedef union zap_leaf_chunk): Mark diff --git a/util/deviceiter.c b/util/deviceiter.c index 2a8acec0e..208dcfdde 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -298,6 +298,12 @@ get_ataraid_disk_name (char *name, int unit) { sprintf (name, "/dev/ar%d", unit); } + +static void +get_mfi_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/mfid%d", unit); +} #endif #ifdef __linux__ @@ -661,6 +667,19 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), goto out; } } + + /* LSI MegaRAID SAS. */ + for (i = 0; i < 32; i++) + { + char name[20]; + + get_mfi_disk_name (name, i); + if (check_device_readable_unique (name)) + { + if (hook (name, 0)) + goto out; + } + } #endif #ifdef __linux__ From 5f60ccac6f0c1a4236a964bed630c95ab67331cb Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 15 Aug 2011 23:21:29 +0100 Subject: [PATCH 30/65] * util/grub-probe.c: Remove duplicate #include. --- ChangeLog | 4 ++++ util/grub-probe.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 039621768..b4ec6f677 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-15 Colin Watson + + * util/grub-probe.c: Remove duplicate #include. + 2011-08-10 Robert Millan Detect LSI MegaRAID SAS (`mfi') devices on GNU/kFreeBSD. diff --git a/util/grub-probe.c b/util/grub-probe.c index 7c0a75123..3f519bcb4 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include From 828bc390d82e119133877f67ddd1eb3795fb8afc Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 15 Aug 2011 23:30:11 +0100 Subject: [PATCH 31/65] * util/grub-probe.c (probe): Canonicalise the path argument, fixing use of "/path/.." as in grub-install for EFI as well as handling symlinks correctly. Fixes Debian bug #637768. --- ChangeLog | 8 ++++++++ util/grub-probe.c | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b4ec6f677..f3c2cf690 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-08-15 Mario Limonciello +2011-08-15 Colin Watson + + * util/grub-probe.c (probe): Canonicalise the path argument, fixing + use of "/path/.." as in grub-install for EFI as well as handling + symlinks correctly. + Fixes Debian bug #637768. + 2011-08-15 Colin Watson * util/grub-probe.c: Remove duplicate #include. diff --git a/util/grub-probe.c b/util/grub-probe.c index 3f519bcb4..ae58c89f3 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -180,7 +180,10 @@ probe (const char *path, char *device_name) #endif } else - device_name = grub_guess_root_device (path); + { + grub_path = canonicalize_file_name (path); + device_name = grub_guess_root_device (grub_path); + } if (! device_name) grub_util_error ("cannot find a device for %s (is /dev mounted?)", path); From b1257f653367e8d21b625276f53f086d68fab0b3 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 16 Aug 2011 16:11:10 +0200 Subject: [PATCH 32/65] Don't accept text modes on EFI when booting Linux. * grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. (grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. --- ChangeLog | 7 +++++++ grub-core/loader/i386/linux.c | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3c2cf690..fc1ea8713 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-08-16 Vladimir Serbinenko + + Don't accept text modes on EFI when booting Linux. + + * grub-core/loader/i386/linux.c (ACCEPTS_PURE_TEXT): New define. + (grub_linux_boot) [!ACCEPTS_PURE_TEXT]: Restrict to graphics modes. + 2011-08-15 Mario Limonciello 2011-08-15 Colin Watson diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 9e3d482ab..5356d7ace 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -45,15 +45,18 @@ GRUB_MOD_LICENSE ("GPLv3+"); #include #define HAS_VGA_TEXT 0 #define DEFAULT_VIDEO_MODE "auto" +#define ACCEPTS_PURE_TEXT 0 #elif defined (GRUB_MACHINE_IEEE1275) #include #define HAS_VGA_TEXT 0 #define DEFAULT_VIDEO_MODE "text" +#define ACCEPTS_PURE_TEXT 1 #else #include #include #define HAS_VGA_TEXT 1 #define DEFAULT_VIDEO_MODE "text" +#define ACCEPTS_PURE_TEXT 1 #endif #define GRUB_LINUX_CL_OFFSET 0x1000 @@ -483,12 +486,22 @@ grub_linux_boot (void) tmp = grub_xasprintf ("%s;" DEFAULT_VIDEO_MODE, modevar); if (! tmp) return grub_errno; +#if ACCEPTS_PURE_TEXT err = grub_video_set_mode (tmp, 0, 0); +#else + err = grub_video_set_mode (tmp, GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); +#endif grub_free (tmp); } else - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); - + { +#if ACCEPTS_PURE_TEXT + err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0, 0); +#else + err = grub_video_set_mode (DEFAULT_VIDEO_MODE, + GRUB_VIDEO_MODE_TYPE_PURE_TEXT, 0); +#endif + } if (err) { grub_print_error (); From 5c144cc8b2cd13b88a0cd214cfa8ee8207aad1c0 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 16 Aug 2011 16:19:06 +0200 Subject: [PATCH 33/65] * util/grub-setup.c (main): Add missing gcry initialisation. --- ChangeLog | 4 ++++ util/grub-setup.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index fc1ea8713..7acaf320c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-16 Vladimir Serbinenko + + * util/grub-setup.c (main): Add missing gcry initialisation. + 2011-08-16 Vladimir Serbinenko Don't accept text modes on EFI when booting Linux. diff --git a/util/grub-setup.c b/util/grub-setup.c index 8482e11c9..2505c03a4 100644 --- a/util/grub-setup.c +++ b/util/grub-setup.c @@ -893,6 +893,7 @@ main (int argc, char *argv[]) /* Initialize all modules. */ grub_init_all (); + grub_gcry_init_all (); grub_lvm_fini (); grub_mdraid09_fini (); From 43526629e58ac5d5eec0c7b6454bb96d750d197b Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 16 Aug 2011 23:10:38 +0200 Subject: [PATCH 34/65] * grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino. All users updated. (grub_jfs_lookup_symlink): Use correct starting inode. --- ChangeLog | 6 ++++++ grub-core/fs/jfs.c | 15 ++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7acaf320c..c414d79e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-08-16 Vladimir Serbinenko + + * grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino. + All users updated. + (grub_jfs_lookup_symlink): Use correct starting inode. + 2011-08-16 Vladimir Serbinenko * util/grub-setup.c (main): Add missing gcry initialisation. diff --git a/grub-core/fs/jfs.c b/grub-core/fs/jfs.c index 36ec5fd25..ebc2c688a 100644 --- a/grub-core/fs/jfs.c +++ b/grub-core/fs/jfs.c @@ -614,7 +614,8 @@ grub_jfs_read_file (struct grub_jfs_data *data, /* Find the file with the pathname PATH on the filesystem described by DATA. */ static grub_err_t -grub_jfs_find_file (struct grub_jfs_data *data, const char *path) +grub_jfs_find_file (struct grub_jfs_data *data, const char *path, + grub_uint32_t start_ino) { char fpath[grub_strlen (path)]; char *name = fpath; @@ -623,7 +624,7 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) grub_strncpy (fpath, path, grub_strlen (path) + 1); - if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode)) + if (grub_jfs_read_inode (data, start_ino, &data->currinode)) return grub_errno; /* Skip the first slashes. */ @@ -724,11 +725,7 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, grub_uint32_t ino) if (symlink[0] == '/') ino = 2; - /* Now load in the old inode. */ - if (grub_jfs_read_inode (data, ino, &data->currinode)) - return grub_errno; - - grub_jfs_find_file (data, symlink); + grub_jfs_find_file (data, symlink, ino); if (grub_errno) grub_error (grub_errno, "cannot follow symlink `%s'", symlink); @@ -750,7 +747,7 @@ grub_jfs_dir (grub_device_t device, const char *path, if (!data) goto fail; - if (grub_jfs_find_file (data, path)) + if (grub_jfs_find_file (data, path, GRUB_JFS_AGGR_INODE)) goto fail; diro = grub_jfs_opendir (data, &data->currinode); @@ -801,7 +798,7 @@ grub_jfs_open (struct grub_file *file, const char *name) if (!data) goto fail; - grub_jfs_find_file (data, name); + grub_jfs_find_file (data, name, GRUB_JFS_AGGR_INODE); if (grub_errno) goto fail; From 2bba8cfd55fb65fe92d47c9b14d6953940128a5e Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 16 Aug 2011 23:12:20 +0200 Subject: [PATCH 35/65] * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_iterate): Skip with non-zero pull. --- ChangeLog | 5 +++++ grub-core/kern/emu/hostdisk.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index c414d79e7..946dcbd80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-16 Vladimir Serbinenko + + * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_iterate): Skip with + non-zero pull. + 2011-08-16 Vladimir Serbinenko * grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino. diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index d1f76b28c..000ef2f79 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -217,6 +217,9 @@ grub_util_biosdisk_iterate (int (*hook) (const char *name), { unsigned i; + if (pull != GRUB_DISK_PULL_NONE) + return 0; + for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) if (map[i].drive && hook (map[i].drive)) return 1; From 055e2b8b4f31be61160384d202c2f90422a723c2 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 19 Aug 2011 17:24:18 +0200 Subject: [PATCH 36/65] * configure.ac: Fixed typo in --enable-cache-stats description. --- ChangeLog.cacheinfo | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.cacheinfo b/ChangeLog.cacheinfo index a26271cca..7e24e1083 100644 --- a/ChangeLog.cacheinfo +++ b/ChangeLog.cacheinfo @@ -1,3 +1,7 @@ +2011-08-19 Szymon Janc + + * configure.ac: Fixed typo in --enable-cache-stats description. + 2010-10-05 Szymon Janc Make enable of disk cache statistics code configurable. diff --git a/configure.ac b/configure.ac index 5f7846d41..224c9c9de 100644 --- a/configure.ac +++ b/configure.ac @@ -719,7 +719,7 @@ AC_ARG_ENABLE([mm-debug], AC_ARG_ENABLE([cache-stats], AS_HELP_STRING([--enable-cache-stats], - [enable disk cache statistics collection])]) + [enable disk cache statistics collection])) if test x$enable_cache_stats = xyes; then DISK_CACHE_STATS=1 From fb739ccd7923fb3d11d825d744faaf1cdf884d73 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 19 Aug 2011 20:06:42 +0200 Subject: [PATCH 37/65] * Makefile.am (AUTOMAKE_OPTIONS): = Added -Wno-portability flag. * grub-core/Makefile.am: Likewise. --- ChangeLog | 5 +++++ Makefile.am | 2 +- grub-core/Makefile.am | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 946dcbd80..17e2643b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-19 Szymon Janc + + * Makefile.am (AUTOMAKE_OPTIONS): = Added -Wno-portability flag. + * grub-core/Makefile.am: Likewise. + 2011-08-16 Vladimir Serbinenko * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_iterate): Skip with diff --git a/Makefile.am b/Makefile.am index 9301c91a5..c5f486e0d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS = subdir-objects +AUTOMAKE_OPTIONS = subdir-objects -Wno-portability DEPDIR = .deps-util SUBDIRS = grub-core/gnulib . grub-core po docs util/bash-completion.d diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 3a085eb2c..f30014635 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -1,4 +1,4 @@ -AUTOMAKE_OPTIONS = subdir-objects +AUTOMAKE_OPTIONS = subdir-objects -Wno-portability DEPDIR=.deps-core From 14a2562cf7e8bb2d6f8d13b297d8e3b07308d945 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 22:46:11 +0200 Subject: [PATCH 38/65] Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E. * grub-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong into fwstart_fuloong2f. Use boot/mips/loongson/fuloong2f.S. * grub-core/boot/mips/loongson/fuloong.S: Rename to ... * grub-core/boot/mips/loongson/fuloong2f.S: ... this. (FULOONG): Rename to ... (FULOONG2F): ... this. All users updated. * grub-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to (machtype_fuloong2f_str): ... this. (machtype_fuloong2e_str): New string. Check for machtype_fuloong2e_str. * grub-core/loader/mips/linux.c (loongson_machtypes) [GRUB_MACHINE_MIPS_LOONGSON]: Add GRUB_ARCH_MACHINE_FULOONG2E. * grub-core/term/serial.c (loongson_defserial) [GRUB_MACHINE_MIPS_LOONGSON]: New array. (grub_serial_register) [GRUB_MACHINE_MIPS_LOONGSON]: Use loongson_defserial. * include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_FULOONG): Rename to ... (GRUB_ARCH_MACHINE_FULOONG2F): ... this. (GRUB_ARCH_MACHINE_FULOONG2E): New const. * util/grub-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH to IMAGE_FULOONG2F_FLASH. All users updated. (image_targets): Rename images. * util/grub-mkstandalone.in: Accept fuloong2f and fuloong2e. --- ChangeLog | 29 +++++++++++++++++++ grub-core/Makefile.core.def | 4 +-- .../mips/loongson/{fuloong.S => fuloong2f.S} | 2 +- grub-core/boot/mips/loongson/fwstart.S | 26 ++++++++--------- grub-core/boot/mips/startup_raw.S | 14 +++++---- grub-core/bus/cs5536.c | 2 +- grub-core/kern/mips/loongson/init.c | 4 ++- grub-core/kern/mips/startup.S | 2 +- grub-core/loader/mips/linux.c | 3 +- grub-core/term/serial.c | 13 +++++++-- include/grub/mips/loongson/kernel.h | 3 +- util/grub-mkimage.c | 17 ++++++----- util/grub-mkstandalone.in | 2 +- 13 files changed, 82 insertions(+), 39 deletions(-) rename grub-core/boot/mips/loongson/{fuloong.S => fuloong2f.S} (51%) diff --git a/ChangeLog b/ChangeLog index 21975a2d3..fdc89b5a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2011-08-19 Vladimir Serbinenko + + Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E. + + * grub-core/Makefile.core.def (fwstart_fuloong): Rename fwstart_fuloong + into fwstart_fuloong2f. Use boot/mips/loongson/fuloong2f.S. + * grub-core/boot/mips/loongson/fuloong.S: Rename to ... + * grub-core/boot/mips/loongson/fuloong2f.S: ... this. + (FULOONG): Rename to ... + (FULOONG2F): ... this. All users updated. + * grub-core/boot/mips/startup_raw.S (machtype_fuloong_str): Rename to + (machtype_fuloong2f_str): ... this. + (machtype_fuloong2e_str): New string. + Check for machtype_fuloong2e_str. + * grub-core/loader/mips/linux.c (loongson_machtypes) + [GRUB_MACHINE_MIPS_LOONGSON]: Add GRUB_ARCH_MACHINE_FULOONG2E. + * grub-core/term/serial.c (loongson_defserial) + [GRUB_MACHINE_MIPS_LOONGSON]: New array. + (grub_serial_register) [GRUB_MACHINE_MIPS_LOONGSON]: Use + loongson_defserial. + * include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_FULOONG): + Rename to ... + (GRUB_ARCH_MACHINE_FULOONG2F): ... this. + (GRUB_ARCH_MACHINE_FULOONG2E): New const. + * util/grub-mkimage.c (image_target_desc): Rename IMAGE_FULOONG_FLASH + to IMAGE_FULOONG2F_FLASH. All users updated. + (image_targets): Rename images. + * util/grub-mkstandalone.in: Accept fuloong2f and fuloong2e. + 2011-08-19 Szymon Janc Make enable of disk cache statistics code configurable. diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index de57d2f0c..f129e98db 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -363,8 +363,8 @@ image = { }; image = { - name = fwstart_fuloong; - mips_loongson = boot/mips/loongson/fuloong.S; + name = fwstart_fuloong2f; + mips_loongson = boot/mips/loongson/fuloong2f.S; objcopyflags = '-O binary'; ldflags = '-static-libgcc -lgcc -Wl,-N,-S,-Ttext,0xbfc00000,-Bstatic'; enable = mips_loongson; diff --git a/grub-core/boot/mips/loongson/fuloong.S b/grub-core/boot/mips/loongson/fuloong2f.S similarity index 51% rename from grub-core/boot/mips/loongson/fuloong.S rename to grub-core/boot/mips/loongson/fuloong2f.S index 5df0d54c1..a88c81efe 100644 --- a/grub-core/boot/mips/loongson/fuloong.S +++ b/grub-core/boot/mips/loongson/fuloong2f.S @@ -1,2 +1,2 @@ -#define FULOONG 1 +#define FULOONG2F 1 #include "fwstart.S" diff --git a/grub-core/boot/mips/loongson/fwstart.S b/grub-core/boot/mips/loongson/fwstart.S index 38e87ad72..7ed5d30ae 100644 --- a/grub-core/boot/mips/loongson/fwstart.S +++ b/grub-core/boot/mips/loongson/fwstart.S @@ -26,7 +26,7 @@ #include #include -#ifdef FULOONG +#ifdef FULOONG2F #define GRUB_MACHINE_SERIAL_PORT GRUB_MACHINE_SERIAL_PORT2 #define GRUB_MACHINE_SERIAL_DIVISOR_115200 GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200 #else @@ -43,10 +43,10 @@ start: _start: __start: - /* Put serial init as soon as possible. But on Fuloong serial is past - Geode, so on Fuloong we need Geode first. + /* Put serial init as soon as possible. But on Fuloong2f serial is past + Geode, so on Fuloong2f we need Geode first. */ -#ifndef FULOONG +#ifndef FULOONG2F bal serial_hw_init nop #endif @@ -72,7 +72,7 @@ retry_cs5536: bnel $t2, $t3, 1b sll $t4, $t4, 1 -#ifndef FULOONG +#ifndef FULOONG2F bal message addiu $a0, $a0, %lo(cs5536_found) bal printhex @@ -95,7 +95,7 @@ retry_cs5536: bal gpio_init nop -#ifdef FULOONG +#ifdef FULOONG2F bal serial_hw_init nop #endif @@ -130,7 +130,7 @@ retry_cs5536: sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL3) ($t0) sb $t1, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_CS5536_LBAR_SMBUS + GRUB_CS5536_SMB_REG_CTRL2) ($t0) - /* Yeeloong and Fuloong have only one memory slot. */ + /* Yeeloong and Fuloong2f have only one memory slot. */ /* Output first byte on serial for debugging. */ ori $a1, $zero, GRUB_SMB_RAM_START_ADDR bal read_spd @@ -252,7 +252,7 @@ gpio_init: /* In: none. Out: none. Clobbered: $t0, $t1, $t2, $a0, $a1, $a2. */ serial_hw_init: move $t2, $ra -#ifdef FULOONG +#ifdef FULOONG2F lui $a0, %hi(GRUB_CS5536_MSR_DIVIL_LEG_IO) addiu $a0, $a0, %lo(GRUB_CS5536_MSR_DIVIL_LEG_IO) lui $a1, %hi (GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 \ @@ -471,7 +471,7 @@ regdump: .quad 0x0100020200010101 /* 4 */ .quad 0x0a04030603050203 /* 6 */ .quad 0x0f0e040000010a0b /* 7 */ -#ifdef FULOONG +#ifdef FULOONG2F .quad 0x0000000100000001 /* 8 */ #else .quad 0x0000010200000102 /* 8 */ @@ -482,7 +482,7 @@ regdump: .quad 0x002a3c0615000000 /* c */ .quad 0x002a002a002a002a /* d */ .quad 0x002a002a002a002a /* e */ -#ifdef FULOONG +#ifdef FULOONG2F .quad 0x00b40020005b0004 /* f */ #else .quad 0x00b40020006d0004 /* f */ @@ -503,7 +503,7 @@ regdump: /* Dump of GPIO connections. FIXME: Remove useless and macroify. */ gpio_dump: -#ifdef FULOONG +#ifdef FULOONG2F .long 0xffff0000, 0x2eefd110, 0xffff0000, 0xffff0000 .long 0x2eefd110, 0xffff0000, 0x1000efff, 0xefff1000 .long 0x3df3c20c, 0xffff0000, 0xffff0000, 0xffff0000 @@ -740,8 +740,8 @@ continue: lui $t0, %hi(cached_continue - 0x20000000) addiu $t0, $t0, %lo(cached_continue - 0x20000000) jr $t0 -#ifdef FULOONG - addiu $a2, $zero, -(1 + GRUB_ARCH_MACHINE_FULOONG) +#ifdef FULOONG2F + addiu $a2, $zero, -(1 + GRUB_ARCH_MACHINE_FULOONG2F) #else addiu $a2, $zero, -(1 + GRUB_ARCH_MACHINE_YEELOONG) #endif diff --git a/grub-core/boot/mips/startup_raw.S b/grub-core/boot/mips/startup_raw.S index 4ecff5efd..aefd387b6 100644 --- a/grub-core/boot/mips/startup_raw.S +++ b/grub-core/boot/mips/startup_raw.S @@ -109,7 +109,7 @@ argcont: DO_PARSE (memsizestr, $s4) DO_PARSE (highmemsizestr, $s5) DO_CHECKT1 (pmon_yeeloong_verstr, GRUB_ARCH_MACHINE_YEELOONG) - DO_CHECKT1 (pmon_fuloong_verstr, GRUB_ARCH_MACHINE_FULOONG) + DO_CHECKT1 (pmon_fuloong2f_verstr, GRUB_ARCH_MACHINE_FULOONG2F) 2: b argcont addiu $t0, $t0, 4 @@ -155,11 +155,12 @@ memsizestr: .asciiz "memsize=" highmemsizestr: .asciiz "highmemsize=" machtype_yeeloong_str1: .asciiz "machtype=8.9" machtype_yeeloong_str2: .asciiz "machtype=lemote-yeeloong-" -machtype_fuloong_str: .asciiz "machtype=lemote-fuloong-" +machtype_fuloong2f_str: .asciiz "machtype=lemote-fuloong-2f" +machtype_fuloong2e_str: .asciiz "machtype=lemote-fuloong-2e" pmon_yeeloong_str: .asciiz "PMON_VER=LM8" -pmon_fuloong_str: .asciiz "PMON_VER=LM6" +pmon_fuloong2f_str: .asciiz "PMON_VER=LM6" pmon_yeeloong_verstr: .asciiz "Version=LM8" -pmon_fuloong_verstr: .asciiz "Version=LM6" +pmon_fuloong2f_verstr: .asciiz "Version=LM6" .p2align 2 argdone: @@ -173,8 +174,9 @@ argdone: DO_CHECKA1 (machtype_yeeloong_str1, GRUB_ARCH_MACHINE_YEELOONG) DO_CHECKA1 (machtype_yeeloong_str2, GRUB_ARCH_MACHINE_YEELOONG) DO_CHECKA1 (pmon_yeeloong_str, GRUB_ARCH_MACHINE_YEELOONG) - DO_CHECKA1 (machtype_fuloong_str, GRUB_ARCH_MACHINE_FULOONG) - DO_CHECKA1 (pmon_fuloong_str, GRUB_ARCH_MACHINE_FULOONG) + DO_CHECKA1 (machtype_fuloong2f_str, GRUB_ARCH_MACHINE_FULOONG2F) + DO_CHECKA1 (machtype_fuloong2e_str, GRUB_ARCH_MACHINE_FULOONG2E) + DO_CHECKA1 (pmon_fuloong2f_str, GRUB_ARCH_MACHINE_FULOONG2F) addiu $a0, $a0, -1 b argdone addiu $a1, $a1, 4 diff --git a/grub-core/bus/cs5536.c b/grub-core/bus/cs5536.c index 58ffeb60a..1aae7852e 100644 --- a/grub-core/bus/cs5536.c +++ b/grub-core/bus/cs5536.c @@ -281,7 +281,7 @@ grub_cs5536_init_geode (grub_pci_device_t dev) | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE0 | GRUB_CS5536_MSR_DIVIL_LEG_IO_RTC_ENABLE1); break; - case GRUB_ARCH_MACHINE_FULOONG: + case GRUB_ARCH_MACHINE_FULOONG2F: grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_LEG_IO, GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 | GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c index bcef391b9..0e4948beb 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -213,7 +213,9 @@ grub_halt (void) { switch (grub_arch_machine) { - case GRUB_ARCH_MACHINE_FULOONG: + case GRUB_ARCH_MACHINE_FULOONG2E: + break; + case GRUB_ARCH_MACHINE_FULOONG2F: { grub_pci_device_t dev; grub_port_t p; diff --git a/grub-core/kern/mips/startup.S b/grub-core/kern/mips/startup.S index 6220a8c33..da6450237 100644 --- a/grub-core/kern/mips/startup.S +++ b/grub-core/kern/mips/startup.S @@ -61,7 +61,7 @@ VARIABLE (grub_arch_highmemsize) .long 0 #ifdef GRUB_MACHINE_MIPS_LOONGSON VARIABLE (grub_arch_machine) - .long GRUB_ARCH_MACHINE_FULOONG + .long GRUB_ARCH_MACHINE_FULOONG2F #endif cont: /* Save our base. */ diff --git a/grub-core/loader/mips/linux.c b/grub-core/loader/mips/linux.c index 64c4a0531..2b4875983 100644 --- a/grub-core/loader/mips/linux.c +++ b/grub-core/loader/mips/linux.c @@ -41,7 +41,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); const char loongson_machtypes[][60] = { [GRUB_ARCH_MACHINE_YEELOONG] = "machtype=lemote-yeeloong-2f-8.9inches", - [GRUB_ARCH_MACHINE_FULOONG] = "machtype=lemote-fuloong-2f-unknown" + [GRUB_ARCH_MACHINE_FULOONG2F] = "machtype=lemote-fuloong-2f-unknown", + [GRUB_ARCH_MACHINE_FULOONG2E] = "machtype=lemote-fuloong-2e-unknown" }; #endif diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c index 0381349a4..b724a945a 100644 --- a/grub-core/term/serial.c +++ b/grub-core/term/serial.c @@ -239,6 +239,15 @@ grub_cmd_serial (grub_extcmd_context_t ctxt, int argc, char **args) return GRUB_ERR_NONE; } +#ifdef GRUB_MACHINE_MIPS_LOONGSON +const char loongson_defserial[][6] = + { + [GRUB_ARCH_MACHINE_YEELOONG] = "com0", + [GRUB_ARCH_MACHINE_FULOONG2F] = "com2", + [GRUB_ARCH_MACHINE_FULOONG2E] = "com1" + }; +#endif + grub_err_t grub_serial_register (struct grub_serial_port *port) { @@ -301,9 +310,7 @@ grub_serial_register (struct grub_serial_port *port) port->term_out = out; grub_terminfo_output_register (out, "vt100"); #ifdef GRUB_MACHINE_MIPS_LOONGSON - if (grub_strcmp (port->name, - (grub_arch_machine == GRUB_ARCH_MACHINE_YEELOONG) - ? "com0" : "com2") == 0) + if (grub_strcmp (port->name, loongson_defserial[grub_arch_machine]) == 0) { grub_term_register_input_active ("serial_*", in); grub_term_register_output_active ("serial_*", out); diff --git a/include/grub/mips/loongson/kernel.h b/include/grub/mips/loongson/kernel.h index 612221ed2..ba94e4331 100644 --- a/include/grub/mips/loongson/kernel.h +++ b/include/grub/mips/loongson/kernel.h @@ -23,7 +23,8 @@ #include #define GRUB_ARCH_MACHINE_YEELOONG 0 -#define GRUB_ARCH_MACHINE_FULOONG 1 +#define GRUB_ARCH_MACHINE_FULOONG2F 1 +#define GRUB_ARCH_MACHINE_FULOONG2E 2 #ifndef ASM_FILE diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c index b05507242..420690923 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -67,7 +67,7 @@ struct image_target_desc IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT, IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_I386_IEEE1275, IMAGE_LOONGSON_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH, - IMAGE_FULOONG_FLASH, IMAGE_I386_PC_PXE, IMAGE_MIPS_ARC, + IMAGE_FULOONG2F_FLASH, IMAGE_I386_PC_PXE, IMAGE_MIPS_ARC, IMAGE_QEMU_MIPS_FLASH } id; enum @@ -298,10 +298,10 @@ struct image_target_desc image_targets[] = }, { .dirname = "mipsel-loongson", - .names = { "mipsel-fuloong-flash", NULL }, + .names = { "mipsel-fuloong2f-flash", NULL }, .voidp_sizeof = 4, .bigendian = 0, - .id = IMAGE_FULOONG_FLASH, + .id = IMAGE_FULOONG2F_FLASH, .flags = PLATFORM_FLAGS_DECOMPRESSORS, .prefix = GRUB_KERNEL_MIPS_LOONGSON_PREFIX, .prefix_end = GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END, @@ -321,6 +321,7 @@ struct image_target_desc image_targets[] = { .dirname = "mipsel-loongson", .names = { "mipsel-loongson-elf", "mipsel-yeeloong-elf", + "mipsel-fuloong2f-elf", "mipsel-fuloong2e-elf", "mipsel-fuloong-elf", NULL }, .voidp_sizeof = 4, .bigendian = 0, @@ -1362,7 +1363,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], } break; case IMAGE_YEELOONG_FLASH: - case IMAGE_FULOONG_FLASH: + case IMAGE_FULOONG2F_FLASH: { char *rom_img; size_t rom_size; @@ -1381,7 +1382,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /* None yet. */ - const grub_uint8_t fuloong_fwstart_good_hash[512 / 8] = + const grub_uint8_t fuloong2f_fwstart_good_hash[512 / 8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1393,10 +1394,10 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], }; const grub_uint8_t *fwstart_good_hash; - if (image_target->id == IMAGE_FULOONG_FLASH) + if (image_target->id == IMAGE_FULOONG2F_FLASH) { - fwstart_good_hash = fuloong_fwstart_good_hash; - boot_path = grub_util_get_path (dir, "fwstart_fuloong.img"); + fwstart_good_hash = fuloong2f_fwstart_good_hash; + boot_path = grub_util_get_path (dir, "fwstart_fuloong2f.img"); } else { diff --git a/util/grub-mkstandalone.in b/util/grub-mkstandalone.in index aaff99051..e140ecc82 100644 --- a/util/grub-mkstandalone.in +++ b/util/grub-mkstandalone.in @@ -136,7 +136,7 @@ if [ "x$source_directory" = x ] ; then cpu="`echo $format | awk -F - '{ print $1; }'`" platform="`echo $format | awk -F - '{ print $2; }'`" case "$platform" in - yeeloong | fuloong) + yeeloong | fuloong | fuloong2f | fuloong2e) platform=loongson ;; esac case "$cpu-$platform" in From 9594c6897ec93b27066244a71005f262dab91f82 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 22:49:48 +0200 Subject: [PATCH 39/65] * configure.ac: Don't impose march=loongson2f on loongson platform. (It can still be specified in TARGET_CFLAGS) --- ChangeLog | 5 +++++ configure.ac | 17 ----------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index fdc89b5a2..c2f501c00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-19 Vladimir Serbinenko + + * configure.ac: Don't impose march=loongson2f on loongson platform. (It + can still be specified in TARGET_CFLAGS) + 2011-08-19 Vladimir Serbinenko Rename Fuloong into Fuloong 2F. Add new ID for Fuloong2E. diff --git a/configure.ac b/configure.ac index 224c9c9de..9cfbd2340 100644 --- a/configure.ac +++ b/configure.ac @@ -412,23 +412,6 @@ if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" fi -if test "${target_cpu}-${platform}" = mipsel-loongson; then - AC_CACHE_CHECK([whether -march=loongson2f works], [grub_cv_cc_march_loongson2f], [ - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -march=loongson2f" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_march_loongson2f=yes], - [grub_cv_cc_march_loongson2f=no]) - CFLAGS="$SAVE_CFLAGS" - ]) - - if test "x$grub_cv_cc_march_loongson2f" = xyes; then - TARGET_CFLAGS="$TARGET_CFLAGS -march=loongson2f" - else - TARGET_CFLAGS="$TARGET_CFLAGS -march=mips3" - fi -fi - grub_apple_target_cc if test x$grub_cv_apple_target_cc = xyes ; then TARGET_CPPFLAGS="$TARGET_CPPFLAGS -DAPPLE_CC=1" From 1227c1339017349e6d011fe4bc927ff394141272 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 22:56:49 +0200 Subject: [PATCH 40/65] Fix PCI iterating on functions >= 4. * grub-core/bus/pci.c (grub_pci_iterate): Remove useless ghost skipping. * include/grub/mips/loongson/pci.h (GRUB_LOONGSON_OHCI_GHOST_FUNCTION): Removed. (GRUB_LOONGSON_EHCI_GHOST_FUNCTION): Likewise. (grub_pci_read): Fix bitmask. (grub_pci_read_word): Likewise. (grub_pci_read_byte): Likewise. (grub_pci_write): Likewise. (grub_pci_write_word): Likewise. (grub_pci_write_byte): Likewise. --- ChangeLog | 15 +++++++++++++++ grub-core/bus/pci.c | 10 ---------- include/grub/mips/loongson/pci.h | 14 ++++++-------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2f501c00..cfd46dad7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2011-08-19 Vladimir Serbinenko + + Fix PCI iterating on functions >= 4. + + * grub-core/bus/pci.c (grub_pci_iterate): Remove useless ghost skipping. + * include/grub/mips/loongson/pci.h (GRUB_LOONGSON_OHCI_GHOST_FUNCTION): + Removed. + (GRUB_LOONGSON_EHCI_GHOST_FUNCTION): Likewise. + (grub_pci_read): Fix bitmask. + (grub_pci_read_word): Likewise. + (grub_pci_read_byte): Likewise. + (grub_pci_write): Likewise. + (grub_pci_write_word): Likewise. + (grub_pci_write_byte): Likewise. + 2011-08-19 Vladimir Serbinenko * configure.ac: Don't impose march=loongson2f on loongson platform. (It diff --git a/grub-core/bus/pci.c b/grub-core/bus/pci.c index 51006a20e..f007ec33a 100644 --- a/grub-core/bus/pci.c +++ b/grub-core/bus/pci.c @@ -115,16 +115,6 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook) continue; } -#ifdef GRUB_MACHINE_MIPS_LOONGSON - /* Skip ghosts. */ - if (id == GRUB_LOONGSON_OHCI_PCIID - && dev.function == GRUB_LOONGSON_OHCI_GHOST_FUNCTION) - continue; - if (id == GRUB_LOONGSON_EHCI_PCIID - && dev.function == GRUB_LOONGSON_EHCI_GHOST_FUNCTION) - continue; -#endif - if (hook (dev, id)) return; diff --git a/include/grub/mips/loongson/pci.h b/include/grub/mips/loongson/pci.h index 3f828c2f8..57c7dd1fc 100644 --- a/include/grub/mips/loongson/pci.h +++ b/include/grub/mips/loongson/pci.h @@ -26,8 +26,6 @@ #define GRUB_LOONGSON_OHCI_PCIID 0x00351033 #define GRUB_LOONGSON_EHCI_PCIID 0x00e01033 -#define GRUB_LOONGSON_OHCI_GHOST_FUNCTION 4 -#define GRUB_LOONGSON_EHCI_GHOST_FUNCTION 5 #define GRUB_PCI_NUM_BUS 1 #define GRUB_PCI_NUM_DEVICES 16 @@ -66,7 +64,7 @@ grub_pci_read (grub_pci_address_t addr) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); return *(volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)); + | (addr & 0x07ff)); } static inline grub_uint16_t @@ -74,7 +72,7 @@ grub_pci_read_word (grub_pci_address_t addr) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); return *(volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)); + | (addr & 0x07ff)); } static inline grub_uint8_t @@ -82,7 +80,7 @@ grub_pci_read_byte (grub_pci_address_t addr) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); return *(volatile grub_uint8_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)); + | (addr & 0x07ff)); } static inline void @@ -90,7 +88,7 @@ grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); *(volatile grub_uint32_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)) = data; + | (addr & 0x07ff)) = data; } static inline void @@ -98,7 +96,7 @@ grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); *(volatile grub_uint16_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)) = data; + | (addr & 0x07ff)) = data; } static inline void @@ -106,7 +104,7 @@ grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) { GRUB_MACHINE_PCI_CONF_CTRL_REG = 1 << ((addr >> 11) & 0xf); *(volatile grub_uint8_t *) (GRUB_MACHINE_PCI_CONFSPACE - | (addr & 0x03ff)) = data; + | (addr & 0x07ff)) = data; } volatile void * From 84beb0eeb95ef792fd1bab516324e62f0fb50b09 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 22:59:24 +0200 Subject: [PATCH 41/65] * grub-core/kern/misc.c (grub_vprintf): Fix a bug on malloc failure. --- ChangeLog | 4 ++++ grub-core/kern/misc.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index cfd46dad7..5e45756c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-19 Vladimir Serbinenko + + * grub-core/kern/misc.c (grub_vprintf): Fix a bug on malloc failure. + 2011-08-19 Vladimir Serbinenko Fix PCI iterating on functions >= 4. diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index a3dfabf82..ebf80f100 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -210,6 +210,7 @@ grub_vprintf (const char *fmt, va_list args) buf[PREALLOC_SIZE - 2] = '.'; buf[PREALLOC_SIZE - 1] = '.'; buf[PREALLOC_SIZE] = 0; + curbuf = buf; } else s = grub_vsnprintf_real (curbuf, s, fmt, ap2); From 0d1fd0113ba001d6fd379274e34ff7c3782ee347 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 23:04:18 +0200 Subject: [PATCH 42/65] * include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_COP0_PRID): New define. * grub-core/kern/mips/loongson/init.c (grub_machine_init): Check that PRID matches the detected subplatform and reset the subplatform if it doesn't. --- ChangeLog | 8 ++++++++ grub-core/kern/mips/loongson/init.c | 17 +++++++++++++++++ include/grub/mips/loongson.h | 1 + 3 files changed, 26 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5e45756c8..23283d924 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-08-19 Vladimir Serbinenko + + * include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_COP0_PRID): New + define. + * grub-core/kern/mips/loongson/init.c (grub_machine_init): Check + that PRID matches the detected subplatform and reset the subplatform + if it doesn't. + 2011-08-19 Vladimir Serbinenko * grub-core/kern/misc.c (grub_vprintf): Fix a bug on malloc failure. diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c index 0e4948beb..7df0ec876 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -123,6 +123,23 @@ void grub_machine_init (void) { grub_addr_t modend; + grub_uint32_t prid; + + asm volatile ("mfc0 %0, " GRUB_CPU_LOONGSON_COP0_PRID : "=r" (prid)); + + switch (prid) + { + /* Loongson 2E. */ + case 0x6302: + grub_arch_machine = GRUB_ARCH_MACHINE_FULOONG2E; + break; + /* Loongson 2F. */ + case 0x6303: + if (grub_arch_machine != GRUB_ARCH_MACHINE_FULOONG2F + && grub_arch_machine != GRUB_ARCH_MACHINE_YEELOONG) + grub_arch_machine = GRUB_ARCH_MACHINE_YEELOONG; + break; + } /* FIXME: measure this. */ if (grub_arch_busclock == 0) diff --git a/include/grub/mips/loongson.h b/include/grub/mips/loongson.h index ce5eb5e3d..e6f0241f2 100644 --- a/include/grub/mips/loongson.h +++ b/include/grub/mips/loongson.h @@ -66,6 +66,7 @@ #define GRUB_CPU_LOONGSON_COP0_BADVADDR GRUB_CPU_REGISTER_WRAP($8) #define GRUB_CPU_LOONGSON_COP0_CAUSE GRUB_CPU_REGISTER_WRAP($13) #define GRUB_CPU_LOONGSON_COP0_EPC GRUB_CPU_REGISTER_WRAP($14) +#define GRUB_CPU_LOONGSON_COP0_PRID GRUB_CPU_REGISTER_WRAP($15) #define GRUB_CPU_LOONGSON_COP0_CACHE_TAGLO GRUB_CPU_REGISTER_WRAP($28) #define GRUB_CPU_LOONGSON_COP0_CACHE_TAGHI GRUB_CPU_REGISTER_WRAP($29) From d94497eacaac10d678f1d4919ac257ce7040c6d8 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 23:08:36 +0200 Subject: [PATCH 43/65] * grub-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on loongson. * grub-core/kern/mips/loongson/init.c (grub_machine_init): Init video_radeon_fuloong2e. * grub-core/video/radeon_fuloong2e.c: New file. * include/grub/video.h (grub_video_id_t): Add new ID GRUB_VIDEO_DRIVER_RADEON_FULOONG2E. --- ChangeLog | 10 ++ grub-core/Makefile.core.def | 1 + grub-core/kern/mips/loongson/init.c | 2 + grub-core/video/radeon_fuloong2e.c | 231 ++++++++++++++++++++++++++++ include/grub/video.h | 1 + 5 files changed, 245 insertions(+) create mode 100644 grub-core/video/radeon_fuloong2e.c diff --git a/ChangeLog b/ChangeLog index 23283d924..2bff79544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-08-19 Vladimir Serbinenko + + * grub-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on + loongson. + * grub-core/kern/mips/loongson/init.c (grub_machine_init): Init + video_radeon_fuloong2e. + * grub-core/video/radeon_fuloong2e.c: New file. + * include/grub/video.h (grub_video_id_t): Add new ID + GRUB_VIDEO_DRIVER_RADEON_FULOONG2E. + 2011-08-19 Vladimir Serbinenko * include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_COP0_PRID): New diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index f129e98db..e95d87d37 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -180,6 +180,7 @@ kernel = { mips_loongson = term/serial.c; mips_loongson = video/sm712.c; mips_loongson = video/sis315pro.c; + mips_loongson = video/radeon_fuloong2e.c; extra_dist = video/sm712_init.c; mips_loongson = commands/keylayouts.c; diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c index 7df0ec876..5a95d29ed 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -35,6 +35,7 @@ extern void grub_video_sm712_init (void); extern void grub_video_sis315pro_init (void); +extern void grub_video_radeon_fuloong2e_init (void); extern void grub_video_init (void); extern void grub_bitmap_init (void); extern void grub_font_init (void); @@ -206,6 +207,7 @@ grub_machine_init (void) grub_video_init (); grub_video_sm712_init (); grub_video_sis315pro_init (); + grub_video_radeon_fuloong2e_init (); grub_bitmap_init (); grub_font_init (); grub_gfxterm_init (); diff --git a/grub-core/video/radeon_fuloong2e.c b/grub-core/video/radeon_fuloong2e.c new file mode 100644 index 000000000..3a65b6720 --- /dev/null +++ b/grub-core/video/radeon_fuloong2e.c @@ -0,0 +1,231 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008,2009,2010,2011 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 . + */ + +#define grub_video_render_target grub_video_fbrender_target + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GRUB_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE 1048576 + +static struct +{ + struct grub_video_mode_info mode_info; + struct grub_video_render_target *render_target; + + grub_uint8_t *ptr; + int mapped; + grub_uint32_t base; + grub_pci_device_t dev; +} framebuffer; + +static grub_err_t +grub_video_radeon_fuloong2e_video_init (void) +{ + /* Reset frame buffer. */ + grub_memset (&framebuffer, 0, sizeof(framebuffer)); + + return grub_video_fb_init (); +} + +static grub_err_t +grub_video_radeon_fuloong2e_video_fini (void) +{ + if (framebuffer.mapped) + grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, + GRUB_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE); + + return grub_video_fb_fini (); +} + +static grub_err_t +grub_video_radeon_fuloong2e_setup (unsigned int width, unsigned int height, + unsigned int mode_type, unsigned int mode_mask __attribute__ ((unused))) +{ + int depth; + grub_err_t err; + int found = 0; + +#ifndef TEST + auto int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__ ((unused))); + int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__ ((unused))) + { + grub_pci_address_t addr; + grub_uint32_t class; + + addr = grub_pci_make_address (dev, GRUB_PCI_REG_CLASS); + class = grub_pci_read (addr); + + if (((class >> 16) & 0xffff) != GRUB_PCI_CLASS_SUBCLASS_VGA + || pciid != 0x515a1002) + return 0; + + found = 1; + + addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0); + framebuffer.base = grub_pci_read (addr); + framebuffer.dev = dev; + + return 1; + } + + /* Decode depth from mode_type. If it is zero, then autodetect. */ + depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) + >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; + + if ((width != 640 && width != 0) || (height != 480 && height != 0) + || (depth != 16 && depth != 0)) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Only 1024x600x16 is supported"); + + grub_pci_iterate (find_card); + if (!found) + return grub_error (GRUB_ERR_IO, "Couldn't find graphics card"); +#endif + /* Fill mode info details. */ + framebuffer.mode_info.width = 640; + framebuffer.mode_info.height = 480; + framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.bpp = 16; + framebuffer.mode_info.bytes_per_pixel = 2; + framebuffer.mode_info.pitch = 640 * 2; + framebuffer.mode_info.number_of_colors = 256; + framebuffer.mode_info.red_mask_size = 5; + framebuffer.mode_info.red_field_pos = 11; + framebuffer.mode_info.green_mask_size = 6; + framebuffer.mode_info.green_field_pos = 5; + framebuffer.mode_info.blue_mask_size = 5; + framebuffer.mode_info.blue_field_pos = 0; + framebuffer.mode_info.reserved_mask_size = 0; + framebuffer.mode_info.reserved_field_pos = 0; +#ifndef TEST + framebuffer.mode_info.blit_format + = grub_video_get_blit_format (&framebuffer.mode_info); +#endif + + /* We can safely discard volatile attribute. */ +#ifndef TEST + framebuffer.ptr + = (void *) grub_pci_device_map_range (framebuffer.dev, + framebuffer.base, + GRUB_RADEON_FULOONG2E_TOTAL_MEMORY_SPACE); +#endif + framebuffer.mapped = 1; + + /* Prevent garbage from appearing on the screen. */ + grub_memset (framebuffer.ptr, 0x55, + framebuffer.mode_info.height * framebuffer.mode_info.pitch); + +#ifndef TEST + err = grub_video_fb_create_render_target_from_pointer (&framebuffer + .render_target, + &framebuffer.mode_info, + framebuffer.ptr); + + if (err) + return err; + + err = grub_video_fb_set_active_render_target (framebuffer.render_target); + + if (err) + return err; + + /* Copy default palette to initialize emulated palette. */ + err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, + grub_video_fbstd_colors); +#endif + return err; +} + +static grub_err_t +grub_video_radeon_fuloong2e_swap_buffers (void) +{ + /* TODO: Implement buffer swapping. */ + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_video_radeon_fuloong2e_set_active_render_target (struct grub_video_render_target *target) +{ + if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + target = framebuffer.render_target; + + return grub_video_fb_set_active_render_target (target); +} + +static grub_err_t +grub_video_radeon_fuloong2e_get_info_and_fini (struct grub_video_mode_info *mode_info, + void **framebuf) +{ + grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + *framebuf = (char *) framebuffer.ptr; + + grub_video_fb_fini (); + + return GRUB_ERR_NONE; +} + +static struct grub_video_adapter grub_video_radeon_fuloong2e_adapter = + { + .name = "RADEON RV100 QZ (Fuloong2E) Video Driver", + .id = GRUB_VIDEO_DRIVER_RADEON_FULOONG2E, + + .prio = GRUB_VIDEO_ADAPTER_PRIO_NATIVE, + + .init = grub_video_radeon_fuloong2e_video_init, + .fini = grub_video_radeon_fuloong2e_video_fini, + .setup = grub_video_radeon_fuloong2e_setup, + .get_info = grub_video_fb_get_info, + .get_info_and_fini = grub_video_radeon_fuloong2e_get_info_and_fini, + .set_palette = grub_video_fb_set_palette, + .get_palette = grub_video_fb_get_palette, + .set_viewport = grub_video_fb_set_viewport, + .get_viewport = grub_video_fb_get_viewport, + .map_color = grub_video_fb_map_color, + .map_rgb = grub_video_fb_map_rgb, + .map_rgba = grub_video_fb_map_rgba, + .unmap_color = grub_video_fb_unmap_color, + .fill_rect = grub_video_fb_fill_rect, + .blit_bitmap = grub_video_fb_blit_bitmap, + .blit_render_target = grub_video_fb_blit_render_target, + .scroll = grub_video_fb_scroll, + .swap_buffers = grub_video_radeon_fuloong2e_swap_buffers, + .create_render_target = grub_video_fb_create_render_target, + .delete_render_target = grub_video_fb_delete_render_target, + .set_active_render_target = grub_video_radeon_fuloong2e_set_active_render_target, + .get_active_render_target = grub_video_fb_get_active_render_target, + + .next = 0 + }; + +GRUB_MOD_INIT(video_radeon_fuloong2e) +{ + grub_video_register (&grub_video_radeon_fuloong2e_adapter); +} + +GRUB_MOD_FINI(video_radeon_fuloong2e) +{ + grub_video_unregister (&grub_video_radeon_fuloong2e_adapter); +} diff --git a/include/grub/video.h b/include/grub/video.h index e30589a3d..352544c85 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -282,6 +282,7 @@ typedef enum grub_video_driver_id GRUB_VIDEO_DRIVER_BOCHS, GRUB_VIDEO_DRIVER_SDL, GRUB_VIDEO_DRIVER_SIS315PRO, + GRUB_VIDEO_DRIVER_RADEON_FULOONG2E, } grub_video_driver_id_t; typedef enum grub_video_adapter_prio From f87abff5381b312299b37f3d2a1b9d121e8ff8ff Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 19 Aug 2011 23:11:09 +0200 Subject: [PATCH 44/65] * grub-core/kern/mips/loongson/init.c (grub_reboot): Reboot Fuloong. * include/grub/cs5536.h (GRUB_CS5536_MSR_DIVIL_RESET): New definition. --- ChangeLog | 5 +++++ grub-core/kern/mips/loongson/init.c | 23 +++++++++++++++++++++-- include/grub/cs5536.h | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2bff79544..d8ad1d634 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-19 Vladimir Serbinenko + + * grub-core/kern/mips/loongson/init.c (grub_reboot): Reboot Fuloong. + * include/grub/cs5536.h (GRUB_CS5536_MSR_DIVIL_RESET): New definition. + 2011-08-19 Vladimir Serbinenko * grub-core/Makefile.core.def (kernel): Add video/radeon_fuloong2e.c on diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c index 5a95d29ed..d1cac7a67 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -269,8 +269,27 @@ grub_exit (void) void grub_reboot (void) { - grub_write_ec (GRUB_MACHINE_EC_COMMAND_REBOOT); - + switch (grub_arch_machine) + { + case GRUB_ARCH_MACHINE_FULOONG2E: + grub_outb (grub_inb (0xbfe00104) & ~4, 0xbfe00104); + grub_outb (grub_inb (0xbfe00104) | 4, 0xbfe00104); + break; + case GRUB_ARCH_MACHINE_FULOONG2F: + { + grub_pci_device_t dev; + if (!grub_cs5536_find (&dev)) + break; + grub_cs5536_write_msr (dev, GRUB_CS5536_MSR_DIVIL_RESET, + grub_cs5536_read_msr (dev, + GRUB_CS5536_MSR_DIVIL_RESET) + | 1); + break; + } + case GRUB_ARCH_MACHINE_YEELOONG: + grub_write_ec (GRUB_MACHINE_EC_COMMAND_REBOOT); + break; + } grub_millisleep (1500); grub_printf ("Reboot failed\n"); diff --git a/include/grub/cs5536.h b/include/grub/cs5536.h index 103b30633..fcacb23e8 100644 --- a/include/grub/cs5536.h +++ b/include/grub/cs5536.h @@ -77,6 +77,7 @@ #define GRUB_CS5536_MSR_DIVIL_LEG_IO_F_REMAP 0x04000000 #define GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1 0x00070000 #define GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3 0x00500000 +#define GRUB_CS5536_MSR_DIVIL_RESET 0x80000017 #define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_PRIMARY_MASK 0x80000024 #define GRUB_CS5536_MSR_DIVIL_IRQ_MAPPER_LPC_MASK 0x80000025 #define GRUB_CS5536_DIVIL_LPC_INTERRUPTS 0x1002 From a5219af18967bcca59478a4515b36c77caa814bd Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Sat, 20 Aug 2011 11:48:46 +0200 Subject: [PATCH 45/65] * grub-core/io/gzio.c (grub_gzio_open): Always return original io if file type was not recognized correctly (not gzip or corrupted). --- ChangeLog | 5 +++++ grub-core/io/gzio.c | 7 ++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8ad1d634..17e39bf15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-20 Szymon Janc + + * grub-core/io/gzio.c (grub_gzio_open): Always return original io if + file type was not recognized correctly (not gzip or corrupted). + 2011-08-19 Vladimir Serbinenko * grub-core/kern/mips/loongson/init.c (grub_reboot): Reboot Fuloong. diff --git a/grub-core/io/gzio.c b/grub-core/io/gzio.c index 5d3e5332e..7380221aa 100644 --- a/grub-core/io/gzio.c +++ b/grub-core/io/gzio.c @@ -1179,12 +1179,9 @@ grub_gzio_open (grub_file_t io) grub_free (gzio); grub_free (file); grub_file_seek (io, 0); + grub_errno = GRUB_ERR_NONE; - if (grub_errno == GRUB_ERR_BAD_FILE_TYPE) - { - grub_errno = GRUB_ERR_NONE; - return io; - } + return io; } return file; From fe8d4a7bc207d44170a24534f13355230250dc5b Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Sat, 20 Aug 2011 11:58:41 +0200 Subject: [PATCH 46/65] * grub-core/loader/i386/linux.c (grub_linux_setup_video): Add GRUB_VIDEO_DRIVER_RADEON_FULOONG2E to switch case statement. --- ChangeLog | 5 +++++ grub-core/loader/i386/linux.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 17e39bf15..742a8cec2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-20 Szymon Janc + + * grub-core/loader/i386/linux.c (grub_linux_setup_video): Add + GRUB_VIDEO_DRIVER_RADEON_FULOONG2E to switch case statement. + 2011-08-20 Szymon Janc * grub-core/io/gzio.c (grub_gzio_open): Always return original io if diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 5356d7ace..fded7bb0a 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -374,6 +374,7 @@ grub_linux_setup_video (struct linux_kernel_params *params) case GRUB_VIDEO_DRIVER_VGA: case GRUB_VIDEO_DRIVER_CIRRUS: case GRUB_VIDEO_DRIVER_BOCHS: + case GRUB_VIDEO_DRIVER_RADEON_FULOONG2E: /* Make gcc happy. */ case GRUB_VIDEO_DRIVER_SDL: case GRUB_VIDEO_DRIVER_NONE: From 7dc3c6863edb827234ec6045026dfc9f2ab9fffd Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Sat, 20 Aug 2011 13:04:38 +0200 Subject: [PATCH 47/65] Add grub-fstest option to uncompress data for commands. * util/grub-fstest.c (uncompress): New var. (options): New option -u. --- ChangeLog | 7 +++++++ util/grub-fstest.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 742a8cec2..76526f4ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-08-20 Szymon Janc + + Add grub-fstest option to uncompress data for commands. + + * util/grub-fstest.c (uncompress): New var. + (options): New option -u. + 2011-08-20 Szymon Janc * grub-core/loader/i386/linux.c (grub_linux_setup_video): Add diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 972d462da..ad64701a2 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -68,6 +68,7 @@ enum { #define BUF_SIZE 32256 static grub_disk_addr_t skip, leng; +static int uncompress = 0; static void read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len)) @@ -111,7 +112,8 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len)) return; } - grub_file_filter_disable_compression (); + if (uncompress == 0) + grub_file_filter_disable_compression (); file = grub_file_open (pathname); if (!file) { @@ -409,6 +411,7 @@ static struct argp_option options[] = { {"debug", 'd', "S", 0, N_("Set debug environment variable."), 2}, {"crypto", 'C', NULL, OPTION_ARG_OPTIONAL, N_("Mount crypto devices."), 2}, {"verbose", 'v', NULL, OPTION_ARG_OPTIONAL, N_("Print verbose messages."), 2}, + {"uncompress", 'u', NULL, OPTION_ARG_OPTIONAL, N_("Uncompress data."), 2}, {0, 0, 0, 0, 0, 0} }; @@ -469,6 +472,10 @@ argp_parser (int key, char *arg, struct argp_state *state) verbosity++; return 0; + case 'u': + uncompress = 1; + return 0; + case ARGP_KEY_END: if (args_count < num_disks) { From ab178c084a251fe568430f250d9719979957ec53 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Sat, 20 Aug 2011 21:10:00 +0200 Subject: [PATCH 48/65] * acinclude.m4: Use AC_LANG_PROGRAM macro to generate source code for AC_LANG_CONFTEST macros. --- ChangeLog | 5 +++++ acinclude.m4 | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76526f4ec..88b883028 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-21 Szymon Janc + + * acinclude.m4: Use AC_LANG_PROGRAM macro to generate source code for + AC_LANG_CONFTEST macros. + 2011-08-20 Szymon Janc Add grub-fstest option to uncompress data for commands. diff --git a/acinclude.m4 b/acinclude.m4 index 7c38155d4..5c623baee 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -316,14 +316,14 @@ fi dnl Check if the C compiler generates calls to `__enable_execute_stack()'. AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[ AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()']) -AC_LANG_CONFTEST([[ +AC_LANG_CONFTEST([AC_LANG_SOURCE([[ void f (int (*p) (void)); void g (int i) { int nestedfunc (void) { return i; } f (nestedfunc); } -]]) +]])]) if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -S conftest.c]) && test -s conftest.s; then true else @@ -346,7 +346,9 @@ AC_DEFUN([grub_CHECK_STACK_PROTECTOR],[ ssp_possible=yes] AC_MSG_CHECKING([whether `$CC' accepts `-fstack-protector']) # Is this a reliable test case? -AC_LANG_CONFTEST([[void foo (void) { volatile char a[8]; a[3]; }]]) +AC_LANG_CONFTEST([AC_LANG_SOURCE([[ +void foo (void) { volatile char a[8]; a[3]; } +]])]) [# `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then] @@ -364,7 +366,9 @@ AC_DEFUN([grub_CHECK_STACK_ARG_PROBE],[ [# Smashing stack arg probe. sap_possible=yes] AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe']) -AC_LANG_CONFTEST([[void foo (void) { volatile char a[8]; a[3]; }]]) +AC_LANG_CONFTEST([AC_LANG_SOURCE([[ +void foo (void) { volatile char a[8]; a[3]; } +]])]) [if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then] AC_MSG_RESULT([yes]) [# Should we clear up other files as well, having called `AC_LANG_CONFTEST'? @@ -399,7 +403,7 @@ AC_DEFUN([grub_CHECK_PIE],[ pie_possible=yes] AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default]) # Is this a reliable test case? -AC_LANG_CONFTEST([[ +AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #ifdef __PIE__ int main() { return 0; @@ -407,7 +411,7 @@ int main() { #else #error NO __PIE__ DEFINED #endif -]]) +]])]) [# `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? From 4155e6974ad15f963eff5dfbe03cb36b48c7183b Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 23 Aug 2011 11:18:00 +0200 Subject: [PATCH 49/65] * util/grub-install.in: Move cryptodisk logic to appropriate place. --- ChangeLog | 4 ++++ util/grub-install.in | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88b883028..26af06ed3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-23 Vladimir Serbinenko + + * util/grub-install.in: Move cryptodisk logic to appropriate place. + 2011-08-21 Szymon Janc * acinclude.m4: Use AC_LANG_PROGRAM macro to generate source code for diff --git a/util/grub-install.in b/util/grub-install.in index f9e1510d1..d11d24421 100644 --- a/util/grub-install.in +++ b/util/grub-install.in @@ -558,11 +558,6 @@ if [ "x${devabstraction_module}" = "x" ] ; then exit 1 fi - if [ x$GRUB_CRYPTODISK_ENABLE = xy ]; then - for uuid in "`"${grub_probe}" --device "${device}" --target=cryptodisk_uuid`"; do - echo "cryptomount -u $uuid" - done - fi echo "search.fs_uuid ${uuid} root " >> "${grubdir}/load.cfg" echo 'set prefix=($root)'"${relative_grubdir}" >> "${grubdir}/load.cfg" @@ -577,6 +572,14 @@ if [ "x${devabstraction_module}" = "x" ] ; then fi fi else + if [ x$GRUB_CRYPTODISK_ENABLE = xy ]; then + for uuid in "`"${grub_probe}" --device "${grub_device}" --target=cryptodisk_uuid`"; do + echo "cryptomount -u $uuid" >> "${grubdir}/load.cfg" + done + fi + + config_opt="-c ${grubdir}/load.cfg " + prefix_drive=`"$grub_probe" --device-map="${device_map}" --target=drive --device "${grub_device}"` || exit 1 fi From ab80f326f47e2e83aaf35ac8b05e8b2c7e0966c8 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 23 Aug 2011 11:19:26 +0200 Subject: [PATCH 50/65] * grub-core/commands/wildcard.c (make_regex): Handle @. --- ChangeLog | 4 ++++ grub-core/commands/wildcard.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 26af06ed3..345f8f4cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-23 Vladimir Serbinenko + + * grub-core/commands/wildcard.c (make_regex): Handle @. + 2011-08-23 Vladimir Serbinenko * util/grub-install.in: Move cryptodisk logic to appropriate place. diff --git a/grub-core/commands/wildcard.c b/grub-core/commands/wildcard.c index d2f4347d5..256c07e51 100644 --- a/grub-core/commands/wildcard.c +++ b/grub-core/commands/wildcard.c @@ -139,6 +139,7 @@ make_regex (const char *start, const char *end, regex_t *regexp) case '.': case '(': case ')': + case '@': buffer[i++] = '\\'; buffer[i++] = ch; break; From ca51c4a04f4a67fe86bcdbddd899a28ae508f8a4 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 23 Aug 2011 11:20:56 +0200 Subject: [PATCH 51/65] * grub-core/kern/mips/loongson/init.c (grub_machine_init): Handle the case of less than 256 MiB of RAM. --- ChangeLog | 5 +++++ grub-core/kern/mips/loongson/init.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 345f8f4cd..ad7dea7c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-23 Vladimir Serbinenko + + * grub-core/kern/mips/loongson/init.c (grub_machine_init): Handle the + case of less than 256 MiB of RAM. + 2011-08-23 Vladimir Serbinenko * grub-core/commands/wildcard.c (make_regex): Handle @. diff --git a/grub-core/kern/mips/loongson/init.c b/grub-core/kern/mips/loongson/init.c index d1cac7a67..2d1a0653e 100644 --- a/grub-core/kern/mips/loongson/init.c +++ b/grub-core/kern/mips/loongson/init.c @@ -188,7 +188,7 @@ grub_machine_init (void) } else { - grub_arch_memsize = (totalmem >> 20); + grub_arch_memsize = totalmem; grub_arch_highmemsize = 0; } From 2221ab6c62fdd6473f1ae4f147739b585fde8e1b Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Mon, 5 Sep 2011 13:58:33 +0100 Subject: [PATCH 52/65] * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Return 1 for */README* as well as README*. Reported by: Axel Beckert. --- ChangeLog | 6 ++++++ util/grub-mkconfig_lib.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ad7dea7c8..c84aa30aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-05 Colin Watson + + * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Return 1 for + */README* as well as README*. + Reported by: Axel Beckert. + 2011-08-23 Vladimir Serbinenko * grub-core/kern/mips/loongson/init.c (grub_machine_init): Handle the diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 901b5752f..a453a6bb5 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -157,7 +157,7 @@ grub_file_is_not_garbage () if test -f "$1" ; then case "$1" in *.dpkg-*) return 1 ;; # debian dpkg - README*) return 1 ;; # documentation + README*|*/README*) return 1 ;; # documentation esac else return 1 From 1a7d7db97f34d0c38dd64655ef944b4cf0768ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= Date: Sat, 17 Sep 2011 23:01:48 +0200 Subject: [PATCH 53/65] Get sector size from disk label for NetBSD. --- ChangeLog | 5 +++++ grub-core/kern/emu/hostdisk.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c84aa30aa..1acdce29e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-17 Grégoire Sutre + + * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__NetBSD__]: + Get sector size from disk label. + 2011-09-05 Colin Watson * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Return 1 for diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 000ef2f79..b4c4eef7c 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -265,10 +265,13 @@ grub_util_get_fd_sectors (int fd, unsigned *log_secsize) # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (ioctl (fd, DIOCGSECTORSIZE, §or_size)) + goto fail; +# elif defined(__NetBSD__) + sector_size = label.d_secsize; # else if (ioctl (fd, BLKSSZGET, §or_size)) -# endif goto fail; +# endif if (sector_size & (sector_size - 1) || !sector_size) goto fail; From 20fd15f9db1e5379d264e29f0f28e0b96391bf95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= Date: Sat, 17 Sep 2011 23:40:10 +0200 Subject: [PATCH 54/65] Add LIBUTIL for grub-mkrelpath and grub-fstest. Fixes build on NetBSD. --- ChangeLog | 6 ++++++ Makefile.util.def | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1acdce29e..a454f2f84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-09-17 Grégoire Sutre + + * Makefile.util.def (grub-mkrelpath): Add LIBUTIL for getrawpartition(3) + on NetBSD. + * Makefile.util.def (grub-fstest): Likewise. + 2011-09-17 Grégoire Sutre * grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors) [__NetBSD__]: diff --git a/Makefile.util.def b/Makefile.util.def index d86cb9761..713729c55 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -147,7 +147,7 @@ program = { ldadd = libgrubgcry.a; ldadd = libgrubkern.a; ldadd = grub-core/gnulib/libgnu.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { @@ -226,7 +226,7 @@ program = { ldadd = libgrubgcry.a; ldadd = libgrubkern.a; ldadd = grub-core/gnulib/libgnu.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)'; }; program = { From 69915030942771f6813ebc238e86e05b5112f3b5 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 28 Sep 2011 14:07:53 +0200 Subject: [PATCH 55/65] * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): Return 0 if disk isn't biosdisk. --- ChangeLog | 5 +++++ grub-core/kern/emu/hostdisk.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index a454f2f84..9d19fe450 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-28 Vladimir Serbinenko + + * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): + Return 0 if disk isn't biosdisk. + 2011-09-17 Grégoire Sutre * Makefile.util.def (grub-mkrelpath): Add LIBUTIL for getrawpartition(3) diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index b4c4eef7c..a9a8c066e 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -1841,6 +1841,9 @@ grub_util_biosdisk_is_floppy (grub_disk_t disk) struct stat st; int fd; + if (disk->dev != &grub_util_biosdisk_dev) + return 0; + fd = open (map[disk->id].device, O_RDONLY); /* Shouldn't happen. */ if (fd == -1) From 2ded951ef70998ebebabd7b73d1a6bf0006a93d7 Mon Sep 17 00:00:00 2001 From: Andreas Born Date: Wed, 28 Sep 2011 14:19:21 +0200 Subject: [PATCH 56/65] Fix incorrect identifiers in bash-completion. * util/bash-completion.d/grub-completion.bash.in (_grub_mkpasswd-pbkdf2): Rename to ... (_grub_mkpasswd_pbkdf2): ... this. All users updated. (_grub_script-check): Rename to ... (_grub_script_check): ... this. All users updated. --- ChangeLog | 10 ++++++++++ util/bash-completion.d/grub-completion.bash.in | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d19fe450..5cc753c11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-09-28 Andreas Born + + Fix incorrect identifiers in bash-completion. + + * util/bash-completion.d/grub-completion.bash.in + (_grub_mkpasswd-pbkdf2): Rename to ... + (_grub_mkpasswd_pbkdf2): ... this. All users updated. + (_grub_script-check): Rename to ... + (_grub_script_check): ... this. All users updated. + 2011-09-28 Vladimir Serbinenko * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): diff --git a/util/bash-completion.d/grub-completion.bash.in b/util/bash-completion.d/grub-completion.bash.in index 65cbb80ee..64d49fe0b 100644 --- a/util/bash-completion.d/grub-completion.bash.in +++ b/util/bash-completion.d/grub-completion.bash.in @@ -402,7 +402,7 @@ unset __grub_mkimage_program # # grub-mkpasswd-pbkdf2 # -_grub_mkpasswd-pbkdf2 () { +_grub_mkpasswd_pbkdf2 () { local cur COMPREPLY=() @@ -417,7 +417,7 @@ _grub_mkpasswd-pbkdf2 () { } __grub_mkpasswd_pbkdf2_program=$( echo grub-mkpasswd-pbkdf2 | sed "@program_transform_name@" ) have ${__grub_mkpasswd_pbkdf2_program} && \ - complete -F _grub_mkpasswd-pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program} + complete -F _grub_mkpasswd_pbkdf2 -o filenames ${__grub_mkpasswd_pbkdf2_program} unset __grub_mkpasswd_pbkdf2_program @@ -462,7 +462,7 @@ unset __grub_probe_program # # grub-script-check # -_grub_script-check () { +_grub_script_check () { local cur COMPREPLY=() @@ -477,7 +477,7 @@ _grub_script-check () { } __grub_script_check_program=$( echo grub-script-check | sed "@program_transform_name@" ) have ${__grub_script_check_program} && \ - complete -F _grub_script-check -o filenames ${__grub_script_check_program} + complete -F _grub_script_check -o filenames ${__grub_script_check_program} # Local variables: From 91a1a164d66dfdeb4d36ac5bc4f39f62e4aee58f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 28 Sep 2011 16:43:00 +0200 Subject: [PATCH 57/65] * grub-core/loader/multiboot_elfxx.c (Elf_Shdr): Set according to loader. --- ChangeLog | 5 +++++ grub-core/loader/multiboot_elfxx.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5cc753c11..d415a4bcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-28 Thomas Haller + + * grub-core/loader/multiboot_elfxx.c (Elf_Shdr): Set according to + loader. + 2011-09-28 Andreas Born Fix incorrect identifiers in bash-completion. diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c index 0c29fe9c2..c6c88f177 100644 --- a/grub-core/loader/multiboot_elfxx.c +++ b/grub-core/loader/multiboot_elfxx.c @@ -22,12 +22,14 @@ # define ELFCLASSXX ELFCLASS32 # define Elf_Ehdr Elf32_Ehdr # define Elf_Phdr Elf32_Phdr +# define Elf_Shdr Elf32_Shdr #elif defined(MULTIBOOT_LOAD_ELF64) # define XX 64 # define E_MACHINE MULTIBOOT_ELF64_MACHINE # define ELFCLASSXX ELFCLASS64 # define Elf_Ehdr Elf64_Ehdr # define Elf_Phdr Elf64_Phdr +# define Elf_Shdr Elf64_Shdr #else #error "I'm confused" #endif @@ -223,3 +225,4 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) #undef ELFCLASSXX #undef Elf_Ehdr #undef Elf_Phdr +#undef Elf_Shdr From e0b0dc837b9717842584623126577c74c2dd65d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Sutre?= Date: Wed, 28 Sep 2011 23:45:57 +0200 Subject: [PATCH 58/65] Make knetbsd pass bootinfo bootdisk and bootwedge. --- ChangeLog | 12 +++++ grub-core/loader/i386/bsd.c | 84 +++++++++++++++++++++++++++++ include/grub/bsdlabel.h | 5 +- include/grub/i386/netbsd_bootinfo.h | 11 ++++ 4 files changed, 111 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d415a4bcd..8cdd158cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-09-28 Grégoire Sutre + + * include/grub/bsdlabel.h (grub_partition_bsd_disk_label): Add fields + type and packname. + * include/grub/i386/netbsd_bootinfo.h (NETBSD_BTINFO_BOOTDISK): + Resurrected. + (NETBSD_BTINFO_BOOTWEDGE): New definition. + (grub_netbsd_btinfo_bootwedge): New struct. + * grub-core/loader/i386/bsd.c (grub_netbsd_add_boot_disk_and_wedge): + New function. + (grub_cmd_netbsd): Call grub_netbsd_add_boot_disk_and_wedge. + 2011-09-28 Thomas Haller * grub-core/loader/multiboot_elfxx.c (Elf_Shdr): Set according to diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c index dffe48257..18ebeb760 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -946,6 +948,86 @@ grub_netbsd_add_modules (void) return err; } +/* + * Adds NetBSD bootinfo bootdisk and bootwedge. The partition identified + * in these bootinfo fields is the root device. + */ +static void +grub_netbsd_add_boot_disk_and_wedge (void) +{ + grub_device_t dev; + grub_disk_t disk; + grub_partition_t part; + grub_uint32_t biosdev; + grub_uint32_t partmapsector; + struct grub_partition_bsd_disk_label *label; + grub_uint64_t buf[GRUB_DISK_SECTOR_SIZE / 8]; + grub_uint8_t *hash; + grub_uint64_t ctx[(GRUB_MD_MD5->contextsize + 7) / 8]; + + dev = grub_device_open (0); + if (! (dev && dev->disk && dev->disk->partition)) + goto fail; + + disk = dev->disk; + part = disk->partition; + + if (disk->dev && disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) + biosdev = (grub_uint32_t) disk->id & 0xff; + else + biosdev = 0xff; + + /* Absolute sector of the partition map describing this partition. */ + partmapsector = grub_partition_get_start (part->parent) + part->offset; + + disk->partition = part->parent; + if (grub_disk_read (disk, part->offset, 0, GRUB_DISK_SECTOR_SIZE, buf) != GRUB_ERR_NONE) + goto fail; + disk->partition = part; + + /* Fill bootwedge. */ + { + struct grub_netbsd_btinfo_bootwedge biw; + + grub_memset (&biw, 0, sizeof (biw)); + biw.biosdev = biosdev; + biw.startblk = grub_partition_get_start (part); + biw.nblks = part->len; + biw.matchblk = partmapsector; + biw.matchnblks = 1; + + GRUB_MD_MD5->init (&ctx); + GRUB_MD_MD5->write (&ctx, buf, GRUB_DISK_SECTOR_SIZE); + GRUB_MD_MD5->final (&ctx); + hash = GRUB_MD_MD5->read (&ctx); + memcpy (biw.matchhash, hash, 16); + + grub_bsd_add_meta (NETBSD_BTINFO_BOOTWEDGE, &biw, sizeof (biw)); + } + + /* Fill bootdisk if this a NetBSD disk label. */ + label = (struct grub_partition_bsd_disk_label *) &buf; + if (part->partmap != NULL && + (grub_strcmp (part->partmap->name, "netbsd") == 0) && + label->magic == grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) + { + struct grub_netbsd_btinfo_bootdisk bid; + + grub_memset (&bid, 0, sizeof (bid)); + bid.labelsector = partmapsector; + bid.label.type = label->type; + bid.label.checksum = label->checksum; + memcpy (bid.label.packname, label->packname, 16); + bid.biosdev = biosdev; + bid.partition = part->number; + grub_bsd_add_meta (NETBSD_BTINFO_BOOTDISK, &bid, sizeof (bid)); + } + +fail: + if (dev) + grub_device_close (dev); +} + static grub_err_t grub_netbsd_boot (void) { @@ -1607,6 +1689,8 @@ grub_cmd_netbsd (grub_extcmd_context_t ctxt, int argc, char *argv[]) grub_bsd_add_meta (NETBSD_BTINFO_CONSOLE, &cons, sizeof (cons)); } + grub_netbsd_add_boot_disk_and_wedge (); + grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 0); } diff --git a/include/grub/bsdlabel.h b/include/grub/bsdlabel.h index 636bd41a1..b10336c01 100644 --- a/include/grub/bsdlabel.h +++ b/include/grub/bsdlabel.h @@ -80,7 +80,10 @@ struct grub_partition_bsd_entry struct grub_partition_bsd_disk_label { grub_uint32_t magic; - grub_uint8_t padding[128]; + grub_uint16_t type; + grub_uint8_t unused1[18]; + grub_uint8_t packname[16]; + grub_uint8_t unused2[92]; grub_uint32_t magic2; grub_uint16_t checksum; grub_uint16_t num_partitions; diff --git a/include/grub/i386/netbsd_bootinfo.h b/include/grub/i386/netbsd_bootinfo.h index fd429a251..228f26aaa 100644 --- a/include/grub/i386/netbsd_bootinfo.h +++ b/include/grub/i386/netbsd_bootinfo.h @@ -51,9 +51,11 @@ #define NETBSD_BTINFO_BOOTPATH 0 #define NETBSD_BTINFO_ROOTDEVICE 1 +#define NETBSD_BTINFO_BOOTDISK 3 #define NETBSD_BTINFO_CONSOLE 6 #define NETBSD_BTINFO_SYMTAB 8 #define NETBSD_BTINFO_MEMMAP 9 +#define NETBSD_BTINFO_BOOTWEDGE 10 #define NETBSD_BTINFO_MODULES 11 #define NETBSD_BTINFO_FRAMEBUF 12 @@ -83,6 +85,15 @@ struct grub_netbsd_btinfo_bootdisk grub_uint32_t partition; }; +struct grub_netbsd_btinfo_bootwedge { + grub_uint32_t biosdev; + grub_disk_addr_t startblk; + grub_uint64_t nblks; + grub_disk_addr_t matchblk; + grub_uint64_t matchnblks; + grub_uint8_t matchhash[16]; /* MD5 hash */ +} __packed; + struct grub_netbsd_btinfo_symtab { grub_uint32_t nsyms; From cca7ccd8ff3bd697110c8f55b9e30b78662235f8 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 29 Sep 2011 10:32:24 +0200 Subject: [PATCH 59/65] Remove extra declaration of sleep for mingw32. * util/misc.c (sleep) [__MINGW32__]: Removed. * include/grub/util/misc.h (sleep) [__MINGW32__]: Likewise. --- ChangeLog | 7 +++++++ include/grub/util/misc.h | 1 - util/misc.c | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8cdd158cd..6e4aac746 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-09-29 Mario Limonciello + + Remove extra declaration of sleep for mingw32. + + * util/misc.c (sleep) [__MINGW32__]: Removed. + * include/grub/util/misc.h (sleep) [__MINGW32__]: Likewise. + 2011-09-28 Grégoire Sutre * include/grub/bsdlabel.h (grub_partition_bsd_disk_label): Add fields diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index 48dfbb868..419c8661c 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -47,7 +47,6 @@ void grub_util_write_image_at (const void *img, size_t size, off_t offset, void sync (void); int fsync (int fno); -void sleep(int s); grub_int64_t grub_util_get_disk_size (char *name); diff --git a/util/misc.c b/util/misc.c index cfbae609b..e4425358a 100644 --- a/util/misc.c +++ b/util/misc.c @@ -316,11 +316,6 @@ int fsync (int fno __attribute__ ((unused))) return 0; } -void sleep (int s) -{ - Sleep (s * 1000); -} - grub_int64_t grub_util_get_disk_size (char *name) { From c05de0329b198bed24e8b8e120877958d9a8cead Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 29 Sep 2011 10:36:55 +0200 Subject: [PATCH 60/65] * grub-core/kern/emu/misc.c (canonicalize_file_name) [__MINGW32__]: Use _fullpath. --- ChangeLog | 5 +++++ grub-core/kern/emu/misc.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6e4aac746..bc5508d32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-29 Mario Limonciello + + * grub-core/kern/emu/misc.c (canonicalize_file_name) [__MINGW32__]: Use + _fullpath. + 2011-09-29 Mario Limonciello Remove extra declaration of sleep for mingw32. diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index 737f5f1a9..6f5ea9fb9 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -224,7 +224,11 @@ char * canonicalize_file_name (const char *path) { char *ret; -#ifdef PATH_MAX +#ifdef __MINGW32__ + ret = xmalloc (PATH_MAX); + if (!_fullpath (ret, path, PATH_MAX)) + return NULL; +#elif defined (PATH_MAX) ret = xmalloc (PATH_MAX); if (!realpath (path, ret)) return NULL; From d1ab689de800eb4a7d66306c96d9dd4f502cf4e5 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 29 Sep 2011 10:39:44 +0200 Subject: [PATCH 61/65] * util/misc.c (grub_util_get_disk_size) [__MINGW32__]: Strip trailing slashes on PHYSICALDRIVE%d paths when making Windows CreateFile calls. --- ChangeLog | 5 +++++ util/misc.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index bc5508d32..df31ef3e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-29 Mario Limonciello + + * util/misc.c (grub_util_get_disk_size) [__MINGW32__]: Strip trailing + slashes on PHYSICALDRIVE%d paths when making Windows CreateFile calls. + 2011-09-29 Mario Limonciello * grub-core/kern/emu/misc.c (canonicalize_file_name) [__MINGW32__]: Use diff --git a/util/misc.c b/util/misc.c index e4425358a..72bedde0c 100644 --- a/util/misc.c +++ b/util/misc.c @@ -55,6 +55,7 @@ #ifdef __MINGW32__ #include #include +#include "dirname.h" #endif #ifdef GRUB_UTIL @@ -322,6 +323,7 @@ grub_util_get_disk_size (char *name) HANDLE hd; grub_int64_t size = -1LL; + strip_trailing_slashes(name); hd = CreateFile (name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0); From fc5efcc08346469bb9f4bbb3c3f0b3f4b8c5b4b6 Mon Sep 17 00:00:00 2001 From: Mads Kiilerich Date: Thu, 29 Sep 2011 10:50:25 +0200 Subject: [PATCH 62/65] * grub-core/Makefile.core.def (kernel): Add kern/i386/int.S to extra_dist. --- ChangeLog | 5 +++++ grub-core/Makefile.core.def | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index df31ef3e3..db2e0b1f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-09-29 Mads Kiilerich + + * grub-core/Makefile.core.def (kernel): Add kern/i386/int.S to + extra_dist. + 2011-09-29 Mario Limonciello * util/misc.c (grub_util_get_disk_size) [__MINGW32__]: Strip trailing diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index e95d87d37..e9e4f06d8 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -219,6 +219,7 @@ kernel = { videoinkernel = commands/boot.c; + extra_dist = kern/i386/int.S; extra_dist = kern/i386/realmode.S; extra_dist = kern/i386/pc/lzma_decode.S; extra_dist = kern/mips/cache_flush.S; From 8667a314babe5f09580d06d86a3db6489cdcc31e Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Fri, 30 Sep 2011 18:49:37 -0700 Subject: [PATCH 63/65] * gentpl.py: Use Autogen macros so that the output template file (Makefile.tpl) size is reduced. --- ChangeLog | 5 +++ gentpl.py | 114 +++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 105 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index db2e0b1f6..ad0e6792f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-25 BVK Chaitanya + + * gentpl.py: Use Autogen macros so that the output template file + (Makefile.tpl) size is reduced. + 2011-09-29 Mads Kiilerich * grub-core/Makefile.core.def (kernel): Add kern/i386/int.S to diff --git a/gentpl.py b/gentpl.py index e431293eb..cb6b663d9 100644 --- a/gentpl.py +++ b/gentpl.py @@ -183,6 +183,17 @@ def foreach_platform_specific_value(platform, suffix, nonetag, closure): r += "[+ ELSE +][+ FOR " + nonetag + " +]" + closure("[+ ." + nonetag + " +]") + "[+ ENDFOR +][+ ENDIF +]" return r +# +# Returns autogen code that defines an autogen macro using the +# definition given in the 'snippet'. +# +def define_autogen_macro(name, snippet): + r = "" + r += "[+ DEFINE " + name + " +]" + r += snippet + r += "[+ ENDDEF +]\n" + return r + # # Template for handling values from sum of all groups for a platform, # for example: @@ -245,10 +256,18 @@ def foreach_enabled_platform(closure): # emu_condition = COND_GRUB_EMU_USB; # }; # +def define_macro_for_platform_conditionals_if_statement(p): + return define_autogen_macro( + "if_" + p + "_conditionals", + foreach_platform_specific_value(platform, "_condition", "condition", lambda cond: "if " + cond + "\n")) +def define_macro_for_platform_conditionals_endif_statement(p): + return define_autogen_macro( + "endif_" + p + "_conditionals", + foreach_platform_specific_value(platform, "_condition", "condition", lambda cond: "endif " + cond + "\n")) def under_platform_specific_conditionals(platform, snippet): - r = foreach_platform_specific_value(platform, "_condition", "condition", lambda cond: "if " + cond + "\n") + r = "[+ if_" + platform + "_conditionals +]" r += snippet - r += foreach_platform_specific_value(platform, "_condition", "condition", lambda cond: "endif " + cond + "\n") + r += "[+ endif_" + platform + "_conditionals +]" return r def platform_specific_values(platform, suffix, nonetag): @@ -261,18 +280,69 @@ def platform_values(platform, suffix): def extra_dist(): return foreach_value("extra_dist", lambda value: value + " ") -def platform_sources(p): return platform_values(p, "") -def platform_nodist_sources(p): return platform_values(p, "_nodist") -def platform_dependencies(p): return platform_values(p, "dependencies", "_dependencies") +def define_macro_for_platform_sources(p): + return define_autogen_macro( + "get_" + p + "_sources", + platform_values(p, "")) +def define_macro_for_platform_nodist_sources(p): + return define_autogen_macro( + "get_" + p + "_nodist_sources", + platform_values(p, "_nodist")) +def define_macro_for_platform_dependencies(p): + return define_autogen_macro( + "get_" + p + "_dependencies", + platform_values(p, "dependencies", "_dependencies")) +def platform_sources(p): return "[+ get_" + p + "_sources +]" +def platform_nodist_sources(p): return "[+ get_" + p + "_nodist_sources +]" +def platform_dependencies(p): return "[+ get_" + p + "_dependencies +]" -def platform_startup(p): return platform_specific_values(p, "_startup", "startup") -def platform_ldadd(p): return platform_specific_values(p, "_ldadd", "ldadd") -def platform_cflags(p): return platform_specific_values(p, "_cflags", "cflags") -def platform_ldflags(p): return platform_specific_values(p, "_ldflags", "ldflags") -def platform_cppflags(p): return platform_specific_values(p, "_cppflags", "cppflags") -def platform_ccasflags(p): return platform_specific_values(p, "_ccasflags", "ccasflags") -def platform_stripflags(p): return platform_specific_values(p, "_stripflags", "stripflags") -def platform_objcopyflags(p): return platform_specific_values(p, "_objcopyflags", "objcopyflags") +# +# Returns Autogen code which defines the autogen macros that collect +# platform specific values for cflags, ldflags, etc. tags. +# +def define_macro_for_platform_startup(p): + return define_autogen_macro( + "get_" + p + "_startup", + platform_specific_values(p, "_startup", "startup")) +def define_macro_for_platform_cflags(p): + return define_autogen_macro( + "get_" + p + "_cflags", + platform_specific_values(p, "_cflags", "cflags")) +def define_macro_for_platform_ldadd(p): + return define_autogen_macro( + "get_" + p + "_ldadd", + platform_specific_values(p, "_ldadd", "ldadd")) +def define_macro_for_platform_ldflags(p): + return define_autogen_macro( + "get_" + p + "_ldflags", + platform_specific_values(p, "_ldflags", "ldflags")) +def define_macro_for_platform_cppflags(p): + return define_autogen_macro( + "get_" + p + "_cppflags", + platform_specific_values(p, "_cppflags", "cppflags")) +def define_macro_for_platform_ccasflags(p): + return define_autogen_macro( + "get_" + p + "_ccasflags", + platform_specific_values(p, "_ccasflags", "ccasflags")) +def define_macro_for_platform_stripflags(p): + return define_autogen_macro( + "get_" + p + "_stripflags", + platform_specific_values(p, "_stripflags", "stripflags")) +def define_macro_for_platform_objcopyflags(p): + return define_autogen_macro( + "get_" + p + "_objcopyflags", + platform_specific_values(p, "_objcopyflags", "objcopyflags")) +# +# Autogen calls to invoke the above macros. +# +def platform_startup(p): return "[+ get_" + p + "_startup +]" +def platform_ldadd(p): return "[+ get_" + p + "_ldadd +]" +def platform_cflags(p): return "[+ get_" + p + "_cflags +]" +def platform_ldflags(p): return "[+ get_" + p + "_ldflags +]" +def platform_cppflags(p): return "[+ get_" + p + "_cppflags +]" +def platform_ccasflags(p): return "[+ get_" + p + "_ccasflags +]" +def platform_stripflags(p): return "[+ get_" + p + "_stripflags +]" +def platform_objcopyflags(p): return "[+ get_" + p + "_objcopyflags +]" # # Emit snippet only the first time through for the current name. @@ -489,7 +559,6 @@ def script_rules(): def data_rules(): return rules("data", data) -print "[+ AutoGen5 template +]\n" a = module_rules() b = kernel_rules() c = image_rules() @@ -499,6 +568,23 @@ f = script_rules() g = data_rules() z = global_variable_initializers() +print "[+ AutoGen5 template +]\n" +for p in GRUB_PLATFORMS: + print define_macro_for_platform_sources(p) + print define_macro_for_platform_nodist_sources(p) + # print define_macro_for_platform_dependencies(p) + + print define_macro_for_platform_startup(p) + print define_macro_for_platform_cflags(p) + print define_macro_for_platform_ldadd(p) + print define_macro_for_platform_ldflags(p) + print define_macro_for_platform_cppflags(p) + print define_macro_for_platform_ccasflags(p) + print define_macro_for_platform_stripflags(p) + print define_macro_for_platform_objcopyflags(p) + + print define_macro_for_platform_conditionals_if_statement(p) + print define_macro_for_platform_conditionals_endif_statement(p) # print z # initializer for all vars print a print b From ce79cc99d500a92c927a15647d0c86bde6d0448c Mon Sep 17 00:00:00 2001 From: starous Date: Sat, 1 Oct 2011 21:27:29 +0200 Subject: [PATCH 64/65] @Rock changes - fixed coreboot problem --- ChangeLog | 5 +++++ grub-core/bus/usb/uhci.c | 48 +++++++++++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad0e6792f..5d1fc0c69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-10-01 Ales Nesrsta + + * grub-core/bus/usb/uhci.c: Changes made by Rock Cui - thanks! + (fixed problem related to using UHCI with coreboot). + 2011-08-25 BVK Chaitanya * gentpl.py: Use Autogen macros so that the output template file diff --git a/grub-core/bus/usb/uhci.c b/grub-core/bus/usb/uhci.c index 99e597f6d..260b7e876 100644 --- a/grub-core/bus/usb/uhci.c +++ b/grub-core/bus/usb/uhci.c @@ -36,11 +36,33 @@ GRUB_MOD_LICENSE ("GPLv3+"); typedef enum { GRUB_UHCI_REG_USBCMD = 0x00, + GRUB_UHCI_REG_USBINTR = 0x04, GRUB_UHCI_REG_FLBASEADD = 0x08, GRUB_UHCI_REG_PORTSC1 = 0x10, - GRUB_UHCI_REG_PORTSC2 = 0x12 + GRUB_UHCI_REG_PORTSC2 = 0x12, + GRUB_UHCI_REG_USBLEGSUP = 0xc0 } grub_uhci_reg_t; +/* R/WC legacy support bits */ +#define GRUB_UHCI_LEGSUP_END_A20GATE (1 << 15) +#define GRUB_UHCI_TRAP_BY_64H_WSTAT (1 << 11) +#define GRUB_UHCI_TRAP_BY_64H_RSTAT (1 << 10) +#define GRUB_UHCI_TRAP_BY_60H_WSTAT (1 << 9) +#define GRUB_UHCI_TRAP_BY_60H_RSTAT (1 << 8) + +/* Reset all legacy support - clear all R/WC bits and all R/W bits */ +#define GRUB_UHCI_RESET_LEGSUP_SMI ( GRUB_UHCI_LEGSUP_END_A20GATE \ + | GRUB_UHCI_TRAP_BY_64H_WSTAT \ + | GRUB_UHCI_TRAP_BY_64H_RSTAT \ + | GRUB_UHCI_TRAP_BY_60H_WSTAT \ + | GRUB_UHCI_TRAP_BY_60H_RSTAT ) + +/* Some UHCI commands */ +#define GRUB_UHCI_CMD_RUN_STOP (1 << 0) +#define GRUB_UHCI_CMD_HCRESET (1 << 1) +#define GRUB_UHCI_CMD_MAXP (1 << 7) + +/* Important bits in structures */ #define GRUB_UHCI_LINK_TERMINATE 1 #define GRUB_UHCI_LINK_QUEUE_HEAD 2 @@ -181,6 +203,11 @@ grub_uhci_pci_iter (grub_pci_device_t dev, if (class != 0x0c || subclass != 0x03 || interf != 0x00) return 0; + /* Set bus master - needed for coreboot or broken BIOSes */ + addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND); + grub_pci_write_word(addr, + GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr)); + /* Determine IO base address. */ addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG4); base = grub_pci_read (addr); @@ -195,6 +222,19 @@ grub_uhci_pci_iter (grub_pci_device_t dev, u->iobase = base & GRUB_UHCI_IOMASK; + /* Reset PIRQ and SMI */ + addr = grub_pci_make_address (dev, GRUB_UHCI_REG_USBLEGSUP); + grub_pci_write_word(addr, GRUB_UHCI_RESET_LEGSUP_SMI); + /* Reset the HC */ + grub_uhci_writereg16(u, GRUB_UHCI_REG_USBCMD, GRUB_UHCI_CMD_HCRESET); + grub_millisleep(5); + /* Disable interrupts and commands (just to be safe) */ + grub_uhci_writereg16(u, GRUB_UHCI_REG_USBINTR, 0); + /* Finish HC reset, HC remains disabled */ + grub_uhci_writereg16(u, GRUB_UHCI_REG_USBCMD, 0); + /* Read back to be sure PCI write is done */ + grub_uhci_readreg16(u, GRUB_UHCI_REG_USBCMD); + /* Reserve a page for the frame list. */ u->framelist = grub_memalign (4096, 4096); if (! u->framelist) @@ -252,9 +292,6 @@ grub_uhci_pci_iter (grub_pci_device_t dev, u->td[N_TD - 2].linkptr = 0; u->tdfree = u->td; - /* Make sure UHCI is disabled! */ - grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, 0); - /* Setup the frame list pointers. Since no isochronous transfers are and will be supported, they all point to the (same!) queue head. */ @@ -285,7 +322,8 @@ grub_uhci_pci_iter (grub_pci_device_t dev, u->qh[N_QH - 1].linkptr = 1; /* Enable UHCI again. */ - grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, 1 | (1 << 7)); + grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, + GRUB_UHCI_CMD_RUN_STOP | GRUB_UHCI_CMD_MAXP); /* UHCI is initialized and ready for transfers. */ grub_dprintf ("uhci", "UHCI initialized\n"); From fe942b7dbb891a3f092acdb63a63ee0376cb5cba Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 5 Oct 2011 11:53:36 +0200 Subject: [PATCH 65/65] * grub-core/Makefile.core.def: Eliminate rarely used emu_condition. This in perspective decreases the complexity of build system and fixes compilation right now. --- grub-core/Makefile.core.def | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index e9e4f06d8..3b701633c 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -400,11 +400,15 @@ module = { module = { name = usb; common = bus/usb/usb.c; - noemu = bus/usb/usbtrans.c; - noemu = bus/usb/usbhub.c; - enable = emu; + common = bus/usb/usbtrans.c; + common = bus/usb/usbhub.c; enable = usb; - emu_condition = COND_GRUB_EMU_USB; +}; + +module = { + name = emuusb; + common = bus/usb/usb.c; + condition = COND_GRUB_EMU_USB; }; module = { @@ -439,18 +443,22 @@ module = { module = { name = pci; - noemu = bus/pci.c; - emu = bus/emu/pci.c; - emu = commands/lspci.c; + common = bus/pci.c; - enable = emu; enable = i386_pc; enable = i386_efi; enable = x86_64_efi; enable = i386_ieee1275; enable = i386_coreboot; enable = i386_multiboot; - emu_condition = COND_GRUB_EMU_PCI; +}; + +module = { + name = emupci; + common = bus/emu/pci.c; + common = commands/lspci.c; + + condition = COND_GRUB_EMU_PCI; }; module = { @@ -788,8 +796,6 @@ module = { name = usbtest; common = commands/usbtest.c; enable = usb; - enable = emu; - emu_condition = COND_GRUB_EMU_USB; }; module = { @@ -903,8 +909,6 @@ module = { name = usbms; common = disk/usbms.c; enable = usb; - enable = emu; - emu_condition = COND_GRUB_EMU_USB; }; module = { @@ -1446,9 +1450,7 @@ module = { common = term/serial.c; x86 = term/ns8250.c; - enable = emu; enable = x86; - emu_condition = COND_GRUB_EMU_USB; }; module = {