diff --git a/.gitignore b/.gitignore index ec536004c..5a9cce919 100644 --- a/.gitignore +++ b/.gitignore @@ -247,3 +247,4 @@ build-aux/test-driver /garbage-gen /garbage-gen.exe /grub-fs-tester +grub-core/build-grub-module-verifier diff --git a/Makefile.am b/Makefile.am index 994ebbd39..00a9663b3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,16 +89,21 @@ CLEANFILES += build-grub-gen-widthspec$(BUILD_EXEEXT) if COND_STARFIELD starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files) -dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE) -dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE) -dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE) -dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE) -dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE) +dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 10 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_10.pf2 +dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 12 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_12.pf2 +dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 14 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_14.pf2 +dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -b -s 14 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_bold_14.pf2 +dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -s 16 -o $@ $(DJVU_FONT_SOURCE) +CLEANFILES += dejavu_16.pf2 else starfield_DATA = endif @@ -106,28 +111,28 @@ endif EXTRA_DIST += $(starfield_theme_files) EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf -unicode.pf2: $(FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) +unicode.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) || (rm -f $@; exit 1) CLEANFILES += unicode.pf2 # Arrows and lines are needed to draw the menu, so always include them UNICODE_ARROWS=0x2190-0x2193 UNICODE_LINES=0x2501-0x251B -ascii.pf2: $(FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) +ascii.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) CLEANFILES += ascii.pf2 -euro.pf2: $(FONT_SOURCE) build-grub-mkfont - ./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) +euro.pf2: $(FONT_SOURCE) build-grub-mkfont$(BUILD_EXEEXT) + ./build-grub-mkfont$(BUILD_EXEEXT) -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES) || (rm -f $@; exit 1) CLEANFILES += euro.pf2 -ascii.h: $(FONT_SOURCE) build-grub-gen-asciih - ./build-grub-gen-asciih $(FONT_SOURCE) $@ || (rm -f $@; exit 1) +ascii.h: $(FONT_SOURCE) build-grub-gen-asciih$(BUILD_EXEEXT) + ./build-grub-gen-asciih$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) CLEANFILES += ascii.h -widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec - ./build-grub-gen-widthspec $(FONT_SOURCE) $@ || (rm -f $@; exit 1) +widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec$(BUILD_EXEEXT) + ./build-grub-gen-widthspec$(BUILD_EXEEXT) $(FONT_SOURCE) $@ || (rm -f $@; exit 1) CLEANFILES += widthspec.h # Install config.h into platformdir @@ -340,33 +345,35 @@ bootcheck-ntldr: ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg grub-shell ./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null if COND_i386_efi -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 +# NetBSD has no support for finding ACPI on EFI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 endif if COND_x86_64_efi -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 +# NetBSD has no support for finding ACPI on EFI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 endif if COND_i386_multiboot -# FreeBSD requires ACPI -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 +# *BSD requires ACPI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 +endif + + +if COND_i386_qemu +# *BSD requires ACPI +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 endif if COND_i386_coreboot -# Freebsd requires ACPI -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 -endif - -if COND_i386_qemu -# FreeBSD requires ACPI -BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 +BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 endif if COND_i386_pc #pc chainloader by definition is only for i386-pc #ntldr and bootmgr require BIOS. -#legacy protocol makes early BIOS calls. -# NetBSD crashes early on non-BIOS +#legacy protocol (linux16) makes early BIOS calls. +# 32-bit NetBSD crashes early on non-BIOS BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386 bootcheck-pc-chainloader bootcheck-ntldr bootcheck-linux16-i386 bootcheck-linux16-x86_64 bootcheck-knetbsd-i386 endif @@ -402,8 +409,9 @@ BOOTCHECK_TIMEOUT=180 bootcheck: $(BOOTCHECKS) if COND_i386_coreboot -default_payload.elf: grub-mkstandalone grub-mkimage - pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg +default_payload.elf: grub-mkstandalone grub-mkimage FORCE + test -f $@ && rm $@ || true + pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg endif endif diff --git a/Makefile.util.def b/Makefile.util.def index 691fb30d5..4b1b4c410 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -172,6 +172,8 @@ program = { common = util/grub-mkimage.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/resolve.c; common = grub-core/kern/emu/argp_common.c; common = grub-core/osdep/init.c; @@ -414,7 +416,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)'; }; data = { @@ -510,6 +512,8 @@ program = { common = util/render-label.c; common = util/glue-efi.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; @@ -552,6 +556,8 @@ program = { common = util/render-label.c; common = util/glue-efi.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; @@ -595,6 +601,8 @@ program = { common = util/grub-install.c; common = util/probe.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; @@ -632,6 +640,8 @@ program = { common = util/grub-mknetdir.c; common = util/mkimage.c; + common = util/grub-mkimage32.c; + common = util/grub-mkimage64.c; common = util/grub-install-common.c; common = util/setup_bios.c; common = util/setup_sparc.c; diff --git a/NEWS b/NEWS index c9a975219..2ebd54e78 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ New in 2.02: * ZFS features support. * ZFS LZ4 support. * XFS V5 format support. + * LVM RAID1 support. * New/improved terminal and video support: * Monochrome text (matching `hercules' in GRUB Legacy). @@ -49,6 +50,9 @@ New in 2.02: * Improve TFTP robustness. * Parse `nd' disk names in GRUB Legacy configuration files. * Issue separate DNS queries for IPv4 and IPv6. + * Support IPv6 Router Advertisement to configure default router. + * New variable net__next_server containing next server + from BOOTP reply. * Coreboot improvements: * CBFS support both in on-disk images (loopback) and flash. @@ -96,6 +100,8 @@ New in 2.02: EFI Stall. If everything fails, use hardcoded frequency 800MHz. * Support Hyper-V Gen2 platforms which lack PIT for TSC calibration. * Map UEFI Persistent Memory to E820 persistent memory. + * New Xen loader on ARM64. + * Respect alignment requirement for block device IO buffers on EFI. * Security: * Add optional facility to enforce that all files read by the core image @@ -134,6 +140,11 @@ New in 2.02: menu entry immediately. * New `file' command and grub-file utility to check file types. * New syslinux configuration file parser. + * Set menu entry class to primary OS name returned by os-prober to display + OS specific icon. + * On Linux x86 detect EFI word size in grub-install and automatically select + correct platform (x86_64-efi or i386-efi) to install. Requires Linux kernel + 4.0 or higher. * Build system: * Remove all uses of nested functions; GRUB no longer requires an @@ -160,6 +171,9 @@ New in 2.02: * emu libusb support removed (was broken and unmaintained). * powerpc64le compile support. * Use fixed timestamp when generating GRUB image for reproducible builds. + * Verify at build time that modules contain only supported relocations and their + structure matches what boot-time module loader expects. + * Do not require fonts on powerpc-ieee1275. * Revision control moved to git. diff --git a/TODO b/TODO index 6ec1521cd..a9b6d3523 100644 --- a/TODO +++ b/TODO @@ -7,7 +7,3 @@ glance. So write to first. For bug tracking, refer to: http://savannah.gnu.org/bugs/?group=grub - -Our wiki also lists some areas that need work: - - http://grub.enbug.org/ diff --git a/acinclude.m4 b/acinclude.m4 index 526f97a3a..7884c1bb5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -390,6 +390,24 @@ else [fi] ]) +dnl Check if the Linker supports `-no-pie'. +AC_DEFUN([grub_CHECK_NO_PIE], +[AC_MSG_CHECKING([whether linker accepts -no-pie]) +AC_CACHE_VAL(grub_cv_cc_ld_no_pie, +[save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -no-pie" +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_ld_no_pie=yes], + [grub_cv_cc_ld_no_pie=no]) +LDFLAGS="$save_LDFLAGS" +]) +AC_MSG_RESULT([$grub_cv_cc_ld_no_pie]) +nopie_possible=no +if test "x$grub_cv_cc_ld_no_pie" = xyes ; then + nopie_possible=yes +fi +]) + dnl Check if the C compiler supports `-fPIC'. AC_DEFUN([grub_CHECK_PIC],[ [# Position independent executable. diff --git a/asm-tests/i386-pc.S b/asm-tests/i386-pc.S index f6f9a88be..d037744f9 100644 --- a/asm-tests/i386-pc.S +++ b/asm-tests/i386-pc.S @@ -1,12 +1,16 @@ /* on x86 old clang doesn't support .code16 newer clang supports it but creates 6-byte jumps instead of 3-byte ones - which makes us go over boot sector size. */ + which makes us go over boot sector size. + Starting with 3.9 clang emits 3-byte jumps but still creates 8-bytes movl + instead of 5-bytes, so code overflows into data. */ .code16 jmp far .org 4 jmp nearer .org 6 + movl nearer, %ebx + .org 11 .space 100 nearer: .space 200 diff --git a/conf/Makefile.common b/conf/Makefile.common index 5083d5f1e..11296b550 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -38,7 +38,7 @@ CFLAGS_KERNEL = $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_KERNEL = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM) -STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags +STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version -R .MIPS.abiflags -R .ARM.exidx CFLAGS_MODULE = $(CFLAGS_PLATFORM) -ffreestanding LDFLAGS_MODULE = $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 9dd64fdca..b16bd9253 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -50,8 +50,13 @@ EXTRA_DIST += util/import_gcrypth.sed EXTRA_DIST += util/bin2h.c EXTRA_DIST += util/grub-gen-asciih.c EXTRA_DIST += util/grub-gen-widthspec.c +EXTRA_DIST += util/grub-module-verifier.c +EXTRA_DIST += util/grub-module-verifier32.c +EXTRA_DIST += util/grub-module-verifier64.c +EXTRA_DIST += util/grub-module-verifierXX.c EXTRA_DIST += util/grub-pe2elf.c + EXTRA_DIST += m4/gnulib-cache.m4 EXTRA_DIST += m4/glibc2.m4 EXTRA_DIST += m4/gnulib-tool.m4 diff --git a/configure.ac b/configure.ac index 3300545e0..4e980c5fe 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as BUILD_CC, BUILD_CFLAGS, etc.) for the build type and variables dnl with the prefix "TARGET_" (such as TARGET_CC, TARGET_CFLAGS, etc.) are dnl used for the target type. See INSTALL for full list of variables. -AC_INIT([GRUB],[2.02~beta2],[bug-grub@gnu.org]) +AC_INIT([GRUB],[2.02~beta3],[bug-grub@gnu.org]) AC_CONFIG_AUX_DIR([build-aux]) @@ -388,7 +388,15 @@ fi # Check for functions and headers. AC_CHECK_FUNCS(posix_memalign memalign getextmntent) -AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h) +AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h) + +# glibc 2.25 still includes sys/sysmacros.h in sys/types.h but emits deprecation +# warning which causes compilation failure later with -Werror. So use -Werror here +# as well to force proper sys/sysmacros.h detection. +SAVED_CFLAGS="$CFLAGS" +CFLAGS="$HOST_CFLAGS -Werror" +AC_HEADER_MAJOR +CFLAGS="$SAVED_CFLAGS" AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default #include @@ -910,12 +918,24 @@ if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xy TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions" fi +AC_CACHE_CHECK([whether -mno-stack-arg-probe works], [grub_cv_cc_mno_stack_arg_probe], [ + CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_mno_stack_arg_probe=yes], + [grub_cv_cc_mno_stack_arg_probe=no]) +]) + +if test "x$grub_cv_cc_mno_stack_arg_probe" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" +fi + + # By default, GCC 4.6 generates .eh_frame sections containing unwind # information in some cases where it previously did not. GRUB doesn't need # these and they just use up vital space. Restore the old compiler # behaviour. AC_CACHE_CHECK([whether -fno-asynchronous-unwind-tables works], [grub_cv_cc_fno_asynchronous_unwind_tables], [ - CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" + CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_fno_asynchronous_unwind_tables=yes], [grub_cv_cc_fno_asynchronous_unwind_tables=no]) @@ -925,66 +945,17 @@ if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" fi -AC_ARG_ENABLE([efiemu], - [AS_HELP_STRING([--enable-efiemu], - [build and install the efiemu runtimes (default=guessed)])]) -if test x"$enable_efiemu" = xno ; then - efiemu_excuse="explicitly disabled" +AC_CACHE_CHECK([whether -fno-unwind-tables works], [grub_cv_cc_fno_unwind_tables], [ + CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_fno_unwind_tables=yes], + [grub_cv_cc_fno_unwind_tables=no]) +]) + +if test "x$grub_cv_cc_fno_unwind_tables" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-unwind-tables" fi -if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then - efiemu_excuse="not available on cygwin" -fi -if test x"$target_cpu" != xi386 ; then - efiemu_excuse="only available on i386" -fi -if test x"$platform" = xefi ; then - efiemu_excuse="not available on efi" -fi -if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ - CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], - [grub_cv_cc_efiemu=yes], - [grub_cv_cc_efiemu=no]) - ]) - if test x$grub_cv_cc_efiemu = xno; then - efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" - fi -fi -if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [ - grub_cv_target_cc_efiemu64_link_format=unknown - for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do - CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" - LDFLAGS="-m64 -Wl,$format -nostdlib -static" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - asm (".globl start; start:"); - asm (".globl _start; _start:"); - asm (".globl __start; __start:"); - void __main (void); - void __main (void) {} - ]], [[]])], [flag=1], [flag=0]) - if test x"$flag" = x1; then - grub_cv_target_cc_efiemu64_link_format="$format" - break - fi - done]) - if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then - efiemu_excuse="no suitable link format for efiemu64 found" - else - EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format" - fi -fi -if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then - AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)]) -fi -if test x"$efiemu_excuse" = x ; then -enable_efiemu=yes -else -enable_efiemu=no -fi -AC_SUBST([enable_efiemu]) -AC_SUBST([EFIEMU64_LINK_FORMAT]) + CFLAGS="$TARGET_CFLAGS" @@ -1078,6 +1049,73 @@ else TARGET_IMG_CFLAGS= fi +CFLAGS="$TARGET_CFLAGS" + +AC_ARG_ENABLE([efiemu], + [AS_HELP_STRING([--enable-efiemu], + [build and install the efiemu runtimes (default=guessed)])]) +if test x"$enable_efiemu" = xno ; then + efiemu_excuse="explicitly disabled" +fi + +if test x"$grub_cv_target_cc_link_format" = x-mi386pe || test x"$grub_cv_target_cc_link_format" = x-mi386pep ; then + efiemu_excuse="not available on cygwin" +fi +if test x"$target_cpu" != xi386 ; then + efiemu_excuse="only available on i386" +fi +if test x"$platform" = xefi ; then + efiemu_excuse="not available on efi" +fi + +if test x"$efiemu_excuse" = x ; then + AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ + CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_efiemu=yes], + [grub_cv_cc_efiemu=no]) + ]) + if test x$grub_cv_cc_efiemu = xno; then + efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" + fi +fi +if test x"$efiemu_excuse" = x ; then + AC_CACHE_CHECK([for efiemu64 linking format], [grub_cv_target_cc_efiemu64_link_format], [ + grub_cv_target_cc_efiemu64_link_format=unknown + for format in -melf_x86_64 -melf_x86_64_fbsd -melf_x86_64_obsd -melf_x86_64_haiku -arch,x86_64; do + CFLAGS="-m64 -nostdlib -O2 -mcmodel=large -mno-red-zone" + LDFLAGS="-m64 -Wl,$format -nostdlib -static" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + asm (".globl start; start:"); + asm (".globl _start; _start:"); + asm (".globl __start; __start:"); + void __main (void); + void __main (void) {} + ]], [[]])], [flag=1], [flag=0]) + if test x"$flag" = x1; then + grub_cv_target_cc_efiemu64_link_format="$format" + break + fi + done]) + if test x"$grub_cv_target_cc_efiemu64_link_format" = xunknown; then + efiemu_excuse="no suitable link format for efiemu64 found" + else + EFIEMU64_LINK_FORMAT="-Wl,$grub_cv_target_cc_efiemu64_link_format" + fi +fi +if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then + AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled ($efiemu_excuse)]) +fi +if test x"$efiemu_excuse" = x ; then +enable_efiemu=yes +else +enable_efiemu=no +fi +AC_SUBST([enable_efiemu]) +AC_SUBST([EFIEMU64_LINK_FORMAT]) + +CFLAGS="$TARGET_CFLAGS" + AC_SUBST(TARGET_LDFLAGS_OLDMAGIC) @@ -1154,13 +1192,18 @@ CFLAGS="$TARGET_CFLAGS" # Position independent executable. grub_CHECK_PIE +grub_CHECK_NO_PIE [# Need that, because some distributions ship compilers that include -# `-fPIE' in the default specs. +# `-fPIE' or '-fpie' and '-pie' in the default specs. if [ x"$pie_possible" = xyes ]; then - TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" + TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie" +fi +if [ x"$nopie_possible" = xyes ] && [ x"$pie_possible" = xyes ]; then + TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie" fi] CFLAGS="$TARGET_CFLAGS" +LDFLAGS="$TARGET_LDFLAGS" # Position independent executable. grub_CHECK_PIC @@ -1524,11 +1567,11 @@ if test x"$grub_build_mkfont_excuse" = x ; then else enable_build_grub_mkfont=no fi -if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then +if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then if test x"$grub_build_mkfont_excuse" = x ; then - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont]) else - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports needs build-time grub-mkfont ($grub_build_mkfont_excuse)]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need build-time grub-mkfont ($grub_build_mkfont_excuse)]) fi fi @@ -1598,11 +1641,11 @@ if test x"$enable_build_grub_mkfont" = xno ; then FONT_SOURCE= fi -if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 || test "x$platform" = xcoreboot ); then +if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$platform" = xcoreboot ); then if test x"$grub_build_mkfont_excuse" = x ; then - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont]) else - AC_MSG_ERROR([qemu, powerpc-ieee1275, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) + AC_MSG_ERROR([qemu, coreboot and loongson ports need unifont ($grub_build_mkfont_excuse)]) fi fi diff --git a/docs/grub.texi b/docs/grub.texi index 0f6c6f5a7..1177b0726 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -2446,6 +2446,10 @@ The boot file name provided by DHCP. Read-only. The name of the DHCP server responsible for these boot parameters. Read-only. +@item net_@var{}_next_server +The IP address of the next (usually, TFTP) server provided by DHCP. +Read-only. + @item net_default_interface Initially set to name of network interface that was used to load grub. Read-write, although setting it affects only interpretation of @@ -2538,6 +2542,8 @@ team are: 85:3 @item Asus EeePC 1005PE 84:1 (unconfirmed) +@item LENOVO ThinkPad T410s (2912W1C) +101:3 @end table To take full advantage of this function, install GRUB into the MBR @@ -3060,6 +3066,7 @@ These variables have special meaning to GRUB. * net_@var{}_hostname:: * net_@var{}_ip:: * net_@var{}_mac:: +* net_@var{}_next_server:: * net_@var{}_rootpath:: * net_default_interface:: * net_default_ip:: @@ -3420,6 +3427,12 @@ The default is the value of @samp{color_normal} (@pxref{color_normal}). @xref{Network}. +@node net_@var{}_next_server +@subsection net_@var{}_next_server + +@xref{Network}. + + @node net_@var{}_rootpath @subsection net_@var{}_rootpath @@ -4074,12 +4087,15 @@ after @command{configfile} returns. @node cpuid @subsection cpuid -@deffn Command cpuid [-l] +@deffn Command cpuid [-l] [-p] Check for CPU features. This command is only available on x86 systems. With the @option{-l} option, return true if the CPU supports long mode (64-bit). +With the @option{-p} option, return true if the CPU supports Physical +Address Extension (PAE). + If invoked without options, this command currently behaves as if it had been invoked with @option{-l}. This may change in the future. @end deffn @@ -5111,6 +5127,8 @@ the length of @var{string} is zero @var{expression} is false @item @var{expression1} @code{-a} @var{expression2} both @var{expression1} and @var{expression2} are true +@item @var{expression1} @var{expression2} +both @var{expression1} and @var{expression2} are true. This syntax is not POSIX-compliant and is not recommended. @item @var{expression1} @code{-o} @var{expression2} either @var{expression1} or @var{expression2} is true @end table diff --git a/gentpl.py b/gentpl.py index 76971d3ce..f08bcc404 100644 --- a/gentpl.py +++ b/gentpl.py @@ -729,9 +729,11 @@ def kernel(defn, platform): """if test x$(TARGET_APPLE_LINKER) = x1; then \ $(TARGET_STRIP) -S -x $(""" + cname(defn) + """) -o $@.bin $<; \ $(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -ed2016 -wd1106 -nu -nd $@.bin $@; \ + rm -f $@.bin; \ elif test ! -z '$(TARGET_OBJ2ELF)'; then \ """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@.bin $< && \ $(TARGET_OBJ2ELF) $@.bin $@ || (rm -f $@; rm -f $@.bin; exit 1); \ + rm -f $@.bin; \ else """ + "$(TARGET_STRIP) $(" + cname(defn) + "_STRIPFLAGS) -o $@ $<; \ fi""")) @@ -759,7 +761,7 @@ def image(defn, platform): if test x$(TARGET_APPLE_LINKER) = x1; then \ $(MACHO2IMG) $< $@; \ else \ - $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \ + $(TARGET_OBJCOPY) $(""" + cname(defn) + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R .ARM.exidx $< $@; \ fi """) diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index d50d28f5d..23ce9e9fb 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -39,6 +39,10 @@ gentrigtables$(BUILD_EXEEXT): gentrigtables.c $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) $< $(BUILD_LIBM) CLEANFILES += gentrigtables$(BUILD_EXEEXT) +build-grub-module-verifier$(BUILD_EXEEXT): $(top_srcdir)/util/grub-module-verifier.c $(top_srcdir)/util/grub-module-verifier32.c $(top_srcdir)/util/grub-module-verifier64.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c + $(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $(BUILD_LDFLAGS) -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-module-verifier\" $^ +CLEANFILES += build-grub-module-verifier$(BUILD_EXEEXT) + # trigtables.c trigtables.c: gentrigtables$(BUILD_EXEEXT) gentrigtables.c $(top_srcdir)/configure.ac ./gentrigtables$(BUILD_EXEEXT) > $@ @@ -104,6 +108,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h endif if COND_i386_coreboot @@ -159,6 +164,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h +KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h endif if COND_ia64_efi @@ -391,7 +397,7 @@ moddep.lst: syminfo.lst genmoddep.awk video.lst platform_DATA += moddep.lst CLEANFILES += config.log syminfo.lst moddep.lst -$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) +$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT) build-grub-module-verifier$(BUILD_EXEEXT) TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@ platform_DATA += $(MOD_FILES) platform_DATA += modinfo.sh diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index cccafb39b..80b3bceae 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -90,7 +90,7 @@ kernel = { i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)'; emu_cflags = '$(CFLAGS_GNULIB)'; emu_cppflags = '$(CPPFLAGS_GNULIB)'; - arm_uboot_ldflags = '-Wl,-Ttext=0x08000000'; + arm_uboot_ldflags = '-Wl,-r,-d'; arm_uboot_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version'; i386_pc_startup = kern/i386/pc/startup.S; @@ -214,8 +214,10 @@ kernel = { arm_efi = kern/arm/efi/init.c; arm_efi = kern/arm/efi/misc.c; + arm_efi = kern/efi/fdt.c; - arm64_efi = kern/arm/efi/init.c; + arm64_efi = kern/arm64/efi/init.c; + arm64_efi = kern/efi/fdt.c; i386_pc = kern/i386/pc/init.c; i386_pc = kern/i386/pc/mmap.c; @@ -1585,6 +1587,7 @@ module = { i386_xen = lib/i386/xen/relocator.S; x86_64_xen = lib/x86_64/xen/relocator.S; xen = lib/i386/relocator_common_c.c; + x86_64_efi = lib/x86_64/efi/relocator.c; extra_dist = lib/i386/relocator_common.S; extra_dist = kern/powerpc/cache_flush.S; @@ -1739,7 +1742,32 @@ module = { x86 = loader/i386/xnu.c; x86 = loader/xnu.c; - enable = x86; + /* Code is pretty generic but relies on RNG which + is available only on few platforms. It's not a + big deal as xnu needs ACPI anyway and we have + RNG on all platforms with ACPI. + */ + enable = i386_multiboot; + enable = i386_coreboot; + enable = i386_pc; + enable = i386_efi; + enable = x86_64_efi; +}; + +module = { + name = random; + x86 = lib/i386/random.c; + common = lib/random.c; + + i386_multiboot = kern/i386/tsc_pmtimer.c; + i386_coreboot = kern/i386/tsc_pmtimer.c; + i386_pc = kern/i386/tsc_pmtimer.c; + + enable = i386_multiboot; + enable = i386_coreboot; + enable = i386_pc; + enable = i386_efi; + enable = x86_64_efi; }; module = { diff --git a/grub-core/bus/usb/ehci.c b/grub-core/bus/usb/ehci.c index 8ece40086..5f4297bb2 100644 --- a/grub-core/bus/usb/ehci.c +++ b/grub-core/bus/usb/ehci.c @@ -29,6 +29,7 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); @@ -337,6 +338,21 @@ struct grub_ehci static struct grub_ehci *ehci; +static void +sync_all_caches (struct grub_ehci *e) +{ + if (!e) + return; + if (e->td_virt) + grub_arch_sync_dma_caches (e->td_virt, sizeof (struct grub_ehci_td) * + GRUB_EHCI_N_TD); + if (e->qh_virt) + grub_arch_sync_dma_caches (e->qh_virt, sizeof (struct grub_ehci_qh) * + GRUB_EHCI_N_QH); + if (e->framelist_virt) + grub_arch_sync_dma_caches (e->framelist_virt, 4096); +} + /* EHCC registers access functions */ static inline grub_uint32_t grub_ehci_ehcc_read32 (struct grub_ehci *e, grub_uint32_t addr) @@ -437,6 +453,8 @@ grub_ehci_reset (struct grub_ehci *e) { grub_uint64_t maxtime; + sync_all_caches (e); + grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, GRUB_EHCI_CMD_HC_RESET | grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND)); @@ -840,6 +858,8 @@ grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid, e->next = ehci; ehci = e; + sync_all_caches (e); + grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: OK at all\n"); grub_dprintf ("ehci", @@ -1020,6 +1040,7 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer) /* Found proper existing (and linked) QH, do setup of QH */ grub_dprintf ("ehci", "find_qh: found, QH=%p\n", qh_iter); grub_ehci_setup_qh (qh_iter, transfer); + sync_all_caches (e); return qh_iter; } @@ -1121,7 +1142,7 @@ grub_ehci_free_tds (struct grub_ehci *e, grub_ehci_td_t td, token = grub_le_to_cpu32 (td->token); to_transfer = (token & GRUB_EHCI_TOTAL_MASK) >> GRUB_EHCI_TOTAL_OFF; - /* Check state of TD - if it did not transfered + /* Check state of TD - if it did not transfer * whole data then set last_trans - it should be last executed TD * in case when something went wrong. */ if (transfer && (td->size != to_transfer)) @@ -1289,16 +1310,28 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, grub_ehci_td_t td_prev = NULL; int i; struct grub_ehci_transfer_controller_data *cdata; + grub_uint32_t status; + + sync_all_caches (e); /* Check if EHCI is running and AL is enabled */ - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) - & GRUB_EHCI_ST_HC_HALTED) != 0) + status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); + if ((status & GRUB_EHCI_ST_HC_HALTED) != 0) /* XXX: Fix it: Currently we don't do anything to restart EHCI */ - return GRUB_USB_ERR_INTERNAL; - if ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) + { + grub_dprintf ("ehci", "setup_transfer: halted, status = 0x%x\n", + status); + return GRUB_USB_ERR_INTERNAL; + } + status = grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS); + if ((status & (GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0) /* XXX: Fix it: Currently we don't do anything to restart EHCI */ - return GRUB_USB_ERR_INTERNAL; + { + grub_dprintf ("ehci", "setup_transfer: no AS/PS, status = 0x%x\n", + status); + return GRUB_USB_ERR_INTERNAL; + } /* Allocate memory for controller transfer data. */ cdata = grub_malloc (sizeof (*cdata)); @@ -1310,6 +1343,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, cdata->qh_virt = grub_ehci_find_qh (e, transfer); if (!cdata->qh_virt) { + grub_dprintf ("ehci", "setup_transfer: no QH\n"); grub_free (cdata); return GRUB_USB_ERR_INTERNAL; } @@ -1319,6 +1353,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, cdata->td_alt_virt = grub_ehci_alloc_td (e); if (!cdata->td_alt_virt) { + grub_dprintf ("ehci", "setup_transfer: no TDs\n"); grub_free (cdata); return GRUB_USB_ERR_INTERNAL; } @@ -1345,6 +1380,7 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, grub_ehci_free_tds (e, cdata->td_first_virt, NULL, &actual); grub_free (cdata); + grub_dprintf ("ehci", "setup_transfer: no TD\n"); return GRUB_USB_ERR_INTERNAL; } @@ -1386,6 +1422,8 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev, * i.e. reset token */ cdata->qh_virt->td_overlay.token = grub_cpu_to_le32_compile_time (0); + sync_all_caches (e); + /* Finito */ transfer->controller_data = cdata; @@ -1434,6 +1472,8 @@ grub_ehci_parse_notrun (grub_usb_controller_t dev, grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); + /* Additionally, do something with EHCI to make it running (what?) */ /* Try enable EHCI and AL */ grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND, @@ -1469,6 +1509,8 @@ grub_ehci_parse_halt (grub_usb_controller_t dev, grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); + /* Evaluation of error code - currently we don't have GRUB USB error * codes for some EHCI states, GRUB_USB_ERR_DATA is used for them. * Order of evaluation is critical, specially bubble/stall. */ @@ -1502,6 +1544,8 @@ grub_ehci_parse_success (grub_usb_controller_t dev, grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); + return GRUB_USB_ERR_NONE; } @@ -1515,6 +1559,8 @@ grub_ehci_check_transfer (grub_usb_controller_t dev, transfer->controller_data; grub_uint32_t token, token_ftd; + sync_all_caches (e); + grub_dprintf ("ehci", "check_transfer: EHCI STATUS=%08x, cdata=%p, qh=%p\n", grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS), @@ -1581,6 +1627,9 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, int i; grub_uint64_t maxtime; grub_uint32_t qh_phys; + + sync_all_caches (e); + grub_uint32_t interrupt = cdata->qh_virt->ep_cap & GRUB_EHCI_SMASK_MASK; @@ -1600,6 +1649,7 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, grub_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual); grub_ehci_free_td (e, cdata->td_alt_virt); grub_free (cdata); + sync_all_caches (e); grub_dprintf ("ehci", "cancel_transfer: end - EHCI not running\n"); return GRUB_USB_ERR_NONE; } @@ -1622,6 +1672,8 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, /* Unlink QH from AL */ e->qh_virt[i].qh_hptr = cdata->qh_virt->qh_hptr; + sync_all_caches (e); + /* If this is an interrupt transfer, we just wait for the periodic * schedule to advance a few times and then assume that the EHCI * controller has read the updated QH. */ @@ -1676,6 +1728,8 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev, grub_dprintf ("ehci", "cancel_transfer: end\n"); + sync_all_caches (e); + return GRUB_USB_ERR_NONE; } @@ -1777,11 +1831,6 @@ grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed) status = grub_ehci_port_read (e, port); - grub_dprintf ("ehci", "detect_dev: EHCI STATUS: %08x\n", - grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)); - grub_dprintf ("ehci", "detect_dev: iobase=%p, port=%d, status=0x%02x\n", - e->iobase, port, status); - /* Connect Status Change bit - it detects change of connection */ if (status & GRUB_EHCI_PORT_CONNECT_CH) { diff --git a/grub-core/bus/usb/usbtrans.c b/grub-core/bus/usb/usbtrans.c index ee8680853..9266e4931 100644 --- a/grub-core/bus/usb/usbtrans.c +++ b/grub-core/bus/usb/usbtrans.c @@ -24,6 +24,7 @@ #include #include #include +#include static inline unsigned int @@ -101,6 +102,8 @@ grub_usb_control_msg (grub_usb_device_t dev, data_addr = grub_dma_get_phys (data_chunk); grub_memcpy ((char *) data, data_in, size); + grub_arch_sync_dma_caches (data, size); + grub_dprintf ("usb", "control: reqtype=0x%02x req=0x%02x val=0x%02x idx=0x%02x size=%lu\n", reqtype, request, value, index, (unsigned long)size); @@ -161,6 +164,8 @@ grub_usb_control_msg (grub_usb_device_t dev, setupdata->value = value; setupdata->index = index; setupdata->length = size; + grub_arch_sync_dma_caches (setupdata, sizeof (*setupdata)); + transfer->transactions[0].size = sizeof (*setupdata); transfer->transactions[0].pid = GRUB_USB_TRANSFER_TYPE_SETUP; transfer->transactions[0].data = setupdata_addr; @@ -202,11 +207,13 @@ grub_usb_control_msg (grub_usb_device_t dev, grub_free (transfer->transactions); grub_free (transfer); - grub_dma_free (data_chunk); grub_dma_free (setupdata_chunk); + grub_arch_sync_dma_caches (data, size0); grub_memcpy (data_in, (char *) data, size0); + grub_dma_free (data_chunk); + return err; } @@ -236,7 +243,10 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev, data = grub_dma_get_virt (data_chunk); data_addr = grub_dma_get_phys (data_chunk); if (type == GRUB_USB_TRANSFER_TYPE_OUT) - grub_memcpy ((char *) data, data_in, size); + { + grub_memcpy ((char *) data, data_in, size); + grub_arch_sync_dma_caches (data, size); + } /* Create a transfer. */ transfer = grub_malloc (sizeof (struct grub_usb_transfer)); @@ -306,9 +316,13 @@ grub_usb_bulk_finish_readwrite (grub_usb_transfer_t transfer) dev->toggle[transfer->endpoint] = toggle; if (transfer->dir == GRUB_USB_TRANSFER_TYPE_IN) - grub_memcpy (transfer->data, (void *) - grub_dma_get_virt (transfer->data_chunk), - transfer->size + 1); + { + grub_arch_sync_dma_caches (grub_dma_get_virt (transfer->data_chunk), + transfer->size + 1); + grub_memcpy (transfer->data, (void *) + grub_dma_get_virt (transfer->data_chunk), + transfer->size + 1); + } grub_free (transfer->transactions); grub_dma_free (transfer->data_chunk); diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c index ece49b4a9..b5c2f27c1 100644 --- a/grub-core/commands/acpi.c +++ b/grub-core/commands/acpi.c @@ -593,6 +593,9 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args) if (! table->addr) { free_tables (); + grub_free (exclude); + grub_free (load_only); + grub_free (table); return grub_errno; } table->next = acpi_tables; diff --git a/grub-core/commands/acpihalt.c b/grub-core/commands/acpihalt.c index da68b5b52..9cc7f18e3 100644 --- a/grub-core/commands/acpihalt.c +++ b/grub-core/commands/acpihalt.c @@ -26,6 +26,8 @@ #define grub_dprintf(cond, args...) printf ( args ) #define grub_printf printf +#define grub_util_fopen fopen +#define grub_memcmp memcmp typedef uint64_t grub_uint64_t; typedef uint32_t grub_uint32_t; typedef uint16_t grub_uint16_t; @@ -246,6 +248,7 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end, if (!add) return -1; break; + case GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD: case GRUB_ACPI_OPCODE_CREATE_WORD_FIELD: case GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD: { diff --git a/grub-core/commands/cat.c b/grub-core/commands/cat.c index 8a7f1af78..88d904436 100644 --- a/grub-core/commands/cat.c +++ b/grub-core/commands/cat.c @@ -140,10 +140,13 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args) grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); } - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - for (j = 0; j < utcount; j++) - grub_printf ("<%x>", (unsigned int) utbuf[j]); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + if (utcount) + { + grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + for (j = 0; j < utcount; j++) + grub_printf ("<%x>", (unsigned int) utbuf[j]); + grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + } grub_xputs ("\n"); grub_refresh (); diff --git a/grub-core/commands/i386/cmostest.c b/grub-core/commands/i386/cmostest.c index e5dea0769..c839b704d 100644 --- a/grub-core/commands/i386/cmostest.c +++ b/grub-core/commands/i386/cmostest.c @@ -45,7 +45,7 @@ static grub_err_t grub_cmd_cmostest (struct grub_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - int byte, bit; + int byte = 0, bit = 0; grub_err_t err; grub_uint8_t value; @@ -67,7 +67,7 @@ static grub_err_t grub_cmd_cmosclean (struct grub_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - int byte, bit; + int byte = 0, bit = 0; grub_err_t err; grub_uint8_t value; @@ -85,7 +85,7 @@ static grub_err_t grub_cmd_cmosset (struct grub_command *cmd __attribute__ ((unused)), int argc, char *argv[]) { - int byte, bit; + int byte = 0, bit = 0; grub_err_t err; grub_uint8_t value; diff --git a/grub-core/commands/legacycfg.c b/grub-core/commands/legacycfg.c index d42d7779e..dd9d9f18f 100644 --- a/grub-core/commands/legacycfg.c +++ b/grub-core/commands/legacycfg.c @@ -253,6 +253,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), struct grub_command *cmd; char **cutargs; int cutargc; + grub_err_t err = GRUB_ERR_NONE; for (i = 0; i < 2; i++) { @@ -314,6 +315,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); cutargs = grub_malloc (sizeof (cutargs[0]) * (argc - 1)); + if (!cutargs) + return grub_errno; cutargc = argc - 1; grub_memcpy (cutargs + 1, args + 2, sizeof (cutargs[0]) * (argc - 2)); cutargs[0] = args[0]; @@ -333,7 +336,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, cutargc, cutargs)) { kernel_type = LINUX; - return GRUB_ERR_NONE; + goto out; } } grub_errno = GRUB_ERR_NONE; @@ -348,7 +351,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, argc, args)) { kernel_type = MULTIBOOT; - return GRUB_ERR_NONE; + goto out; } } grub_errno = GRUB_ERR_NONE; @@ -413,7 +416,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, cutargc, cutargs)) { kernel_type = KFREEBSD; - return GRUB_ERR_NONE; + goto out; } } grub_errno = GRUB_ERR_NONE; @@ -422,6 +425,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), char **bsdargs; int bsdargc; char bsddevname[sizeof ("wdXXXXXXXXXXXXY")]; + int found = 0; + if (bsd_device == -1) { bsdargs = cutargs; @@ -432,6 +437,11 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), char rbuf[3] = "-r"; bsdargc = cutargc + 2; bsdargs = grub_malloc (sizeof (bsdargs[0]) * bsdargc); + if (!bsdargs) + { + err = grub_errno; + goto out; + } grub_memcpy (bsdargs, args, argc * sizeof (bsdargs[0])); bsdargs[argc] = rbuf; bsdargs[argc + 1] = bsddevname; @@ -447,7 +457,8 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, bsdargc, bsdargs)) { kernel_type = KNETBSD; - return GRUB_ERR_NONE; + found = 1; + goto free_bsdargs; } } grub_errno = GRUB_ERR_NONE; @@ -460,20 +471,28 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)), if (!(cmd->func) (cmd, bsdargc, bsdargs)) { kernel_type = KOPENBSD; - return GRUB_ERR_NONE; + found = 1; + goto free_bsdargs; } } grub_errno = GRUB_ERR_NONE; } + +free_bsdargs: if (bsdargs != cutargs) grub_free (bsdargs); + if (found) + goto out; } } } while (0); - return grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s", - args[0]); + err = grub_error (GRUB_ERR_BAD_OS, "couldn't load file %s", + args[0]); +out: + grub_free (cutargs); + return err; } static grub_err_t @@ -534,15 +553,17 @@ grub_cmd_legacy_initrdnounzip (struct grub_command *mycmd __attribute__ ((unused char **newargs; grub_err_t err; char nounzipbuf[10] = "--nounzip"; + + cmd = grub_command_find ("module"); + if (!cmd) + return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), + "module"); + newargs = grub_malloc ((argc + 1) * sizeof (newargs[0])); if (!newargs) return grub_errno; grub_memcpy (newargs + 1, args, argc * sizeof (newargs[0])); newargs[0] = nounzipbuf; - cmd = grub_command_find ("module"); - if (!cmd) - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("can't find command `%s'"), - "module"); err = cmd->func (cmd, argc + 1, newargs); grub_free (newargs); diff --git a/grub-core/commands/nativedisk.c b/grub-core/commands/nativedisk.c index b3bc4639c..345f97c4d 100644 --- a/grub-core/commands/nativedisk.c +++ b/grub-core/commands/nativedisk.c @@ -198,7 +198,10 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), return grub_errno; if (get_uuid (NULL, &uuid_root, 0)) - return grub_errno; + { + grub_free (mods); + return grub_errno; + } prefdev = grub_file_get_device_name (prefix); if (grub_errno) @@ -210,6 +213,8 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), if (get_uuid (prefdev, &uuid_prefix, 0)) { grub_free (uuid_root); + grub_free (prefdev); + grub_free (mods); return grub_errno; } @@ -289,12 +294,15 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), } grub_free (uuid_root); grub_free (uuid_prefix); + grub_free (prefdev); + grub_free (mods); return GRUB_ERR_NONE; fail: grub_free (uuid_root); grub_free (uuid_prefix); + grub_free (prefdev); for (i = 0; i < mods_loaded; i++) if (mods[i]) @@ -302,6 +310,8 @@ grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)), mods[i]->fini = 0; grub_dl_unload (mods[i]); } + grub_free (mods); + return grub_errno; } diff --git a/grub-core/commands/parttool.c b/grub-core/commands/parttool.c index 42c590e1a..693e2cb42 100644 --- a/grub-core/commands/parttool.c +++ b/grub-core/commands/parttool.c @@ -283,6 +283,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), } if (! cur) { + grub_free (parsed); grub_device_close (dev); return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), args[i]); diff --git a/grub-core/commands/password_pbkdf2.c b/grub-core/commands/password_pbkdf2.c index c6a77c8c5..da636e621 100644 --- a/grub-core/commands/password_pbkdf2.c +++ b/grub-core/commands/password_pbkdf2.c @@ -45,6 +45,7 @@ check_password (const char *user, const char *entered, void *pin) grub_uint8_t *buf; struct pbkdf2_password *pass = pin; gcry_err_code_t err; + grub_err_t ret; buf = grub_malloc (pass->buflen); if (!buf) @@ -55,17 +56,17 @@ check_password (const char *user, const char *entered, void *pin) pass->salt, pass->saltlen, pass->c, buf, pass->buflen); if (err) + ret = grub_crypto_gcry_error (err); + else if (grub_crypto_memcmp (buf, pass->expected, pass->buflen) != 0) + ret = GRUB_ACCESS_DENIED; + else { - grub_free (buf); - return grub_crypto_gcry_error (err); + grub_auth_authenticate (user); + ret = GRUB_ERR_NONE; } - if (grub_crypto_memcmp (buf, pass->expected, pass->buflen) != 0) - return GRUB_ACCESS_DENIED; - - grub_auth_authenticate (user); - - return GRUB_ERR_NONE; + grub_free (buf); + return ret; } static inline int diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c index e7cbba754..83837b564 100644 --- a/grub-core/commands/search.c +++ b/grub-core/commands/search.c @@ -68,7 +68,7 @@ iterate_device (const char *name, void *data) /* Skip floppy drives when requested. */ if (ctx->no_floppy && name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') - return 0; + return 1; #if defined(DO_SEARCH_FS_UUID) || defined(DO_SEARCH_DISK_UUID) #define compare_fn grub_strcasecmp diff --git a/grub-core/commands/verify.c b/grub-core/commands/verify.c index 24fac298f..d72692b97 100644 --- a/grub-core/commands/verify.c +++ b/grub-core/commands/verify.c @@ -338,19 +338,19 @@ grub_load_public_key (grub_file_t f) if (grub_file_read (f, &l, sizeof (l)) != sizeof (l)) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } lb = (grub_be_to_cpu16 (l) + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT; if (lb > READBUF_SIZE - sizeof (grub_uint16_t)) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } if (grub_file_read (f, buffer + sizeof (grub_uint16_t), lb) != (grub_ssize_t) lb) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } grub_memcpy (buffer, &l, sizeof (l)); @@ -360,10 +360,16 @@ grub_load_public_key (grub_file_t f) buffer, lb + sizeof (grub_uint16_t), 0)) { grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature")); - goto fail; + break; } } + if (i < pkalgos[pk].nmpipub) + { + grub_free (sk); + goto fail; + } + GRUB_MD_SHA1->final (fingerprint_context); grub_memcpy (sk->fingerprint, GRUB_MD_SHA1->read (fingerprint_context), 20); diff --git a/grub-core/disk/ahci.c b/grub-core/disk/ahci.c index fc640d5d4..494a1b773 100644 --- a/grub-core/disk/ahci.c +++ b/grub-core/disk/ahci.c @@ -32,7 +32,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct grub_ahci_cmd_head { grub_uint32_t config; - grub_uint32_t transfered; + grub_uint32_t transferred; grub_uint64_t command_table_base; grub_uint32_t unused[4]; }; @@ -954,7 +954,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, grub_dprintf ("ahci", "AHCI tfd = %x\n", dev->hba->ports[dev->port].task_file_data); - dev->command_list[0].transfered = 0; + dev->command_list[0].transferred = 0; dev->command_list[0].command_table_base = grub_dma_get_phys (dev->command_table_chunk); @@ -1044,7 +1044,7 @@ grub_ahci_readwrite_real (struct grub_ahci_device *dev, dev->hba->ports[dev->port].command_issue, dev->hba->ports[dev->port].intstatus, dev->hba->ports[dev->port].task_file_data, - dev->command_list[0].transfered, + dev->command_list[0].transferred, dev->hba->ports[dev->port].sata_error, ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x00], ((grub_uint32_t *) grub_dma_get_virt (dev->rfis))[0x18]); diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c index a8783a3c1..3b79f7bbc 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -85,6 +85,12 @@ make_devices (void) { /* Uggh. */ grub_free (handles); + while (devices) + { + d = devices->next; + grub_free (devices); + devices = d; + } return 0; } @@ -487,8 +493,15 @@ grub_efidisk_open (const char *name, struct grub_disk *disk) m = d->block_io->media; /* FIXME: Probably it is better to store the block size in the disk, and total sectors should be replaced with total blocks. */ - grub_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x\n", - m, (unsigned long long) m->last_block, m->block_size); + grub_dprintf ("efidisk", + "m = %p, last block = %llx, block size = %x, io align = %x\n", + m, (unsigned long long) m->last_block, m->block_size, + m->io_align); + + /* Ensure required buffer alignment is a power of two (or is zero). */ + if (m->io_align & (m->io_align - 1)) + return grub_error (GRUB_ERR_IO, "invalid buffer alignment %d", m->io_align); + disk->total_sectors = m->last_block + 1; /* Don't increase this value due to bug in some EFI. */ disk->max_agglomerate = 0xa0000 >> (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS); @@ -518,15 +531,42 @@ grub_efidisk_readwrite (struct grub_disk *disk, grub_disk_addr_t sector, { struct grub_efidisk_data *d; grub_efi_block_io_t *bio; + grub_efi_status_t status; + grub_size_t io_align, num_bytes; + char *aligned_buf; d = disk->data; bio = d->block_io; - return efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio, - bio->media->media_id, - (grub_efi_uint64_t) sector, - (grub_efi_uintn_t) size << disk->log_sector_size, - buf); + /* Set alignment to 1 if 0 specified */ + io_align = bio->media->io_align ? bio->media->io_align : 1; + num_bytes = size << disk->log_sector_size; + + if ((grub_addr_t) buf & (io_align - 1)) + { + aligned_buf = grub_memalign (io_align, num_bytes); + if (! aligned_buf) + return GRUB_EFI_OUT_OF_RESOURCES; + if (wr) + grub_memcpy (aligned_buf, buf, num_bytes); + } + else + { + aligned_buf = buf; + } + + status = efi_call_5 ((wr ? bio->write_blocks : bio->read_blocks), bio, + bio->media->media_id, (grub_efi_uint64_t) sector, + (grub_efi_uintn_t) num_bytes, aligned_buf); + + if ((grub_addr_t) buf & (io_align - 1)) + { + if (!wr) + grub_memcpy (buf, aligned_buf, num_bytes); + grub_free (aligned_buf); + } + + return status; } static grub_err_t @@ -541,7 +581,9 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, status = grub_efidisk_readwrite (disk, sector, size, buf, 0); - if (status != GRUB_EFI_SUCCESS) + if (status == GRUB_EFI_NO_MEDIA) + return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); + else if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx from `%s'"), (unsigned long long) sector, @@ -562,7 +604,9 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, status = grub_efidisk_readwrite (disk, sector, size, (char *) buf, 1); - if (status != GRUB_EFI_SUCCESS) + if (status == GRUB_EFI_NO_MEDIA) + return grub_error (GRUB_ERR_OUT_OF_RANGE, N_("no media in `%s'"), disk->name); + else if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_WRITE_ERROR, N_("failure writing sector 0x%llx to `%s'"), (unsigned long long) sector, disk->name); diff --git a/grub-core/efiemu/loadcore.c b/grub-core/efiemu/loadcore.c index 6968b3719..44085ef81 100644 --- a/grub-core/efiemu/loadcore.c +++ b/grub-core/efiemu/loadcore.c @@ -154,7 +154,10 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE : GRUB_EFI_RUNTIME_SERVICES_DATA); if (seg->handle < 0) - return grub_errno; + { + grub_free (seg); + return grub_errno; + } seg->off = 0; } @@ -343,7 +346,7 @@ SUFFIX (grub_efiemu_loadcore_init) (void *core, const char *filename, return grub_error (GRUB_ERR_BAD_MODULE, N_("this ELF file is not of the right type")); /* Make sure that every section is within the core. */ - if ((grub_size_t) core_size < e->e_shoff + e->e_shentsize * e->e_shnum) + if ((grub_size_t) core_size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum) return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename); diff --git a/grub-core/efiemu/main.c b/grub-core/efiemu/main.c index f2140ad29..f6813b1ed 100644 --- a/grub-core/efiemu/main.c +++ b/grub-core/efiemu/main.c @@ -196,7 +196,7 @@ grub_efiemu_load_file (const char *filename) { grub_file_close (file); grub_efiemu_unload (); - return grub_errno; + return err; } grub_dprintf ("efiemu", "mm initialized\n"); diff --git a/grub-core/efiemu/mm.c b/grub-core/efiemu/mm.c index d4a4f3aad..e606dbffc 100644 --- a/grub-core/efiemu/mm.c +++ b/grub-core/efiemu/mm.c @@ -99,7 +99,8 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, grub_size_t align_overhead; struct grub_efiemu_memrequest *ret, *cur, *prev; /* Check that the request is correct */ - if (type >= GRUB_EFI_MAX_MEMORY_TYPE || type <= GRUB_EFI_LOADER_CODE) + if (type <= GRUB_EFI_LOADER_CODE || type == GRUB_EFI_PERSISTENT_MEMORY || + type >= GRUB_EFI_MAX_MEMORY_TYPE) return -2; /* Add new size to requested size */ @@ -166,6 +167,13 @@ efiemu_alloc_requests (void) GRUB_EFI_MEMORY_MAPPED_IO, GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, GRUB_EFI_PAL_CODE + + /* + * These are not allocatable: + * GRUB_EFI_RESERVED_MEMORY_TYPE + * GRUB_EFI_PERSISTENT_MEMORY + * >= GRUB_EFI_MAX_MEMORY_TYPE + */ }; /* Compute total memory needed */ @@ -402,6 +410,10 @@ fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type, return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_ACPI_MEMORY_NVS); + case GRUB_MEMORY_PERSISTENT: + case GRUB_MEMORY_PERSISTENT_LEGACY: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_PERSISTENT_MEMORY); default: grub_dprintf ("efiemu", "Unknown memory type %d. Assuming unusable\n", type); @@ -445,7 +457,7 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) case GRUB_EFI_MEMORY_MAPPED_IO: case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: case GRUB_EFI_PAL_CODE: - case GRUB_EFI_MAX_MEMORY_TYPE: + default: hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_MEMORY_RESERVED, hook_data); break; @@ -468,6 +480,12 @@ grub_efiemu_mmap_iterate (grub_memory_hook_t hook, void *hook_data) hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_MEMORY_NVS, hook_data); break; + + case GRUB_EFI_PERSISTENT_MEMORY: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_MEMORY_PERSISTENT, hook_data); + break; + } return 0; @@ -503,7 +521,8 @@ grub_efiemu_mmap_sort_and_uniq (void) [GRUB_EFI_ACPI_MEMORY_NVS] = 3, [GRUB_EFI_MEMORY_MAPPED_IO] = 4, [GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, - [GRUB_EFI_PAL_CODE] = 4 + [GRUB_EFI_PAL_CODE] = 4, + [GRUB_EFI_PERSISTENT_MEMORY] = 4 }; int i, j, k, done; diff --git a/grub-core/efiemu/prepare.c b/grub-core/efiemu/prepare.c index 84c3368a8..99ddb5abb 100644 --- a/grub-core/efiemu/prepare.c +++ b/grub-core/efiemu/prepare.c @@ -83,10 +83,16 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); /* Put pointer to the list of configuration tables in system table */ - grub_efiemu_write_value - (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, - conftable_handle, 0, 1, - sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); + err = grub_efiemu_write_value + (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, + conftable_handle, 0, 1, + sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); + if (err) + { + grub_efiemu_unload (); + return err; + } + SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables; /* Fill the list of configuration tables */ diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index aa2145cf2..635c2c425 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -681,7 +681,7 @@ grub_fat_iterate_dir_next (grub_fshelp_node_t node, ctxt->dir.file_size = grub_cpu_to_le64 (sec.type_specific.stream_extension.file_size); ctxt->dir.have_stream = 1; - ctxt->dir.is_contiguous = !!(dir.type_specific.stream_extension.flags + ctxt->dir.is_contiguous = !!(sec.type_specific.stream_extension.flags & grub_cpu_to_le16_compile_time (FLAG_CONTIGUOUS)); break; case 0xc1: diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c index 0ebc71b62..fc3683178 100644 --- a/grub-core/fs/hfs.c +++ b/grub-core/fs/hfs.c @@ -1308,6 +1308,7 @@ grub_hfs_open (struct grub_file *file, const char *name) if (grub_hfs_find_dir (data, name, &found, GRUB_FSHELP_REG)) { grub_free (data); + grub_free (found); grub_dl_unref (my_mod); return grub_errno; } diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c index 67a67cf40..c9c8374bf 100644 --- a/grub-core/fs/iso9660.c +++ b/grub-core/fs/iso9660.c @@ -750,19 +750,15 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, if (dir->data->joliet && !ctx.filename) { - char *oldname, *semicolon; + char *semicolon; - oldname = name; ctx.filename = grub_iso9660_convert_string - ((grub_uint8_t *) oldname, dirent.namelen >> 1); + ((grub_uint8_t *) name, dirent.namelen >> 1); semicolon = grub_strrchr (ctx.filename, ';'); if (semicolon) *semicolon = '\0'; - if (ctx.filename_alloc) - grub_free (oldname); - ctx.filename_alloc = 1; } diff --git a/grub-core/fs/ntfscomp.c b/grub-core/fs/ntfscomp.c index 2e1ce51a8..3cd97d337 100644 --- a/grub-core/fs/ntfscomp.c +++ b/grub-core/fs/ntfscomp.c @@ -104,7 +104,7 @@ decomp_block (struct grub_ntfs_comp *cc, grub_uint8_t *dest) if (tag & 1) { grub_uint32_t i, len, delta, code, lmask, dshift; - grub_uint16_t word; + grub_uint16_t word = 0; if (decomp_get16 (cc, &word)) return grub_errno; diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index a03526b32..9f66dd6e4 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -76,8 +76,13 @@ GRUB_MOD_LICENSE ("GPLv3+"); /* incompat feature flags */ #define XFS_SB_FEAT_INCOMPAT_FTYPE (1 << 0) /* filetype in dirent */ +#define XFS_SB_FEAT_INCOMPAT_SPINODES (1 << 1) /* sparse inode chunks */ +#define XFS_SB_FEAT_INCOMPAT_META_UUID (1 << 2) /* metadata UUID */ + +/* We do not currently verify metadata UUID so it is safe to read such filesystem */ #define XFS_SB_FEAT_INCOMPAT_SUPPORTED \ - (XFS_SB_FEAT_INCOMPAT_FTYPE) + (XFS_SB_FEAT_INCOMPAT_FTYPE | \ + XFS_SB_FEAT_INCOMPAT_META_UUID) struct grub_xfs_sblock { @@ -775,7 +780,10 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, c = de->name[de->len]; de->name[de->len] = '\0'; if (iterate_dir_call_hook (ino, de->name, &ctx)) - return 1; + { + de->name[de->len] = c; + return 1; + } de->name[de->len] = c; de = grub_xfs_inline_next_de(dir->data, head, de); diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index c4ead29fb..6e1fff9e9 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -3132,7 +3132,7 @@ make_mdn (dnode_end_t * mdn, struct grub_zfs_data *data) { void *osp; blkptr_t *bp; - grub_size_t ospsize; + grub_size_t ospsize = 0; grub_err_t err; grub_dprintf ("zfs", "endian = %d\n", mdn->endian); diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c index 1212a8986..2f73449f0 100644 --- a/grub-core/fs/zfs/zfs_lz4.c +++ b/grub-core/fs/zfs/zfs_lz4.c @@ -184,6 +184,8 @@ LZ4_uncompress_unknownOutputSize(const char *source, } } /* copy literals */ + if ((grub_addr_t) length > ~(grub_addr_t)op) + goto _output_error; cpy = op + length; if ((cpy > oend - COPYLENGTH) || (ip + length > iend - COPYLENGTH)) { diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in index 789732b10..045817b15 100644 --- a/grub-core/genmod.sh.in +++ b/grub-core/genmod.sh.in @@ -15,12 +15,12 @@ set -e # # Example: # -# genmod.sh moddep.lst normal.module normal.mod +# genmod.sh moddep.lst normal.module build-grub-module-verifier normal.mod # moddep=$1 infile=$2 -outfile=$3 +outfile=$4 tmpfile=${outfile}.tmp modname=`echo $infile | sed -e 's@\.module.*$@@'` @@ -58,7 +58,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then -K grub_mod_init -K grub_mod_fini \ -K _grub_mod_init -K _grub_mod_fini \ -R .note.gnu.gold-version -R .note.GNU-stack \ - -R .note -R .comment $tmpfile || exit 1 + -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 fi if ! test -z "${TARGET_OBJ2ELF}"; then "${TARGET_OBJ2ELF}" $tmpfile || exit 1 @@ -91,6 +91,9 @@ else -nr:_grub_mod_init:grub_mod_init \ -nr:_grub_mod_fini:grub_mod_fini \ -wd1106 -nu -nd $tmpfile.bin $tmpfile || exit 1 - rm -f $name.bin + rm -f $tmpfile.bin +fi +if test x@platform@ != xemu; then + ./build-grub-module-verifier@BUILD_EXEEXT@ $tmpfile @target_cpu@ fi mv $tmpfile $outfile diff --git a/grub-core/gfxmenu/font.c b/grub-core/gfxmenu/font.c index 64d52670b..756c24f20 100644 --- a/grub-core/gfxmenu/font.c +++ b/grub-core/gfxmenu/font.c @@ -45,6 +45,7 @@ grub_font_draw_string (const char *str, grub_font_t font, grub_uint32_t *logical; grub_ssize_t logical_len, visual_len; struct grub_unicode_glyph *visual, *ptr; + grub_err_t err; logical_len = grub_utf8_to_ucs4_alloc (str, &logical, 0); if (logical_len < 0) @@ -56,24 +57,28 @@ grub_font_draw_string (const char *str, grub_font_t font, if (visual_len < 0) return grub_errno; + err = GRUB_ERR_NONE; for (ptr = visual, x = left_x; ptr < visual + visual_len; ptr++) { - grub_err_t err; struct grub_font_glyph *glyph; glyph = grub_font_construct_glyph (font, ptr); if (!glyph) - return grub_errno; + { + err = grub_errno; + goto out; + } err = grub_font_draw_glyph (glyph, color, x, baseline_y); - x += glyph->device_width; if (err) - return err; + goto out; + x += glyph->device_width; } +out: for (ptr = visual; ptr < visual + visual_len; ptr++) grub_unicode_destroy_glyph (ptr); grub_free (visual); - return GRUB_ERR_NONE; + return err; } /* Get the width in pixels of the specified UTF-8 string, when rendered in diff --git a/grub-core/gfxmenu/gfxmenu.c b/grub-core/gfxmenu/gfxmenu.c index f49fce802..8a17dda2c 100644 --- a/grub-core/gfxmenu/gfxmenu.c +++ b/grub-core/gfxmenu/gfxmenu.c @@ -63,14 +63,14 @@ grub_gfxmenu_try (int entry, grub_menu_t menu, int nested) return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "theme"); - instance = grub_zalloc (sizeof (*instance)); - if (!instance) - return grub_errno; - err = grub_video_get_info (&mode_info); if (err) return err; + instance = grub_zalloc (sizeof (*instance)); + if (!instance) + return grub_errno; + if (theme_path[0] != '/' && theme_path[0] != '(') { const char *prefix; diff --git a/grub-core/kern/acpi.c b/grub-core/kern/acpi.c index 02c1f4f6f..5746ac00c 100644 --- a/grub-core/kern/acpi.c +++ b/grub-core/kern/acpi.c @@ -32,3 +32,88 @@ grub_byte_checksum (void *base, grub_size_t size) ret += *ptr; return ret; } + +static void * +grub_acpi_rsdt_find_table (struct grub_acpi_table_header *rsdt, const char *sig) +{ + grub_size_t s; + grub_unaligned_uint32_t *ptr; + + if (!rsdt) + return 0; + + if (grub_memcmp (rsdt->signature, "RSDT", 4) != 0) + return 0; + + ptr = (grub_unaligned_uint32_t *) (rsdt + 1); + s = (rsdt->length - sizeof (*rsdt)) / sizeof (grub_uint32_t); + for (; s; s--, ptr++) + { + struct grub_acpi_table_header *tbl; + tbl = (struct grub_acpi_table_header *) (grub_addr_t) ptr->val; + if (grub_memcmp (tbl->signature, sig, 4) == 0) + return tbl; + } + return 0; +} + +static void * +grub_acpi_xsdt_find_table (struct grub_acpi_table_header *xsdt, const char *sig) +{ + grub_size_t s; + grub_unaligned_uint64_t *ptr; + + if (!xsdt) + return 0; + + if (grub_memcmp (xsdt->signature, "XSDT", 4) != 0) + return 0; + + ptr = (grub_unaligned_uint64_t *) (xsdt + 1); + s = (xsdt->length - sizeof (*xsdt)) / sizeof (grub_uint32_t); + for (; s; s--, ptr++) + { + struct grub_acpi_table_header *tbl; +#if GRUB_CPU_SIZEOF_VOID_P != 8 + if (ptr->val >> 32) + continue; +#endif + tbl = (struct grub_acpi_table_header *) (grub_addr_t) ptr->val; + if (grub_memcmp (tbl->signature, sig, 4) == 0) + return tbl; + } + return 0; +} + +struct grub_acpi_fadt * +grub_acpi_find_fadt (void) +{ + struct grub_acpi_fadt *fadt = 0; + struct grub_acpi_rsdp_v10 *rsdpv1; + struct grub_acpi_rsdp_v20 *rsdpv2; + rsdpv1 = grub_machine_acpi_get_rsdpv1 (); + if (rsdpv1) + fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) + (grub_addr_t) rsdpv1->rsdt_addr, + GRUB_ACPI_FADT_SIGNATURE); + if (fadt) + return fadt; + rsdpv2 = grub_machine_acpi_get_rsdpv2 (); + if (rsdpv2) + fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) + (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr, + GRUB_ACPI_FADT_SIGNATURE); + if (fadt) + return fadt; + if (rsdpv2 +#if GRUB_CPU_SIZEOF_VOID_P != 8 + && !(rsdpv2->xsdt_addr >> 32) +#endif + ) + fadt = grub_acpi_xsdt_find_table ((struct grub_acpi_table_header *) + (grub_addr_t) rsdpv2->xsdt_addr, + GRUB_ACPI_FADT_SIGNATURE); + if (fadt) + return fadt; + return 0; +} diff --git a/grub-core/kern/arm/efi/init.c b/grub-core/kern/arm/efi/init.c index 2572ca8b7..06df60e2f 100644 --- a/grub-core/kern/arm/efi/init.c +++ b/grub-core/kern/arm/efi/init.c @@ -38,7 +38,7 @@ static void increment_timer (grub_efi_event_t event __attribute__ ((unused)), void *context __attribute__ ((unused))) { - tmr++; + tmr += 10; } void @@ -52,7 +52,7 @@ grub_machine_init (void) efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_SIGNAL, GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt); - efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 10000); + efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 100000); grub_install_get_time_ms (grub_efi_get_time_ms); } diff --git a/grub-core/kern/arm/uboot/startup.S b/grub-core/kern/arm/uboot/startup.S index 0c4a5f670..5efaae16e 100644 --- a/grub-core/kern/arm/uboot/startup.S +++ b/grub-core/kern/arm/uboot/startup.S @@ -55,10 +55,6 @@ FUNCTION(_start) VARIABLE(grub_total_module_size) .long 0 -VARIABLE(grub_uboot_machine_type) - .long 0 -VARIABLE(grub_uboot_boot_data) - .long 0 VARIABLE(grub_modbase) .long 0 bss_start_ptr: @@ -66,29 +62,66 @@ bss_start_ptr: end_ptr: .long EXT_C(_end) + @ Memory map at start: + @ * text+data + @ * list relocations + @ * modules + @ Before we enter C, we need to apply the relocations + @ and get following map: + @ * text+data + @ * BSS (cleared) + @ * stack + @ * modules + @ + @ To make things easier we ensure + @ that BSS+stack is larger than list of relocations + @ by increasing stack if necessarry. + @ This allows us to always unconditionally copy backwards + @ Currently list of relocations is ~5K and stack is set + @ to be at least 256K + FUNCTION(codestart) @ Store context: Machine ID, atags/dtb, ... @ U-Boot API signature is stored on the U-Boot heap @ Stack pointer used as start address for signature probing mov r12, sp adr sp, entry_state - push {r4-r12,lr} @ store U-Boot context (sp in r12) + push {r1-r12,lr} @ store U-Boot context (sp in r12) - str r1, EXT_C(grub_uboot_machine_type) - str r2, EXT_C(grub_uboot_boot_data) - - @ Modules have been stored as a blob in BSS, - @ they need to be manually relocated to _end + adr r1, _start ldr r0, bss_start_ptr @ src + add r0, r0, r1 + + add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + mvn r2, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + and r0, r0, r2 +1: + ldr r3, [r0], #4 @load next offset + @ both -2 and -1 are treated the same as we have only one type of relocs + @ -2 means "end of this type of relocs" and -1 means "end of all relocs" + add r2, r3, #2 + cmp r2, #1 + bls reloc_done + @ Adjust next offset + ldr r2, [r3, r1] + add r2, r2, r1 + str r2, [r3, r1] + b 1b + +reloc_done: + + @ Modules have been stored as a blob + @ they need to be manually relocated to _end add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) mvn r1, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - and r0, r0, r1 + and r0, r0, r1 @ src = aligned end of relocations ldr r1, end_ptr @ dst = End of BSS ldr r2, grub_total_module_size @ blob size add r1, r1, #GRUB_KERNEL_MACHINE_STACK_SIZE and r1, r1, #~0x7 @ Ensure 8-byte alignment + sub sp, r1, #8 add r1, r1, #1024 @@ -157,6 +190,11 @@ FUNCTION(grub_uboot_return) .align 3 @ U-boot context stack space entry_state_end: +VARIABLE(grub_uboot_machine_type) + .long 0 @ r1 +VARIABLE(grub_uboot_boot_data) + .long 0 @ r2 + .long 0 @ r3 .long 0 @ r4 .long 0 @ r5 .long 0 @ r6 diff --git a/grub-core/kern/arm64/dl.c b/grub-core/kern/arm64/dl.c index e19ba6a0d..cf50d7250 100644 --- a/grub-core/kern/arm64/dl.c +++ b/grub-core/kern/arm64/dl.c @@ -132,6 +132,12 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, *abs_place = (grub_uint64_t) sym_addr; } break; + case R_AARCH64_ADD_ABS_LO12_NC: + grub_arm64_set_abs_lo12 (place, sym_addr); + break; + case R_AARCH64_LDST64_ABS_LO12_NC: + grub_arm64_set_abs_lo12_ldst64 (place, sym_addr); + break; case R_AARCH64_CALL26: case R_AARCH64_JUMP26: { @@ -154,6 +160,18 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, grub_arm64_set_xxxx26_offset (place, offset); } break; + case R_AARCH64_ADR_PREL_PG_HI21: + { + grub_int64_t offset = (sym_addr & ~0xfffULL) - (((grub_uint64_t) place) & ~0xfffULL); + + if (!grub_arm64_check_hi21_signed (offset)) + return grub_error (GRUB_ERR_BAD_MODULE, + "HI21 out of range"); + + grub_arm64_set_hi21 (place, offset); + } + break; + default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, N_("relocation 0x%x is not implemented yet"), diff --git a/grub-core/kern/arm64/dl_helper.c b/grub-core/kern/arm64/dl_helper.c index d213ab93e..f031b1ae9 100644 --- a/grub-core/kern/arm64/dl_helper.c +++ b/grub-core/kern/arm64/dl_helper.c @@ -53,3 +53,43 @@ grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset) *place &= insmask; *place |= grub_cpu_to_le32 (offset >> 2) & ~insmask; } + +int +grub_arm64_check_hi21_signed (grub_int64_t offset) +{ + if (offset != (grub_int64_t)(grub_int32_t)offset) + return 0; + return 1; +} + +void +grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset) +{ + const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0x9f00001f); + grub_uint32_t val; + + offset >>= 12; + + val = ((offset & 3) << 29) | (((offset >> 2) & 0x7ffff) << 5); + + *place &= insmask; + *place |= grub_cpu_to_le32 (val) & ~insmask; +} + +void +grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target) +{ + const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xffc003ff); + + *place &= insmask; + *place |= grub_cpu_to_le32 (target << 10) & ~insmask; +} + +void +grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target) +{ + const grub_uint32_t insmask = grub_cpu_to_le32_compile_time (0xfff803ff); + + *place &= insmask; + *place |= grub_cpu_to_le32 (target << 7) & ~insmask; +} diff --git a/grub-core/kern/arm64/efi/init.c b/grub-core/kern/arm64/efi/init.c new file mode 100644 index 000000000..6224999ec --- /dev/null +++ b/grub-core/kern/arm64/efi/init.c @@ -0,0 +1,60 @@ +/* init.c - initialize an arm-based EFI system */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2013 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 +#include +#include + +static grub_uint64_t timer_frequency_in_khz; + +static grub_uint64_t +grub_efi_get_time_ms (void) +{ + grub_uint64_t tmr; + asm volatile("mrs %0, cntvct_el0" : "=r" (tmr)); + + return tmr / timer_frequency_in_khz; +} + + +void +grub_machine_init (void) +{ + grub_uint64_t timer_frequency; + + grub_efi_init (); + + asm volatile("mrs %0, cntfrq_el0" : "=r" (timer_frequency)); + timer_frequency_in_khz = timer_frequency / 1000; + + grub_install_get_time_ms (grub_efi_get_time_ms); +} + +void +grub_machine_fini (int flags) +{ + if (!(flags & GRUB_LOADER_FLAG_NORETURN)) + return; + + grub_efi_fini (); +} diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index 2fdd40e8c..d41343843 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -342,8 +342,11 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) if (s->sh_type == SHT_SYMTAB) break; + /* Module without symbol table may still be used to pull in dependencies. + We verify at build time that such modules do not contain any relocations + that may reference symbol table. */ if (i == e->e_shnum) - return grub_error (GRUB_ERR_BAD_MODULE, N_("no symbol table")); + return GRUB_ERR_NONE; #ifdef GRUB_MODULES_MACHINE_READONLY mod->symtab = grub_malloc (s->sh_size); @@ -585,6 +588,9 @@ grub_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { + if (!mod->symtab) + return grub_error (GRUB_ERR_BAD_MODULE, "relocation without symbol table"); + err = grub_arch_dl_relocate_symbols (mod, ehdr, s, seg); if (err) return err; @@ -614,7 +620,7 @@ grub_dl_load_core_noinit (void *addr, grub_size_t size) } /* Make sure that every section is within the core. */ - if (size < e->e_shoff + e->e_shentsize * e->e_shnum) + if (size < e->e_shoff + (grub_uint32_t) e->e_shentsize * e->e_shnum) { grub_error (GRUB_ERR_BAD_OS, "ELF sections outside core"); return 0; diff --git a/grub-core/kern/efi/fdt.c b/grub-core/kern/efi/fdt.c new file mode 100644 index 000000000..30100c61c --- /dev/null +++ b/grub-core/kern/efi/fdt.c @@ -0,0 +1,43 @@ +/* fdt.c - EFI Flattened Device Tree interaction */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +void * +grub_efi_get_firmware_fdt (void) +{ + grub_efi_configuration_table_t *tables; + grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; + void *firmware_fdt = NULL; + unsigned int i; + + /* Look for FDT in UEFI config tables. */ + tables = grub_efi_system_table->configuration_table; + + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) + { + firmware_fdt = tables[i].vendor_table; + grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); + break; + } + + return firmware_fdt; +} diff --git a/grub-core/kern/efi/init.c b/grub-core/kern/efi/init.c index e9c85de12..2c31847bf 100644 --- a/grub-core/kern/efi/init.c +++ b/grub-core/kern/efi/init.c @@ -59,10 +59,13 @@ grub_machine_get_bootlocation (char **device, char **path) if (!image) return; *device = grub_efidisk_get_device_name (image->device_handle); - *path = grub_efi_get_filename (image->file_path); if (!*device && grub_efi_net_config) - grub_efi_net_config (image->device_handle, device, path); + { + grub_efi_net_config (image->device_handle, device, path); + return; + } + *path = grub_efi_get_filename (image->file_path); if (*path) { /* Get the directory. */ diff --git a/grub-core/kern/elfXX.c b/grub-core/kern/elfXX.c index b91c39d9e..1859d1880 100644 --- a/grub-core/kern/elfXX.c +++ b/grub-core/kern/elfXX.c @@ -12,7 +12,7 @@ grub_elfXX_load_phdrs (grub_elf_t elf) if (elf->phdrs) return GRUB_ERR_NONE; - phdrs_size = elf->ehdr.ehdrXX.e_phnum * elf->ehdr.ehdrXX.e_phentsize; + phdrs_size = (grub_uint32_t) elf->ehdr.ehdrXX.e_phnum * elf->ehdr.ehdrXX.e_phentsize; grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%lx.\n", (unsigned long long) elf->ehdr.ehdrXX.e_phoff, diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 610518d0c..87e3e2512 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -161,9 +161,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) { struct stat st; # if GRUB_DISK_DEVS_ARE_CHAR - if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) + if (fstat (fd, &st) >= 0 && S_ISCHR (st.st_mode)) # else - if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) + if (fstat (fd, &st) >= 0 && S_ISBLK (st.st_mode)) # endif data->is_disk = 1; } diff --git a/grub-core/kern/emu/main.c b/grub-core/kern/emu/main.c index 4b509139c..f91280f68 100644 --- a/grub-core/kern/emu/main.c +++ b/grub-core/kern/emu/main.c @@ -65,6 +65,12 @@ grub_reboot (void) longjmp (main_env, 1); } +void +grub_exit (void) +{ + grub_reboot (); +} + void grub_machine_init (void) { @@ -86,11 +92,16 @@ grub_machine_fini (int flags) +#define OPT_MEMDISK 257 + static struct argp_option options[] = { {"root", 'r', N_("DEVICE_NAME"), 0, N_("Set root device."), 2}, {"device-map", 'm', N_("FILE"), 0, /* TRANSLATORS: There are many devices in device map. */ N_("use FILE as the device map [default=%s]"), 0}, + {"memdisk", OPT_MEMDISK, N_("FILE"), 0, + /* TRANSLATORS: There are many devices in device map. */ + N_("use FILE as memdisk"), 0}, {"directory", 'd', N_("DIR"), 0, N_("use GRUB files in the directory DIR [default=%s]"), 0}, {"verbose", 'v', 0, 0, N_("print verbose messages."), 0}, @@ -119,6 +130,7 @@ help_filter (int key, const char *text, void *input __attribute__ ((unused))) struct arguments { const char *dev_map; + const char *mem_disk; int hold; }; @@ -131,6 +143,9 @@ argp_parser (int key, char *arg, struct argp_state *state) switch (key) { + case OPT_MEMDISK: + arguments->mem_disk = arg; + break; case 'r': free (root_dev); root_dev = xstrdup (arg); @@ -180,9 +195,13 @@ main (int argc, char *argv[]) struct arguments arguments = { .dev_map = DEFAULT_DEVICE_MAP, - .hold = 0 + .hold = 0, + .mem_disk = 0, }; volatile int hold = 0; + size_t total_module_size = sizeof (struct grub_module_info), memdisk_size = 0; + struct grub_module_info *modinfo; + void *mods; grub_util_host_init (&argc, &argv); @@ -194,6 +213,33 @@ main (int argc, char *argv[]) exit(1); } + if (arguments.mem_disk) + { + memdisk_size = ALIGN_UP(grub_util_get_image_size (arguments.mem_disk), 512); + total_module_size += memdisk_size + sizeof (struct grub_module_header); + } + + mods = xmalloc (total_module_size); + modinfo = grub_memset (mods, 0, total_module_size); + mods = (char *) (modinfo + 1); + + modinfo->magic = GRUB_MODULE_MAGIC; + modinfo->offset = sizeof (struct grub_module_info); + modinfo->size = total_module_size; + + if (arguments.mem_disk) + { + struct grub_module_header *header = (struct grub_module_header *) mods; + header->type = OBJ_TYPE_MEMDISK; + header->size = memdisk_size + sizeof (*header); + mods = header + 1; + + grub_util_load_image (arguments.mem_disk, mods); + mods = (char *) mods + memdisk_size; + } + + grub_modbase = (grub_addr_t) modinfo; + hold = arguments.hold; /* Wait until the ARGS.HOLD variable is cleared by an attached debugger. */ if (hold && verbosity > 0) diff --git a/grub-core/kern/emu/misc.c b/grub-core/kern/emu/misc.c index bb606da28..76661337f 100644 --- a/grub-core/kern/emu/misc.c +++ b/grub-core/kern/emu/misc.c @@ -127,6 +127,7 @@ xasprintf (const char *fmt, ...) va_start (ap, fmt); result = grub_xvasprintf (fmt, ap); + va_end (ap); if (!result) grub_util_error ("%s", _("out of memory")); @@ -134,11 +135,13 @@ xasprintf (const char *fmt, ...) } #endif +#if !defined (GRUB_MACHINE_EMU) || defined (GRUB_UTIL) void grub_exit (void) { exit (1); } +#endif grub_uint64_t grub_get_time_ms (void) @@ -149,3 +152,51 @@ grub_get_time_ms (void) return (tv.tv_sec * 1000 + tv.tv_usec / 1000); } + +size_t +grub_util_get_image_size (const char *path) +{ + FILE *f; + size_t ret; + off_t sz; + + f = grub_util_fopen (path, "rb"); + + if (!f) + grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + + fseeko (f, 0, SEEK_END); + + sz = ftello (f); + if (sz < 0) + grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); + if (sz != (size_t) sz) + grub_util_error (_("file `%s' is too big"), path); + ret = (size_t) sz; + + fclose (f); + + return ret; +} + +void +grub_util_load_image (const char *path, char *buf) +{ + FILE *fp; + size_t size; + + grub_util_info ("reading %s", path); + + size = grub_util_get_image_size (path); + + fp = grub_util_fopen (path, "rb"); + if (! fp) + grub_util_error (_("cannot open `%s': %s"), path, + strerror (errno)); + + if (fread (buf, 1, size, fp) != size) + grub_util_error (_("cannot read `%s': %s"), path, + strerror (errno)); + + fclose (fp); +} diff --git a/grub-core/kern/i386/int.S b/grub-core/kern/i386/int.S index 7edace404..862a54202 100644 --- a/grub-core/kern/i386/int.S +++ b/grub-core/kern/i386/int.S @@ -44,6 +44,13 @@ FUNCTION(grub_bios_interrupt) movl 24(%edx), %esi movl 28(%edx), %edx + /* + Via C3 CPUs have cache coherence problems, so we need to call + wbinvd at these 2 points. As wbinvd slows down boot, don't do + it on non-VIA. 9090 is nop nop. */ +VARIABLE(grub_bios_via_workaround1) + .byte 0x90, 0x90 + PROT_TO_REAL .code16 pushf @@ -92,6 +99,10 @@ intno: movw %ax, LOCAL(bios_register_es) popf + +VARIABLE(grub_bios_via_workaround2) + .byte 0x90, 0x90 + REAL_TO_PROT .code32 diff --git a/grub-core/kern/i386/pc/init.c b/grub-core/kern/i386/pc/init.c index 3c8160aab..27bc68b8a 100644 --- a/grub-core/kern/i386/pc/init.c +++ b/grub-core/kern/i386/pc/init.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -184,6 +185,26 @@ mmap_iterate_hook (grub_uint64_t addr, grub_uint64_t size, return 0; } +extern grub_uint16_t grub_bios_via_workaround1, grub_bios_via_workaround2; + +/* Via needs additional wbinvd. */ +static void +grub_via_workaround_init (void) +{ + grub_uint32_t manufacturer[3], max_cpuid; + if (! grub_cpu_is_cpuid_supported ()) + return; + + grub_cpuid (0, max_cpuid, manufacturer[0], manufacturer[2], manufacturer[1]); + + if (grub_memcmp (manufacturer, "CentaurHauls", 12) != 0) + return; + + grub_bios_via_workaround1 = 0x090f; + grub_bios_via_workaround2 = 0x090f; + asm volatile ("wbinvd"); +} + void grub_machine_init (void) { @@ -193,6 +214,9 @@ grub_machine_init (void) #endif grub_addr_t modend; + /* This has to happen before any BIOS calls. */ + grub_via_workaround_init (); + grub_modbase = GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR + (_edata - _start); /* Initialize the console as early as possible. */ diff --git a/grub-core/kern/i386/tsc.c b/grub-core/kern/i386/tsc.c index 82cdea491..2e85289d8 100644 --- a/grub-core/kern/i386/tsc.c +++ b/grub-core/kern/i386/tsc.c @@ -43,22 +43,6 @@ grub_tsc_get_time_ms (void) return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate; } -static __inline int -grub_cpu_is_tsc_supported (void) -{ -#ifndef GRUB_MACHINE_XEN - grub_uint32_t a,b,c,d; - if (! grub_cpu_is_cpuid_supported ()) - return 0; - - grub_cpuid(1,a,b,c,d); - - return (d & (1 << 4)) != 0; -#else - return 1; -#endif -} - static int calibrate_tsc_hardcode (void) { diff --git a/grub-core/kern/i386/tsc_pmtimer.c b/grub-core/kern/i386/tsc_pmtimer.c index 6a47ab7be..c9c361699 100644 --- a/grub-core/kern/i386/tsc_pmtimer.c +++ b/grub-core/kern/i386/tsc_pmtimer.c @@ -24,129 +24,35 @@ #include #include #include +#include #include #include -static void * -grub_acpi_rsdt_find_table (struct grub_acpi_table_header *rsdt, const char *sig) -{ - grub_size_t s; - grub_uint32_t *ptr; - - if (!rsdt) - return 0; - - if (grub_memcmp (rsdt->signature, "RSDT", 4) != 0) - return 0; - - ptr = (grub_uint32_t *) (rsdt + 1); - s = (rsdt->length - sizeof (*rsdt)) / sizeof (grub_uint32_t); - for (; s; s--, ptr++) - { - struct grub_acpi_table_header *tbl; - tbl = (struct grub_acpi_table_header *) (grub_addr_t) *ptr; - if (grub_memcmp (tbl->signature, sig, 4) == 0) - return tbl; - } - return 0; -} - -static void * -grub_acpi_xsdt_find_table (struct grub_acpi_table_header *xsdt, const char *sig) -{ - grub_size_t s; - grub_uint64_t *ptr; - - if (!xsdt) - return 0; - - if (grub_memcmp (xsdt->signature, "XSDT", 4) != 0) - return 0; - - ptr = (grub_uint64_t *) (xsdt + 1); - s = (xsdt->length - sizeof (*xsdt)) / sizeof (grub_uint32_t); - for (; s; s--, ptr++) - { - struct grub_acpi_table_header *tbl; -#if GRUB_CPU_SIZEOF_VOID_P != 8 - if (*ptr >> 32) - continue; -#endif - tbl = (struct grub_acpi_table_header *) (grub_addr_t) *ptr; - if (grub_memcmp (tbl->signature, sig, 4) == 0) - return tbl; - } - return 0; -} - -struct grub_acpi_fadt * -grub_acpi_find_fadt (void) -{ - struct grub_acpi_fadt *fadt = 0; - struct grub_acpi_rsdp_v10 *rsdpv1; - struct grub_acpi_rsdp_v20 *rsdpv2; - rsdpv1 = grub_machine_acpi_get_rsdpv1 (); - if (rsdpv1) - fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv1->rsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); - if (fadt) - return fadt; - rsdpv2 = grub_machine_acpi_get_rsdpv2 (); - if (rsdpv2) - fadt = grub_acpi_rsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv2->rsdpv1.rsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); - if (fadt) - return fadt; - if (rsdpv2 -#if GRUB_CPU_SIZEOF_VOID_P != 8 - && !(rsdpv2->xsdt_addr >> 32) -#endif - ) - fadt = grub_acpi_xsdt_find_table ((struct grub_acpi_table_header *) - (grub_addr_t) rsdpv2->xsdt_addr, - GRUB_ACPI_FADT_SIGNATURE); - if (fadt) - return fadt; - return 0; -} - -int -grub_tsc_calibrate_from_pmtimer (void) +grub_uint64_t +grub_pmtimer_wait_count_tsc (grub_port_t pmtimer, + grub_uint16_t num_pm_ticks) { grub_uint32_t start; grub_uint32_t last; grub_uint32_t cur, end; - struct grub_acpi_fadt *fadt; - grub_port_t p; grub_uint64_t start_tsc; grub_uint64_t end_tsc; int num_iter = 0; - fadt = grub_acpi_find_fadt (); - if (!fadt) - return 0; - p = fadt->pmtimer; - if (!p) - return 0; - - start = grub_inl (p) & 0xffffff; + start = grub_inl (pmtimer) & 0xffffff; last = start; - /* It's 3.579545 MHz clock. Wait 1 ms. */ - end = start + 3580; + end = start + num_pm_ticks; start_tsc = grub_get_tsc (); while (1) { - cur = grub_inl (p) & 0xffffff; + cur = grub_inl (pmtimer) & 0xffffff; if (cur < last) cur |= 0x1000000; num_iter++; if (cur >= end) { end_tsc = grub_get_tsc (); - grub_tsc_rate = grub_divmod64 ((1ULL << 32), end_tsc - start_tsc, 0); - return 1; + return end_tsc - start_tsc; } /* Check for broken PM timer. 50000000 TSCs is between 5 ms (10GHz) and 200 ms (250 MHz) @@ -158,3 +64,25 @@ grub_tsc_calibrate_from_pmtimer (void) } } } + +int +grub_tsc_calibrate_from_pmtimer (void) +{ + struct grub_acpi_fadt *fadt; + grub_port_t pmtimer; + grub_uint64_t tsc_diff; + + fadt = grub_acpi_find_fadt (); + if (!fadt) + return 0; + pmtimer = fadt->pmtimer; + if (!pmtimer) + return 0; + + /* It's 3.579545 MHz clock. Wait 1 ms. */ + tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer, 3580); + if (tsc_diff == 0) + return 0; + grub_tsc_rate = grub_divmod64 ((1ULL << 32), tsc_diff, 0); + return 1; +} diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c index 4303509f2..12590225e 100644 --- a/grub-core/kern/ieee1275/init.c +++ b/grub-core/kern/ieee1275/init.c @@ -46,11 +46,19 @@ #define HEAP_MIN_SIZE (unsigned long) (2 * 1024 * 1024) /* The maximum heap size we're going to claim */ +#ifdef __i386__ +#define HEAP_MAX_SIZE (unsigned long) (64 * 1024 * 1024) +#else #define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024) +#endif /* If possible, we will avoid claiming heap above this address, because it seems to cause relocation problems with OSes that link at 4 MiB */ +#ifdef __i386__ +#define HEAP_MAX_ADDR (unsigned long) (64 * 1024 * 1024) +#else #define HEAP_MAX_ADDR (unsigned long) (32 * 1024 * 1024) +#endif extern char _start[]; extern char _end[]; diff --git a/grub-core/kern/ieee1275/mmap.c b/grub-core/kern/ieee1275/mmap.c index 911bb0011..bf325eadf 100644 --- a/grub-core/kern/ieee1275/mmap.c +++ b/grub-core/kern/ieee1275/mmap.c @@ -25,7 +25,7 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) { grub_ieee1275_phandle_t root; grub_ieee1275_phandle_t memory; - grub_uint32_t available[32]; + grub_uint32_t available[128]; grub_ssize_t available_size; grub_uint32_t address_cells = 1; grub_uint32_t size_cells = 1; @@ -49,6 +49,9 @@ grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data) sizeof available, &available_size)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine /memory/available property"); + if (available_size < 0 || (grub_size_t) available_size > sizeof (available)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "/memory response buffer exceeded"); if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS)) { diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 906d2c2f7..d1a54df6c 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -740,6 +740,12 @@ parse_printf_args (const char *fmt0, struct printf_args *args, fmt++; c = *fmt++; + if (c == '%') + { + n--; + continue; + } + if (c == 'l') { c = *fmt++; @@ -876,6 +882,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, if (c == '%') { write_char (str, &count, max_len,c); + n--; continue; } @@ -1099,6 +1106,8 @@ grub_fatal (const char *fmt, ...) grub_vprintf (_(fmt), ap); va_end (ap); + grub_refresh (); + grub_abort (); } diff --git a/grub-core/kern/mm.c b/grub-core/kern/mm.c index 1c3d02388..ee88ff611 100644 --- a/grub-core/kern/mm.c +++ b/grub-core/kern/mm.c @@ -325,6 +325,15 @@ grub_memalign (grub_size_t align, grub_size_t size) if (!grub_mm_base) goto fail; + if (size > ~(grub_size_t) align) + goto fail; + + /* We currently assume at least a 32-bit grub_size_t, + so limiting allocations to - 1MiB + in name of sanity is beneficial. */ + if ((size + align) > ~(grub_size_t) 0x100000) + goto fail; + align = (align >> GRUB_MM_ALIGN_LOG2); if (align == 0) align = 1; diff --git a/grub-core/kern/rescue_parser.c b/grub-core/kern/rescue_parser.c index ab3d04160..633836699 100644 --- a/grub-core/kern/rescue_parser.c +++ b/grub-core/kern/rescue_parser.c @@ -43,13 +43,17 @@ grub_rescue_parse_line (char *line, /* In case of an assignment set the environment accordingly instead of calling a function. */ - if (n == 1 && grub_strchr (line, '=')) + if (n == 1) { char *val = grub_strchr (args[0], '='); - val[0] = 0; - grub_env_set (args[0], val + 1); - val[0] = '='; - goto quit; + + if (val) + { + val[0] = 0; + grub_env_set (args[0], val + 1); + val[0] = '='; + goto quit; + } } /* Get the command name. */ @@ -72,6 +76,7 @@ grub_rescue_parse_line (char *line, } quit: + /* Arguments are returned in single memory chunk separated by zeroes */ grub_free (args[0]); grub_free (args); diff --git a/grub-core/lib/arm64/setjmp.S b/grub-core/lib/arm64/setjmp.S index eabfd99b2..ffcabf6e4 100644 --- a/grub-core/lib/arm64/setjmp.S +++ b/grub-core/lib/arm64/setjmp.S @@ -50,6 +50,7 @@ FUNCTION(grub_longjmp) ldp x29, x30, [x0], #16 ldr x2, [x0] mov sp, x2 + mov x0, #1 cmp x1, #0 csel x0, x1, x0, ne ret diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c index 7a7796a12..c3e03c727 100644 --- a/grub-core/lib/i386/backtrace.c +++ b/grub-core/lib/i386/backtrace.c @@ -56,11 +56,11 @@ void grub_backtrace (void) { #ifdef __x86_64__ - asm volatile ("movq %rbp, %rdi\n" - "call " EXT_C("grub_backtrace_pointer")); + asm volatile ("movq %%rbp, %%rdi\n" + "callq *%%rax": :"a"(grub_backtrace_pointer)); #else - asm volatile ("movl %ebp, %eax\n" - "call " EXT_C("grub_backtrace_pointer")); + asm volatile ("movl %%ebp, %%eax\n" + "calll *%%ecx": :"c"(grub_backtrace_pointer)); #endif } diff --git a/grub-core/lib/i386/random.c b/grub-core/lib/i386/random.c new file mode 100644 index 000000000..cd83d2f8f --- /dev/null +++ b/grub-core/lib/i386/random.c @@ -0,0 +1,103 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2016 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 int have_tsc = -1, have_pmtimer = -1; +static grub_port_t pmtimer_port; + +static int +detect_pmtimer (void) +{ + struct grub_acpi_fadt *fadt; + fadt = grub_acpi_find_fadt (); + if (!fadt) + return 0; + pmtimer_port = fadt->pmtimer; + if (!pmtimer_port) + return 0; + return 1; +} + +static int +pmtimer_tsc_get_random_bit (void) +{ + /* It's hard to come up with figures about pmtimer and tsc jitter but + 50 ppm seems to be typical. So we need 10^6/50 tsc cycles to get drift + of one tsc cycle. With TSC at least of 800 MHz it means 1/(50*800) + = 1/40000 s or about 3579545 / 40000 = 90 pmtimer ticks. + This gives us rate of 40000 bit/s or 5 kB/s. + */ + grub_uint64_t tsc_diff; + tsc_diff = grub_pmtimer_wait_count_tsc (pmtimer_port, 90); + if (tsc_diff == 0) + { + have_pmtimer = 0; + return -1; + } + return tsc_diff & 1; +} + +static int +pmtimer_tsc_get_random_byte (void) +{ + grub_uint8_t ret = 0; + int i, c; + for (i = 0; i < 8; i++) + { + c = pmtimer_tsc_get_random_bit (); + if (c < 0) + return -1; + ret |= c << i; + } + return ret; +} + +static int +pmtimer_fill_buffer (void *buffer, grub_size_t sz) +{ + grub_uint8_t *p = buffer; + int c; + while (sz) + { + c = pmtimer_tsc_get_random_byte (); + if (c < 0) + return 0; + *p++ = c; + sz--; + } + return 1; +} + +int +grub_crypto_arch_get_random (void *buffer, grub_size_t sz) +{ + if (have_tsc == -1) + have_tsc = grub_cpu_is_tsc_supported (); + if (!have_tsc) + return 0; + if (have_pmtimer == -1) + have_pmtimer = detect_pmtimer (); + if (!have_pmtimer) + return 0; + return pmtimer_fill_buffer (buffer, sz); +} diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S index e4648d818..75725cf75 100644 --- a/grub-core/lib/i386/relocator64.S +++ b/grub-core/lib/i386/relocator64.S @@ -73,6 +73,14 @@ VARIABLE(grub_relocator64_rsp) movq %rax, %rsp + /* + * Here is grub_relocator64_efi_start() entry point. + * Following code is shared between grub_relocator64_efi_start() + * and grub_relocator64_start(). + * + * Think twice before changing anything below!!! + */ +VARIABLE(grub_relocator64_efi_start) /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 @@ -120,6 +128,9 @@ LOCAL(jump_addr): VARIABLE(grub_relocator64_rip) .quad 0 + /* Here grub_relocator64_efi_start() ends. Ufff... */ +VARIABLE(grub_relocator64_efi_end) + #ifndef __x86_64__ .p2align 4 LOCAL(gdt): diff --git a/grub-core/lib/i386/xen/relocator.S b/grub-core/lib/i386/xen/relocator.S index 694a54c85..f1c729e8c 100644 --- a/grub-core/lib/i386/xen/relocator.S +++ b/grub-core/lib/i386/xen/relocator.S @@ -16,6 +16,8 @@ * along with GRUB. If not, see . */ +#include +#include #include #include @@ -23,78 +25,86 @@ VARIABLE(grub_relocator_xen_remap_start) LOCAL(base): - /* mov imm32, %ebx */ + /* Remap the remapper to it's new address. */ + /* mov imm32, %ebx - %ebx: new virtual address of remapper */ .byte 0xbb VARIABLE(grub_relocator_xen_remapper_virt) .long 0 - /* mov imm32, %ecx */ + /* mov imm32, %ecx - %ecx: low part of page table entry */ .byte 0xb9 VARIABLE(grub_relocator_xen_remapper_map) .long 0 - /* mov imm32, %edx */ + /* mov imm32, %edx - %edx: high part of page table entry */ .byte 0xba VARIABLE(grub_relocator_xen_remapper_map_high) .long 0 - movl %ebx, %ebp + movl %ebx, %ebp /* %ebx is clobbered by hypercall */ - movl $2, %esi + movl $UVMF_INVLPG, %esi /* esi: flags (inv. single entry) */ movl $__HYPERVISOR_update_va_mapping, %eax int $0x82 movl %ebp, %ebx addl $(LOCAL(cont) - LOCAL(base)), %ebx - jmp *%ebx + jmp *%ebx /* Continue with new virtual address */ LOCAL(cont): - xorl %eax, %eax - movl %eax, %ebp + /* Modify mappings of new page tables to be read-only. */ + /* mov imm32, %eax */ + .byte 0xb8 +VARIABLE(grub_relocator_xen_paging_areas_addr) + .long 0 + movl %eax, %ebx 1: + movl 0(%ebx), %ebp /* Get start pfn of the current area */ + movl GRUB_TARGET_SIZEOF_LONG(%ebx), %ecx /* Get # of pg tables */ + testl %ecx, %ecx /* 0 -> last area reached */ + jz 3f + addl $(2 * GRUB_TARGET_SIZEOF_LONG), %ebx + movl %ebx, %esp /* Save current area pointer */ +2: + movl %ecx, %edi /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_mfn_list) .long 0 - movl %eax, %edi - movl %ebp, %eax - movl 0(%edi, %eax, 4), %ecx - - /* mov imm32, %ebx */ - .byte 0xbb -VARIABLE(grub_relocator_xen_paging_start) - .long 0 - shll $12, %eax - addl %eax, %ebx + movl 0(%eax, %ebp, 4), %ecx /* mfn */ + movl %ebp, %ebx + shll $PAGE_SHIFT, %ebx /* virtual address (1:1 mapping) */ movl %ecx, %edx - shll $12, %ecx - shrl $20, %edx - orl $5, %ecx - movl $2, %esi + shll $PAGE_SHIFT, %ecx /* prepare pte low part */ + shrl $(32 - PAGE_SHIFT), %edx /* pte high part */ + orl $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %ecx /* pte low */ + movl $UVMF_INVLPG, %esi movl $__HYPERVISOR_update_va_mapping, %eax - int $0x82 + int $0x82 /* parameters: eax, ebx, ecx, edx, esi */ - incl %ebp - /* mov imm32, %ecx */ - .byte 0xb9 -VARIABLE(grub_relocator_xen_paging_size) - .long 0 - cmpl %ebp, %ecx + incl %ebp /* next pfn */ + movl %edi, %ecx - ja 1b + loop 2b + mov %esp, %ebx /* restore area poniter */ + jmp 1b + +3: + /* Switch page tables: pin new L3 pt, load cr3, unpin old L3. */ /* mov imm32, %ebx */ .byte 0xbb VARIABLE(grub_relocator_xen_mmu_op_addr) .long 0 - movl $3, %ecx - movl $0, %edx - movl $0x7FF0, %esi + movl $3, %ecx /* 3 mmu ops */ + movl $0, %edx /* pdone (not used) */ + movl $DOMID_SELF, %esi movl $__HYPERVISOR_mmuext_op, %eax int $0x82 + /* Continue in virtual kernel mapping. */ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_remap_continue) @@ -102,6 +112,9 @@ VARIABLE(grub_relocator_xen_remap_continue) jmp *%eax +VARIABLE(grub_relocator_xen_paging_areas) + .long 0, 0, 0, 0, 0, 0, 0, 0 + VARIABLE(grub_relocator_xen_mmu_op) .space 256 @@ -109,6 +122,7 @@ VARIABLE(grub_relocator_xen_remap_end) VARIABLE(grub_relocator_xen_start) + /* Unmap old remapper area. */ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_remapper_virt2) @@ -116,14 +130,14 @@ VARIABLE(grub_relocator_xen_remapper_virt2) movl %eax, %edi - xorl %ecx, %ecx + xorl %ecx, %ecx /* Invalid pte */ xorl %edx, %edx - movl $2, %esi + movl $UVMF_INVLPG, %esi movl $__HYPERVISOR_update_va_mapping, %eax int $0x82 - + /* Prepare registers for starting kernel. */ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_relocator_xen_stack) @@ -145,6 +159,7 @@ VARIABLE(grub_relocator_xen_start_info) VARIABLE(grub_relocator_xen_entry_point) .long 0 + /* Now start the new kernel. */ jmp *%eax VARIABLE(grub_relocator_xen_end) diff --git a/grub-core/lib/ieee1275/datetime.c b/grub-core/lib/ieee1275/datetime.c index 74578f15a..b81fba2ed 100644 --- a/grub-core/lib/ieee1275/datetime.c +++ b/grub-core/lib/ieee1275/datetime.c @@ -95,7 +95,7 @@ grub_get_datetime (struct grub_datetime *datetime) datetime->year = args.year; datetime->month = args.month; - datetime->day = args.day; + datetime->day = args.day + 1; datetime->hour = args.hour; datetime->minute = args.minute; datetime->second = args.second; @@ -140,7 +140,7 @@ grub_set_datetime (struct grub_datetime *datetime) args.year = datetime->year; args.month = datetime->month; - args.day = datetime->day; + args.day = datetime->day - 1; args.hour = datetime->hour; args.minute = datetime->minute; args.second = datetime->second; diff --git a/grub-core/lib/pbkdf2.c b/grub-core/lib/pbkdf2.c index 01cee3951..28aa96c46 100644 --- a/grub-core/lib/pbkdf2.c +++ b/grub-core/lib/pbkdf2.c @@ -31,7 +31,6 @@ GRUB_MOD_LICENSE ("GPLv2+"); desired derived output length DKLEN. Output buffer is DK which must have room for at least DKLEN octets. The output buffer will be filled with the derived data. */ -#pragma GCC diagnostic ignored "-Wunreachable-code" gcry_err_code_t grub_crypto_pbkdf2 (const struct gcry_md_spec *md, diff --git a/grub-core/lib/progress.c b/grub-core/lib/progress.c index 95a4a6281..4b7cbbca6 100644 --- a/grub-core/lib/progress.c +++ b/grub-core/lib/progress.c @@ -38,11 +38,17 @@ grub_file_progress_hook_real (grub_disk_addr_t sector __attribute__ ((unused)), grub_uint64_t now; static grub_uint64_t last_progress_update_time; grub_file_t file = data; + const char *e; file->progress_offset += length; if (call_depth) return; + e = grub_env_get ("enable_progress_indicator"); + if (e && e[0] == '0') { + return; + } + call_depth = 1; now = grub_get_time_ms (); diff --git a/grub-core/lib/random.c b/grub-core/lib/random.c new file mode 100644 index 000000000..43b966438 --- /dev/null +++ b/grub-core/lib/random.c @@ -0,0 +1,120 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2016 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 + +GRUB_MOD_LICENSE ("GPLv3+"); + +grub_err_t +grub_crypto_get_random (void *buffer, grub_size_t sz) +{ + /* This is an arbitrer between different methods. + TODO: Add more methods in the future. */ + /* TODO: Add some PRNG smartness to reduce damage from bad entropy. */ + if (grub_crypto_arch_get_random (buffer, sz)) + return GRUB_ERR_NONE; + return grub_error (GRUB_ERR_IO, "no random sources found"); +} + +static int +get_num_digits (int val) +{ + int ret = 0; + while (val != 0) + { + ret++; + val /= 10; + } + if (ret == 0) + return 1; + return ret; +} + +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + +static grub_err_t +grub_cmd_hexdump_random (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) +{ + grub_size_t length = 64; + grub_err_t err; + void *buffer; + grub_uint8_t *ptr; + int stats[256]; + int i, digits = 2; + char template[10]; + + if (argc >= 1) + length = grub_strtoull (args[0], 0, 0); + + if (length == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "length pust be positive"); + + buffer = grub_malloc (length); + if (!buffer) + return grub_errno; + + err = grub_crypto_get_random (buffer, length); + if (err) + { + grub_free (buffer); + return err; + } + + hexdump (0, buffer, length); + grub_memset(stats, 0, sizeof(stats)); + for (ptr = buffer; ptr < (grub_uint8_t *) buffer + length; ptr++) + stats[*ptr]++; + grub_printf ("Statistics:\n"); + for (i = 0; i < 256; i++) + { + int z = get_num_digits (stats[i]); + if (z > digits) + digits = z; + } + + grub_snprintf (template, sizeof (template), "%%0%dd ", digits); + + for (i = 0; i < 256; i++) + { + grub_printf ("%s", template);//, stats[i]); + if ((i & 0xf) == 0xf) + grub_printf ("\n"); + } + + grub_free (buffer); + + return 0; +} + +static grub_command_t cmd; + +GRUB_MOD_INIT (random) +{ + cmd = grub_register_command ("hexdump_random", grub_cmd_hexdump_random, + N_("[LENGTH]"), + N_("Hexdump random data.")); +} + +GRUB_MOD_FINI (random) +{ + grub_unregister_command (cmd); +} diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c index f759c7f41..ea3ebc719 100644 --- a/grub-core/lib/relocator.c +++ b/grub-core/lib/relocator.c @@ -736,26 +736,36 @@ malloc_in_range (struct grub_relocator *rel, } isinsideafter = (!ncollisions && (nstarted || ((nlefto || nstartedfw) && !nblockfw))); - if (!isinsidebefore && isinsideafter) - starta = from_low_priv ? ALIGN_UP (events[j].pos, align) - : ALIGN_DOWN (events[j].pos - size, align) + size; - if (isinsidebefore && !isinsideafter && from_low_priv) - { - target = starta; - if (target < start) - target = start; - if (target + size <= end && target + size <= events[j].pos) - /* Found an usable address. */ - goto found; - } - if (isinsidebefore && !isinsideafter && !from_low_priv) - { - target = starta - size; - if (target > end - size) - target = end - size; - if (target >= start && target >= events[j].pos) - goto found; - } + if (from_low_priv) { + if (!isinsidebefore && isinsideafter) + starta = ALIGN_UP (events[j].pos, align); + + if (isinsidebefore && !isinsideafter) + { + target = starta; + if (target < start) + target = start; + if (target + size <= end && target + size <= events[j].pos) + /* Found an usable address. */ + goto found; + } + } else { + if (!isinsidebefore && isinsideafter) + { + if (events[j].pos >= size) + starta = ALIGN_DOWN (events[j].pos - size, align) + size; + else + starta = 0; + } + if (isinsidebefore && !isinsideafter && starta >= size) + { + target = starta - size; + if (target > end - size) + target = end - size; + if (target >= start && target >= events[j].pos) + goto found; + } + } } } diff --git a/grub-core/lib/x86_64/efi/relocator.c b/grub-core/lib/x86_64/efi/relocator.c new file mode 100644 index 000000000..3caef7a40 --- /dev/null +++ b/grub-core/lib/x86_64/efi/relocator.c @@ -0,0 +1,80 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * Copyright (C) 2016 Oracle and/or its affiliates. All rights reserved. + * + * 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 +#include + +extern grub_uint64_t grub_relocator64_rax; +extern grub_uint64_t grub_relocator64_rbx; +extern grub_uint64_t grub_relocator64_rcx; +extern grub_uint64_t grub_relocator64_rdx; +extern grub_uint64_t grub_relocator64_rip; +extern grub_uint64_t grub_relocator64_rsi; + +extern grub_uint8_t grub_relocator64_efi_start; +extern grub_uint8_t grub_relocator64_efi_end; + +#define RELOCATOR_SIZEOF(x) (&grub_relocator##x##_end - &grub_relocator##x##_start) + +grub_err_t +grub_relocator64_efi_boot (struct grub_relocator *rel, + struct grub_relocator64_efi_state state) +{ + grub_err_t err; + void *relst; + grub_relocator_chunk_t ch; + + /* + * 64-bit relocator code may live above 4 GiB quite well. + * However, I do not want ask for problems. Just in case. + */ + err = grub_relocator_alloc_chunk_align (rel, &ch, 0, + 0x100000000 - RELOCATOR_SIZEOF (64_efi), + RELOCATOR_SIZEOF (64_efi), 16, + GRUB_RELOCATOR_PREFERENCE_NONE, 1); + if (err) + return err; + + /* Do not touch %rsp! It points to EFI created stack. */ + grub_relocator64_rax = state.rax; + grub_relocator64_rbx = state.rbx; + grub_relocator64_rcx = state.rcx; + grub_relocator64_rdx = state.rdx; + grub_relocator64_rip = state.rip; + grub_relocator64_rsi = state.rsi; + + grub_memmove (get_virtual_current_address (ch), &grub_relocator64_efi_start, + RELOCATOR_SIZEOF (64_efi)); + + err = grub_relocator_prepare_relocs (rel, get_physical_target_address (ch), + &relst, NULL); + if (err) + return err; + + ((void (*) (void)) relst) (); + + /* Not reached. */ + return GRUB_ERR_NONE; +} diff --git a/grub-core/lib/x86_64/xen/relocator.S b/grub-core/lib/x86_64/xen/relocator.S index 78c123350..f5364ed0f 100644 --- a/grub-core/lib/x86_64/xen/relocator.S +++ b/grub-core/lib/x86_64/xen/relocator.S @@ -16,94 +16,85 @@ * along with GRUB. If not, see . */ +#include +#include #include #include +/* Macro to load an imm64 value stored by the C-part into %rax: */ +#define MOV_IMM64_RAX(var) .byte 0x48, 0xb8; VARIABLE(var); .quad 0 + .p2align 4 /* force 16-byte alignment */ VARIABLE(grub_relocator_xen_remap_start) LOCAL(base): - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_virt) - .quad 0 + /* Remap the remapper to it's new address. */ + MOV_IMM64_RAX(grub_relocator_xen_remapper_virt) - movq %rax, %rdi - movq %rax, %rbx + movq %rax, %rdi /* %rdi: new virtual address of remapper */ + movq %rax, %rbx /* Remember new virtual address */ - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_map) - .quad 0 + MOV_IMM64_RAX(grub_relocator_xen_remapper_map) - movq %rax, %rsi + movq %rax, %rsi /* %rsi: page table entry */ - movq $2, %rdx + movq $UVMF_INVLPG, %rdx /* %rdx: flags (inv. single entry) */ movq $__HYPERVISOR_update_va_mapping, %rax - syscall + syscall /* Do the remap operation */ addq $(LOCAL(cont) - LOCAL(base)), %rbx - jmp *%rbx + jmp *%rbx /* Continue with new virtual address */ LOCAL(cont): - - /* mov imm64, %rcx */ - .byte 0x48 - .byte 0xb9 -VARIABLE(grub_relocator_xen_paging_size) - .quad 0 + /* Modify mappings of new page tables to be read-only. */ + MOV_IMM64_RAX(grub_relocator_xen_mfn_list) - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_paging_start) - .quad 0 + movq %rax, %rbx /* %rbx is the base of the p2m list */ + leaq EXT_C(grub_relocator_xen_paging_areas) (%rip), %r8 - movq %rax, %r12 - - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_mfn_list) - .quad 0 - - movq %rax, %rsi 1: + movq 0(%r8), %r12 /* Get start pfn of the current area */ + movq GRUB_TARGET_SIZEOF_LONG(%r8), %rcx /* Get # of pg tables */ + testq %rcx, %rcx /* 0 -> last area reached */ + jz 3f +2: movq %r12, %rdi - movq %rsi, %rbx - movq 0(%rsi), %rsi - shlq $12, %rsi - orq $5, %rsi - movq $2, %rdx - movq %rcx, %r9 + shlq $PAGE_SHIFT, %rdi /* virtual address (1:1 mapping) */ + movq (%rbx, %r12, 8), %rsi /* mfn */ + shlq $PAGE_SHIFT, %rsi + orq $(GRUB_PAGE_PRESENT | GRUB_PAGE_USER), %rsi /* Build pte */ + movq $UVMF_INVLPG, %rdx + movq %rcx, %r9 /* %rcx clobbered by hypercall */ movq $__HYPERVISOR_update_va_mapping, %rax syscall movq %r9, %rcx - addq $8, %rbx - addq $4096, %r12 - movq %rbx, %rsi + incq %r12 /* next pfn */ - loop 1b + loop 2b + addq $(2 * GRUB_TARGET_SIZEOF_LONG), %r8 /* next pg table area */ + jmp 1b + +3: + /* Switch page tables: pin new L4 pt, load cr3, unpin old L4. */ leaq EXT_C(grub_relocator_xen_mmu_op) (%rip), %rdi - movq $3, %rsi - movq $0, %rdx - movq $0x7FF0, %r10 + movq $3, %rsi /* 3 mmu ops */ + movq $0, %rdx /* pdone (not used) */ + movq $DOMID_SELF, %r10 movq $__HYPERVISOR_mmuext_op, %rax syscall - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remap_continue) - .quad 0 + /* Continue in virtual kernel mapping. */ + MOV_IMM64_RAX(grub_relocator_xen_remap_continue) jmp *%rax +VARIABLE(grub_relocator_xen_paging_areas) + /* array of start, size pairs, size 0 is end marker */ + .quad 0, 0, 0, 0, 0, 0, 0, 0 + VARIABLE(grub_relocator_xen_mmu_op) .space 256 @@ -111,46 +102,32 @@ VARIABLE(grub_relocator_xen_remap_end) VARIABLE(grub_relocator_xen_start) - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_remapper_virt2) - .quad 0 + /* Unmap old remapper area. */ + MOV_IMM64_RAX(grub_relocator_xen_remapper_virt2) movq %rax, %rdi - xorq %rax, %rax + xorq %rax, %rax /* Invalid pte */ movq %rax, %rsi - movq $2, %rdx + movq $UVMF_INVLPG, %rdx movq $__HYPERVISOR_update_va_mapping, %rax syscall - - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_stack) - .quad 0 + /* Prepare registers for starting kernel. */ + MOV_IMM64_RAX(grub_relocator_xen_stack) movq %rax, %rsp - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_start_info) - .quad 0 + MOV_IMM64_RAX(grub_relocator_xen_start_info) movq %rax, %rsi cld - /* mov imm64, %rax */ - .byte 0x48 - .byte 0xb8 -VARIABLE(grub_relocator_xen_entry_point) - .quad 0 + MOV_IMM64_RAX(grub_relocator_xen_entry_point) + /* Now start the new kernel. */ jmp *%rax VARIABLE(grub_relocator_xen_end) diff --git a/grub-core/lib/xen/relocator.c b/grub-core/lib/xen/relocator.c index 8f427d341..4d0cbcadb 100644 --- a/grub-core/lib/xen/relocator.c +++ b/grub-core/lib/xen/relocator.c @@ -29,6 +29,11 @@ typedef grub_addr_t grub_xen_reg_t; +struct grub_relocator_xen_paging_area { + grub_xen_reg_t start; + grub_xen_reg_t size; +} GRUB_PACKED; + extern grub_uint8_t grub_relocator_xen_start; extern grub_uint8_t grub_relocator_xen_end; extern grub_uint8_t grub_relocator_xen_remap_start; @@ -36,15 +41,16 @@ extern grub_uint8_t grub_relocator_xen_remap_end; extern grub_xen_reg_t grub_relocator_xen_stack; extern grub_xen_reg_t grub_relocator_xen_start_info; extern grub_xen_reg_t grub_relocator_xen_entry_point; -extern grub_xen_reg_t grub_relocator_xen_paging_start; -extern grub_xen_reg_t grub_relocator_xen_paging_size; extern grub_xen_reg_t grub_relocator_xen_remapper_virt; extern grub_xen_reg_t grub_relocator_xen_remapper_virt2; extern grub_xen_reg_t grub_relocator_xen_remapper_map; extern grub_xen_reg_t grub_relocator_xen_mfn_list; +extern struct grub_relocator_xen_paging_area + grub_relocator_xen_paging_areas[XEN_MAX_MAPPINGS]; extern grub_xen_reg_t grub_relocator_xen_remap_continue; #ifdef __i386__ extern grub_xen_reg_t grub_relocator_xen_mmu_op_addr; +extern grub_xen_reg_t grub_relocator_xen_paging_areas_addr; extern grub_xen_reg_t grub_relocator_xen_remapper_map_high; #endif extern mmuext_op_t grub_relocator_xen_mmu_op[3]; @@ -61,6 +67,7 @@ grub_relocator_xen_boot (struct grub_relocator *rel, { grub_err_t err; void *relst; + int i; grub_relocator_chunk_t ch, ch_tramp; grub_xen_mfn_t *mfn_list = (grub_xen_mfn_t *) grub_xen_start_page_addr->mfn_list; @@ -77,8 +84,11 @@ grub_relocator_xen_boot (struct grub_relocator *rel, grub_relocator_xen_stack = state.stack; grub_relocator_xen_start_info = state.start_info; grub_relocator_xen_entry_point = state.entry_point; - grub_relocator_xen_paging_start = state.paging_start << 12; - grub_relocator_xen_paging_size = state.paging_size; + for (i = 0; i < XEN_MAX_MAPPINGS; i++) + { + grub_relocator_xen_paging_areas[i].start = state.paging_start[i]; + grub_relocator_xen_paging_areas[i].size = state.paging_size[i]; + } grub_relocator_xen_remapper_virt = remapper_virt; grub_relocator_xen_remapper_virt2 = remapper_virt; grub_relocator_xen_remap_continue = trampoline_virt; @@ -88,10 +98,12 @@ grub_relocator_xen_boot (struct grub_relocator *rel, grub_relocator_xen_remapper_map_high = (mfn_list[remapper_pfn] >> 20); grub_relocator_xen_mmu_op_addr = (char *) &grub_relocator_xen_mmu_op - (char *) &grub_relocator_xen_remap_start + remapper_virt; + grub_relocator_xen_paging_areas_addr = + (char *) &grub_relocator_xen_paging_areas + - (char *) &grub_relocator_xen_remap_start + remapper_virt; #endif - grub_relocator_xen_mfn_list = state.mfn_list - + state.paging_start * sizeof (grub_addr_t); + grub_relocator_xen_mfn_list = state.mfn_list; grub_memset (grub_relocator_xen_mmu_op, 0, sizeof (grub_relocator_xen_mmu_op)); @@ -100,9 +112,9 @@ grub_relocator_xen_boot (struct grub_relocator *rel, #else grub_relocator_xen_mmu_op[0].cmd = MMUEXT_PIN_L4_TABLE; #endif - grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start]; + grub_relocator_xen_mmu_op[0].arg1.mfn = mfn_list[state.paging_start[0]]; grub_relocator_xen_mmu_op[1].cmd = MMUEXT_NEW_BASEPTR; - grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start]; + grub_relocator_xen_mmu_op[1].arg1.mfn = mfn_list[state.paging_start[0]]; grub_relocator_xen_mmu_op[2].cmd = MMUEXT_UNPIN_TABLE; grub_relocator_xen_mmu_op[2].arg1.mfn = mfn_list[grub_xen_start_page_addr->pt_base >> 12]; diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/arm64/fdt.c index 5202c14e0..db49cf649 100644 --- a/grub-core/loader/arm64/fdt.c +++ b/grub-core/loader/arm64/fdt.c @@ -28,28 +28,6 @@ static void *loaded_fdt; static void *fdt; -static void * -get_firmware_fdt (void) -{ - grub_efi_configuration_table_t *tables; - grub_efi_guid_t fdt_guid = GRUB_EFI_DEVICE_TREE_GUID; - void *firmware_fdt = NULL; - unsigned int i; - - /* Look for FDT in UEFI config tables. */ - tables = grub_efi_system_table->configuration_table; - - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - if (grub_memcmp (&tables[i].vendor_guid, &fdt_guid, sizeof (fdt_guid)) == 0) - { - firmware_fdt = tables[i].vendor_table; - grub_dprintf ("linux", "found registered FDT @ %p\n", firmware_fdt); - break; - } - - return firmware_fdt; -} - void * grub_fdt_load (grub_size_t additional_size) { @@ -65,7 +43,7 @@ grub_fdt_load (grub_size_t additional_size) if (loaded_fdt) raw_fdt = loaded_fdt; else - raw_fdt = get_firmware_fdt(); + raw_fdt = grub_efi_get_firmware_fdt(); size = raw_fdt ? grub_fdt_get_totalsize (raw_fdt) : GRUB_FDT_EMPTY_TREE_SZ; diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index d1a218929..a914eb8e2 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -37,16 +37,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); #define XEN_HYPERVISOR_NAME "xen_hypervisor" - -#define MODULE_DEFAULT_ALIGN (0x0) -#define MODULE_IMAGE_MIN_ALIGN MODULE_DEFAULT_ALIGN -#define MODULE_INITRD_MIN_ALIGN MODULE_DEFAULT_ALIGN -#define MODULE_XSM_MIN_ALIGN MODULE_DEFAULT_ALIGN -#define MODULE_CUSTOM_MIN_ALIGN MODULE_DEFAULT_ALIGN - -#define MODULE_IMAGE_COMPATIBLE "multiboot,kernel\0multiboot,module" -#define MODULE_INITRD_COMPATIBLE "multiboot,ramdisk\0multiboot,module" -#define MODULE_XSM_COMPATIBLE "xen,xsm-policy\0multiboot,module" #define MODULE_CUSTOM_COMPATIBLE "multiboot,module" /* This maximum size is defined in Power.org ePAPR V1.1 @@ -74,14 +64,6 @@ enum module_type }; typedef enum module_type module_type_t; -struct fdt_node_info -{ - module_type_t type; - - const char *compat_string; - grub_size_t compat_string_size; -}; - struct xen_hypervisor_header { struct grub_arm64_linux_kernel_header efi_head; @@ -98,7 +80,7 @@ struct xen_boot_binary { struct xen_boot_binary *next; struct xen_boot_binary **prev; - const char *name; + int is_hypervisor; grub_addr_t start; grub_size_t size; @@ -106,8 +88,6 @@ struct xen_boot_binary char *cmdline; int cmdline_size; - - struct fdt_node_info node_info; }; static grub_dl_t my_mod; @@ -116,19 +96,6 @@ static int loaded; static struct xen_boot_binary *xen_hypervisor; static struct xen_boot_binary *module_head; -static const grub_size_t module_default_align[] = { - MODULE_IMAGE_MIN_ALIGN, - MODULE_INITRD_MIN_ALIGN, - MODULE_XSM_MIN_ALIGN, - MODULE_CUSTOM_MIN_ALIGN -}; - -static const compat_string_struct_t default_compat_string[] = { - FDT_COMPATIBLE (MODULE_IMAGE_COMPATIBLE), - FDT_COMPATIBLE (MODULE_INITRD_COMPATIBLE), - FDT_COMPATIBLE (MODULE_XSM_COMPATIBLE), - FDT_COMPATIBLE (MODULE_CUSTOM_COMPATIBLE) -}; static __inline grub_addr_t xen_boot_address_align (grub_addr_t start, grub_size_t align) @@ -136,20 +103,6 @@ xen_boot_address_align (grub_addr_t start, grub_size_t align) return (align ? (ALIGN_UP (start, align)) : start); } -/* set module type according to command name. */ -static grub_err_t -set_module_type (grub_command_t cmd, struct xen_boot_binary *module) -{ - if (!grub_strcmp (cmd->name, "xen_linux")) - module->node_info.type = MODULE_IMAGE; - else if (!grub_strcmp (cmd->name, "xen_initrd")) - module->node_info.type = MODULE_INITRD; - else if (!grub_strcmp (cmd->name, "xen_xsm")) - module->node_info.type = MODULE_XSM; - - return GRUB_ERR_NONE; -} - static grub_err_t prepare_xen_hypervisor_params (void *xen_boot_fdt) { @@ -203,15 +156,11 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) grub_fdt_add_subnode (xen_boot_fdt, chosen_node, module_name); retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "compatible", - module->node_info.compat_string, - (grub_uint32_t) module-> - node_info.compat_string_size); + MODULE_CUSTOM_COMPATIBLE, sizeof(MODULE_CUSTOM_COMPATIBLE) - 1); if (retval) return grub_error (GRUB_ERR_IO, "failed to update FDT"); - grub_dprintf ("xen_loader", "Module %s compatible = %s size = 0x%lx\n", - module->name, module->node_info.compat_string, - module->node_info.compat_string_size); + grub_dprintf ("xen_loader", "Module\n"); retval = grub_fdt_set_reg64 (xen_boot_fdt, module_node, xen_boot_address_align (module->start, @@ -223,7 +172,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) if (module->cmdline && module->cmdline_size > 0) { grub_dprintf ("xen_loader", - "Module %s cmdline : %s @ %p size:%d\n", module->name, + "Module cmdline : %s @ %p size:%d\n", module->cmdline, module->cmdline, module->cmdline_size); retval = grub_fdt_set_prop (xen_boot_fdt, module_node, "bootargs", @@ -233,8 +182,7 @@ prepare_xen_module_params (struct xen_boot_binary *module, void *xen_boot_fdt) } else { - grub_dprintf ("xen_loader", "Module %s has not bootargs!\n", - module->name); + grub_dprintf ("xen_loader", "Module has no bootargs!\n"); } return GRUB_ERR_NONE; @@ -251,8 +199,8 @@ finalize_params_xen_boot (void) additional_size += FDT_NODE_NAME_MAX_SIZE + xen_hypervisor->cmdline_size; FOR_LIST_ELEMENTS (module, module_head) { - additional_size += 6 * FDT_NODE_NAME_MAX_SIZE + module-> - node_info.compat_string_size + module->cmdline_size; + additional_size += 6 * FDT_NODE_NAME_MAX_SIZE + sizeof(MODULE_CUSTOM_COMPATIBLE) - 1 + + module->cmdline_size; } xen_boot_fdt = grub_fdt_load (additional_size); @@ -275,8 +223,7 @@ finalize_params_xen_boot (void) { if (module->start && module->size > 0) { - grub_dprintf ("xen_loader", "Module %s @ 0x%lx size:0x%lx\n", - module->name, + grub_dprintf ("xen_loader", "Module @ 0x%lx size:0x%lx\n", xen_boot_address_align (module->start, module->align), module->size); if (prepare_xen_module_params (module, xen_boot_fdt) != GRUB_ERR_NONE) @@ -284,7 +231,7 @@ finalize_params_xen_boot (void) } else { - grub_dprintf ("xen_loader", "Module info error: %s!\n", module->name); + grub_dprintf ("xen_loader", "Module info error!\n"); goto fail; } } @@ -327,19 +274,16 @@ single_binary_unload (struct xen_boot_binary *binary) { grub_free (binary->cmdline); grub_dprintf ("xen_loader", - "Module %s cmdline memory free @ %p size: %d\n", - binary->name, binary->cmdline, binary->cmdline_size); + "Module cmdline memory free @ %p size: %d\n", + binary->cmdline, binary->cmdline_size); } - if (binary->node_info.type == MODULE_CUSTOM) - grub_free ((void *) binary->node_info.compat_string); - - if (grub_strcmp (binary->name, XEN_HYPERVISOR_NAME)) + if (!binary->is_hypervisor) grub_list_remove (GRUB_AS_LIST (binary)); grub_dprintf ("xen_loader", - "Module %s struct memory free @ %p size: 0x%lx\n", - binary->name, binary, sizeof (binary)); + "Module struct memory free @ %p size: 0x%lx\n", + binary, sizeof (binary)); grub_free (binary); return; @@ -377,8 +321,7 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, int argc, char *argv[]) { binary->size = grub_file_size (file); - grub_dprintf ("xen_loader", "Xen_boot %s file size: 0x%lx\n", - binary->name, binary->size); + grub_dprintf ("xen_loader", "Xen_boot file size: 0x%lx\n", binary->size); binary->start = (grub_addr_t) grub_efi_allocate_pages (0, @@ -391,8 +334,8 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, return; } - grub_dprintf ("xen_loader", "Xen_boot %s numpages: 0x%lx\n", - binary->name, GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); + grub_dprintf ("xen_loader", "Xen_boot numpages: 0x%lx\n", + GRUB_EFI_BYTES_TO_PAGES (binary->size + binary->align)); if (grub_file_read (file, (void *) xen_boot_address_align (binary->start, binary->align), @@ -416,7 +359,7 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, grub_create_loader_cmdline (argc - 1, argv + 1, binary->cmdline, binary->cmdline_size); grub_dprintf ("xen_loader", - "Xen_boot %s cmdline @ %p %s, size: %d\n", binary->name, + "Xen_boot cmdline @ %p %s, size: %d\n", binary->cmdline, binary->cmdline, binary->cmdline_size); } else @@ -430,7 +373,8 @@ xen_boot_binary_load (struct xen_boot_binary *binary, grub_file_t file, } static grub_err_t -grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) +grub_cmd_xen_module (grub_command_t cmd __attribute__((unused)), + int argc, char *argv[]) { struct xen_boot_binary *module = NULL; @@ -454,34 +398,10 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) if (!module) return grub_errno; - /* process all the options and get module type */ - if (set_module_type (cmd, module) != GRUB_ERR_NONE) - goto fail; - switch (module->node_info.type) - { - case MODULE_IMAGE: - case MODULE_INITRD: - case MODULE_XSM: - module->node_info.compat_string = - default_compat_string[module->node_info.type].compat_string; - module->node_info.compat_string_size = - default_compat_string[module->node_info.type].size; - break; + module->is_hypervisor = 0; + module->align = 4096; - case MODULE_CUSTOM: - /* we have set the node_info in set_module_type */ - break; - - default: - return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid argument")); - } - module->name = module->node_info.compat_string; - module->align = module_default_align[module->node_info.type]; - - grub_dprintf ("xen_loader", "Init %s module and node info:\n" - "compatible %s\ncompat_string_size 0x%lx\n", - module->name, module->node_info.compat_string, - module->node_info.compat_string_size); + grub_dprintf ("xen_loader", "Init module and node info\n"); file = grub_file_open (argv[0]); if (!file) @@ -491,7 +411,7 @@ grub_cmd_xen_module (grub_command_t cmd, int argc, char *argv[]) if (grub_errno == GRUB_ERR_NONE) grub_list_push (GRUB_AS_LIST_P (&module_head), GRUB_AS_LIST (module)); -fail: + fail: if (file) grub_file_close (file); if (grub_errno != GRUB_ERR_NONE) @@ -535,7 +455,7 @@ grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)), if (!xen_hypervisor) return grub_errno; - xen_hypervisor->name = XEN_HYPERVISOR_NAME; + xen_hypervisor->is_hypervisor = 1; xen_hypervisor->align = (grub_size_t) sh.optional_header.section_alignment; xen_boot_binary_load (xen_hypervisor, file, argc, argv); @@ -559,29 +479,21 @@ fail: } static grub_command_t cmd_xen_hypervisor; -static grub_command_t cmd_xen_linux, cmd_xen_initrd, cmd_xen_xsm; +static grub_command_t cmd_xen_module; GRUB_MOD_INIT (xen_boot) { cmd_xen_hypervisor = grub_register_command ("xen_hypervisor", grub_cmd_xen_hypervisor, 0, N_("Load a xen hypervisor.")); - cmd_xen_linux = - grub_register_command ("xen_linux", grub_cmd_xen_module, 0, - N_("Load a xen linux kernel for dom0.")); - cmd_xen_initrd = - grub_register_command ("xen_initrd", grub_cmd_xen_module, 0, - N_("Load a xen initrd for dom0.")); - cmd_xen_xsm = - grub_register_command ("xen_xsm", grub_cmd_xen_module, 0, - N_("Load a xen security module.")); + cmd_xen_module = + grub_register_command ("xen_module", grub_cmd_xen_module, 0, + N_("Load a xen module.")); my_mod = mod; } GRUB_MOD_FINI (xen_boot) { grub_unregister_command (cmd_xen_hypervisor); - grub_unregister_command (cmd_xen_linux); - grub_unregister_command (cmd_xen_initrd); - grub_unregister_command (cmd_xen_xsm); + grub_unregister_command (cmd_xen_module); } diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c index 522a716e3..adc856366 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -122,6 +122,8 @@ copy_file_path (grub_efi_file_path_device_path_t *fp, if (*p == '/') *p = '\\'; + /* File Path is NULL terminated */ + fp->path_name[size++] = '\0'; fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp); } @@ -156,8 +158,10 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) d = GRUB_EFI_NEXT_DEVICE_PATH (d); } + /* File Path is NULL terminated. Allocate space for 2 extra characters */ + /* FIXME why we split path in two components? */ file_path = grub_malloc (size - + ((grub_strlen (dir_start) + 1) + + ((grub_strlen (dir_start) + 2) * GRUB_MAX_UTF16_PER_UTF8 * sizeof (grub_efi_char16_t)) + sizeof (grub_efi_file_path_device_path_t) * 2); diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c index bc377b362..7f96515da 100644 --- a/grub-core/loader/i386/bsd.c +++ b/grub-core/loader/i386/bsd.c @@ -1889,6 +1889,10 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), grub_err_t err; void *src; + if (! grub_loader_is_loaded ()) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + if (kernel_type != KERNEL_TYPE_FREEBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no FreeBSD loaded"); @@ -1992,6 +1996,10 @@ grub_cmd_netbsd_module (grub_command_t cmd, { grub_uint32_t type; + if (! grub_loader_is_loaded ()) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + if (kernel_type != KERNEL_TYPE_NETBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no NetBSD loaded"); @@ -2070,6 +2078,10 @@ grub_cmd_openbsd_ramdisk (grub_command_t cmd __attribute__ ((unused)), if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + if (! grub_loader_is_loaded ()) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + N_("you need to load the kernel first")); + if (kernel_type != KERNEL_TYPE_OPENBSD) return grub_error (GRUB_ERR_BAD_OS, "no kOpenBSD loaded"); diff --git a/grub-core/loader/i386/bsdXX.c b/grub-core/loader/i386/bsdXX.c index 9f57cfa82..af6741d15 100644 --- a/grub-core/loader/i386/bsdXX.c +++ b/grub-core/loader/i386/bsdXX.c @@ -48,15 +48,15 @@ read_headers (grub_file_t file, const char *filename, Elf_Ehdr *e, char **shdr) if (e->e_ident[EI_CLASS] != SUFFIX (ELFCLASS)) return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic")); - *shdr = grub_malloc (e->e_shnum * e->e_shentsize); + *shdr = grub_malloc ((grub_uint32_t) e->e_shnum * e->e_shentsize); if (! *shdr) return grub_errno; if (grub_file_seek (file, e->e_shoff) == (grub_off_t) -1) return grub_errno; - if (grub_file_read (file, *shdr, e->e_shnum * e->e_shentsize) - != e->e_shnum * e->e_shentsize) + if (grub_file_read (file, *shdr, (grub_uint32_t) e->e_shnum * e->e_shentsize) + != (grub_ssize_t) ((grub_uint32_t) e->e_shnum * e->e_shentsize)) { if (grub_errno) return grub_errno; @@ -200,8 +200,8 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, if (chunk_size < sizeof (e)) chunk_size = sizeof (e); - chunk_size += e.e_phnum * e.e_phentsize; - chunk_size += e.e_shnum * e.e_shentsize; + chunk_size += (grub_uint32_t) e.e_phnum * e.e_phentsize; + chunk_size += (grub_uint32_t) e.e_shnum * e.e_shentsize; { grub_relocator_chunk_t ch; @@ -253,14 +253,14 @@ SUFFIX (grub_freebsd_load_elfmodule) (struct grub_relocator *relocator, curload = module + sizeof (e); load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_shoff, - e.e_shnum * e.e_shentsize); + (grub_uint32_t) e.e_shnum * e.e_shentsize); e.e_shoff = curload - module; - curload += e.e_shnum * e.e_shentsize; + curload += (grub_uint32_t) e.e_shnum * e.e_shentsize; load (file, argv[0], (grub_uint8_t *) chunk_src + curload - *kern_end, e.e_phoff, - e.e_phnum * e.e_phentsize); + (grub_uint32_t) e.e_phnum * e.e_phentsize); e.e_phoff = curload - module; - curload += e.e_phnum * e.e_phentsize; + curload += (grub_uint32_t) e.e_phnum * e.e_phentsize; *kern_end = curload; @@ -462,7 +462,7 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, chunk_size = ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)) + ALIGN_UP (strsize, sizeof (grub_freebsd_addr_t)) - + sizeof (e) + e.e_shnum * e.e_shentsize; + + sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; symtarget = ALIGN_UP (*kern_end, sizeof (grub_freebsd_addr_t)); { @@ -498,10 +498,10 @@ SUFFIX (grub_netbsd_load_elf_meta) (struct grub_relocator *relocator, s2 = (Elf_Shdr *) curload; grub_memcpy (curload, s, e.e_shentsize); if (s == symsh) - s2->sh_offset = sizeof (e) + e.e_shnum * e.e_shentsize; + s2->sh_offset = sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; else if (s == strsh) s2->sh_offset = ALIGN_UP (symsize, sizeof (grub_freebsd_addr_t)) - + sizeof (e) + e.e_shnum * e.e_shentsize; + + sizeof (e) + (grub_uint32_t) e.e_shnum * e.e_shentsize; else s2->sh_offset = 0; s2->sh_addr = s2->sh_offset; diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 84ec8e241..d4ac836db 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -929,8 +929,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " - "linux command instead.\n"), "text", - argv[i]); + "linux command instead.\n"), + argv[i], "text"); break; case 1: @@ -939,8 +939,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf_ (N_("%s is deprecated. " "Use set gfxpayload=%s before " - "linux command instead.\n"), "text", - argv[i]); + "linux command instead.\n"), + argv[i], "text"); break; default: /* Ignore invalid values. */ diff --git a/grub-core/loader/i386/multiboot_mbi.c b/grub-core/loader/i386/multiboot_mbi.c index 92daef053..42372bf05 100644 --- a/grub-core/loader/i386/multiboot_mbi.c +++ b/grub-core/loader/i386/multiboot_mbi.c @@ -71,9 +71,18 @@ load_kernel (grub_file_t file, const char *filename, char *buffer, struct multiboot_header *header) { grub_err_t err; + mbi_load_data_t mld; + + mld.file = file; + mld.filename = filename; + mld.buffer = buffer; + mld.mbi_ver = 1; + mld.relocatable = 0; + mld.avoid_efi_boot_services = 0; + if (grub_multiboot_quirks & GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE) { - err = grub_multiboot_load_elf (file, filename, buffer); + err = grub_multiboot_load_elf (&mld); if (err == GRUB_ERR_NONE) { return GRUB_ERR_NONE; } @@ -122,7 +131,7 @@ load_kernel (grub_file_t file, const char *filename, return GRUB_ERR_NONE; } - return grub_multiboot_load_elf (file, filename, buffer); + return grub_multiboot_load_elf (&mld); } static struct multiboot_header * diff --git a/grub-core/loader/i386/pc/truecrypt.c b/grub-core/loader/i386/pc/truecrypt.c index 159eab1a7..9ea4fde42 100644 --- a/grub-core/loader/i386/pc/truecrypt.c +++ b/grub-core/loader/i386/pc/truecrypt.c @@ -205,7 +205,7 @@ grub_cmd_truecrypt (grub_command_t cmd __attribute__ ((unused)), fail: if (!grub_errno) - return grub_error (GRUB_ERR_BAD_OS, "bad truecrypt ISO"); + grub_error (GRUB_ERR_BAD_OS, "bad truecrypt ISO"); if (file) grub_file_close (file); diff --git a/grub-core/loader/i386/xen.c b/grub-core/loader/i386/xen.c index f460c9a16..fa894cc3e 100644 --- a/grub-core/loader/i386/xen.c +++ b/grub-core/loader/i386/xen.c @@ -39,23 +39,59 @@ #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); -static struct grub_relocator *relocator = NULL; -static grub_uint64_t max_addr; -static grub_dl_t my_mod; -static int loaded = 0; -static struct start_info next_start; -static void *kern_chunk_src; -static struct grub_xen_file_info xen_inf; -static struct xen_multiboot_mod_list *xen_module_info_page; -static grub_uint64_t modules_target_start; -static grub_size_t n_modules; +#ifdef __x86_64__ +#define NUMBER_OF_LEVELS 4 +#define INTERMEDIATE_OR (GRUB_PAGE_PRESENT | GRUB_PAGE_RW | GRUB_PAGE_USER) +#define VIRT_MASK 0x0000ffffffffffffULL +#else +#define NUMBER_OF_LEVELS 3 +#define INTERMEDIATE_OR (GRUB_PAGE_PRESENT | GRUB_PAGE_RW) +#define VIRT_MASK 0x00000000ffffffffULL +#define HYPERVISOR_PUD_ADDRESS 0xc0000000ULL +#endif -#define PAGE_SIZE 4096 +struct grub_xen_mapping_lvl { + grub_uint64_t virt_start; + grub_uint64_t virt_end; + grub_uint64_t pfn_start; + grub_uint64_t n_pt_pages; +}; + +struct grub_xen_mapping { + grub_uint64_t *where; + struct grub_xen_mapping_lvl area; + struct grub_xen_mapping_lvl lvls[NUMBER_OF_LEVELS]; +}; + +struct xen_loader_state { + struct grub_relocator *relocator; + struct grub_relocator_xen_state state; + struct start_info next_start; + struct grub_xen_file_info xen_inf; + grub_xen_mfn_t *virt_mfn_list; + struct start_info *virt_start_info; + grub_xen_mfn_t console_pfn; + grub_uint64_t max_addr; + grub_uint64_t pgtbl_end; + struct xen_multiboot_mod_list *module_info_page; + grub_uint64_t modules_target_start; + grub_size_t n_modules; + struct grub_xen_mapping *map_reloc; + struct grub_xen_mapping mappings[XEN_MAX_MAPPINGS]; + int n_mappings; + int loaded; +}; + +static struct xen_loader_state xen_state; + +static grub_dl_t my_mod; + +#define PAGE_SIZE (1UL << PAGE_SHIFT) #define MAX_MODULES (PAGE_SIZE / sizeof (struct xen_multiboot_mod_list)) -#define PAGE_SHIFT 12 #define STACK_SIZE 1048576 #define ADDITIONAL_SIZE (1 << 19) #define ALIGN_SIZE (1 << 22) @@ -68,105 +104,168 @@ page2offset (grub_uint64_t page) return page << PAGE_SHIFT; } -#ifdef __x86_64__ -#define NUMBER_OF_LEVELS 4 -#define INTERMEDIATE_OR 7 -#else -#define NUMBER_OF_LEVELS 3 -#define INTERMEDIATE_OR 3 +static grub_err_t +get_pgtable_size (grub_uint64_t from, grub_uint64_t to, grub_uint64_t pfn) +{ + struct grub_xen_mapping *map, *map_cmp; + grub_uint64_t mask, bits; + int i, m; + + if (xen_state.n_mappings == XEN_MAX_MAPPINGS) + return grub_error (GRUB_ERR_BUG, "too many mapped areas"); + + grub_dprintf ("xen", "get_pgtable_size %d from=%llx, to=%llx, pfn=%llx\n", + xen_state.n_mappings, (unsigned long long) from, + (unsigned long long) to, (unsigned long long) pfn); + + map = xen_state.mappings + xen_state.n_mappings; + grub_memset (map, 0, sizeof (*map)); + + map->area.virt_start = from & VIRT_MASK; + map->area.virt_end = (to - 1) & VIRT_MASK; + map->area.n_pt_pages = 0; + + for (i = NUMBER_OF_LEVELS - 1; i >= 0; i--) + { + map->lvls[i].pfn_start = pfn + map->area.n_pt_pages; + if (i == NUMBER_OF_LEVELS - 1) + { + if (xen_state.n_mappings == 0) + { + map->lvls[i].virt_start = 0; + map->lvls[i].virt_end = VIRT_MASK; + map->lvls[i].n_pt_pages = 1; + map->area.n_pt_pages++; + } + continue; + } + + bits = PAGE_SHIFT + (i + 1) * LOG_POINTERS_PER_PAGE; + mask = (1ULL << bits) - 1; + map->lvls[i].virt_start = map->area.virt_start & ~mask; + map->lvls[i].virt_end = map->area.virt_end | mask; +#ifdef __i386__ + /* PAE wants last root directory present. */ + if (i == 1 && to <= HYPERVISOR_PUD_ADDRESS && xen_state.n_mappings == 0) + map->lvls[i].virt_end = VIRT_MASK; #endif + for (m = 0; m < xen_state.n_mappings; m++) + { + map_cmp = xen_state.mappings + m; + if (map_cmp->lvls[i].virt_start == map_cmp->lvls[i].virt_end) + continue; + if (map->lvls[i].virt_start >= map_cmp->lvls[i].virt_start && + map->lvls[i].virt_end <= map_cmp->lvls[i].virt_end) + { + map->lvls[i].virt_start = 0; + map->lvls[i].virt_end = 0; + break; + } + if (map->lvls[i].virt_start >= map_cmp->lvls[i].virt_start && + map->lvls[i].virt_start <= map_cmp->lvls[i].virt_end) + map->lvls[i].virt_start = map_cmp->lvls[i].virt_end + 1; + if (map->lvls[i].virt_end >= map_cmp->lvls[i].virt_start && + map->lvls[i].virt_end <= map_cmp->lvls[i].virt_end) + map->lvls[i].virt_end = map_cmp->lvls[i].virt_start - 1; + } + if (map->lvls[i].virt_start < map->lvls[i].virt_end) + map->lvls[i].n_pt_pages = + ((map->lvls[i].virt_end - map->lvls[i].virt_start) >> bits) + 1; + map->area.n_pt_pages += map->lvls[i].n_pt_pages; + grub_dprintf ("xen", "get_pgtable_size level %d: virt %llx-%llx %d pts\n", + i, (unsigned long long) map->lvls[i].virt_start, + (unsigned long long) map->lvls[i].virt_end, + (int) map->lvls[i].n_pt_pages); + } + + grub_dprintf ("xen", "get_pgtable_size return: %d page tables\n", + (int) map->area.n_pt_pages); + + xen_state.state.paging_start[xen_state.n_mappings] = pfn; + xen_state.state.paging_size[xen_state.n_mappings] = map->area.n_pt_pages; + + return GRUB_ERR_NONE; +} + +static grub_uint64_t * +get_pg_table_virt (int mapping, int level) +{ + grub_uint64_t pfn; + struct grub_xen_mapping *map; + + map = xen_state.mappings + mapping; + pfn = map->lvls[level].pfn_start - map->lvls[NUMBER_OF_LEVELS - 1].pfn_start; + return map->where + pfn * POINTERS_PER_PAGE; +} static grub_uint64_t -get_pgtable_size (grub_uint64_t total_pages, grub_uint64_t virt_base) +get_pg_table_prot (int level, grub_uint64_t pfn) { - if (!virt_base) - total_pages++; - grub_uint64_t ret = 0; - grub_uint64_t ll = total_pages; - int i; - for (i = 0; i < NUMBER_OF_LEVELS; i++) + int m; + grub_uint64_t pfn_s, pfn_e; + + if (level > 0) + return INTERMEDIATE_OR; + for (m = 0; m < xen_state.n_mappings; m++) { - ll = (ll + POINTERS_PER_PAGE - 1) >> LOG_POINTERS_PER_PAGE; - /* PAE wants all 4 root directories present. */ -#ifdef __i386__ - if (i == 1) - ll = 4; -#endif - ret += ll; + pfn_s = xen_state.mappings[m].lvls[NUMBER_OF_LEVELS - 1].pfn_start; + pfn_e = xen_state.mappings[m].area.n_pt_pages + pfn_s; + if (pfn >= pfn_s && pfn < pfn_e) + return GRUB_PAGE_PRESENT | GRUB_PAGE_USER; } - for (i = 1; i < NUMBER_OF_LEVELS; i++) - if (virt_base >> (PAGE_SHIFT + i * LOG_POINTERS_PER_PAGE)) - ret++; - return ret; + return GRUB_PAGE_PRESENT | GRUB_PAGE_RW | GRUB_PAGE_USER; } static void -generate_page_table (grub_uint64_t *where, grub_uint64_t paging_start, - grub_uint64_t total_pages, grub_uint64_t virt_base, - grub_xen_mfn_t *mfn_list) +generate_page_table (grub_xen_mfn_t *mfn_list) { - if (!virt_base) - total_pages++; + int l, m1, m2; + long p, p_s, p_e; + grub_uint64_t start, end, pfn; + grub_uint64_t *pg; + struct grub_xen_mapping_lvl *lvl; - grub_uint64_t lx[NUMBER_OF_LEVELS], lxs[NUMBER_OF_LEVELS]; - grub_uint64_t nlx, nls, sz = 0; - int l; + for (m1 = 0; m1 < xen_state.n_mappings; m1++) + grub_memset (xen_state.mappings[m1].where, 0, + xen_state.mappings[m1].area.n_pt_pages * PAGE_SIZE); - nlx = total_pages; - nls = virt_base >> PAGE_SHIFT; - for (l = 0; l < NUMBER_OF_LEVELS; l++) + for (l = NUMBER_OF_LEVELS - 1; l >= 0; l--) { - nlx = (nlx + POINTERS_PER_PAGE - 1) >> LOG_POINTERS_PER_PAGE; - /* PAE wants all 4 root directories present. */ -#ifdef __i386__ - if (l == 1) - nlx = 4; -#endif - lx[l] = nlx; - sz += lx[l]; - lxs[l] = nls & (POINTERS_PER_PAGE - 1); - if (nls && l != 0) - sz++; - nls >>= LOG_POINTERS_PER_PAGE; - } - - grub_uint64_t lp; - grub_uint64_t j; - grub_uint64_t *pg = (grub_uint64_t *) where; - int pr = 0; - - grub_memset (pg, 0, sz * PAGE_SIZE); - - lp = paging_start + lx[NUMBER_OF_LEVELS - 1]; - for (l = NUMBER_OF_LEVELS - 1; l >= 1; l--) - { - if (lxs[l] || pr) - pg[0] = page2offset (mfn_list[lp++]) | INTERMEDIATE_OR; - if (pr) - pg += POINTERS_PER_PAGE; - for (j = 0; j < lx[l - 1]; j++) - pg[j + lxs[l]] = page2offset (mfn_list[lp++]) | INTERMEDIATE_OR; - pg += lx[l] * POINTERS_PER_PAGE; - if (lxs[l]) - pr = 1; - } - - if (lxs[0] || pr) - pg[0] = page2offset (mfn_list[total_pages]) | 5; - if (pr) - pg += POINTERS_PER_PAGE; - - for (j = 0; j < total_pages; j++) - { - if (j >= paging_start && j < lp) - pg[j + lxs[0]] = page2offset (mfn_list[j]) | 5; - else - pg[j + lxs[0]] = page2offset (mfn_list[j]) | 7; + for (m1 = 0; m1 < xen_state.n_mappings; m1++) + { + start = xen_state.mappings[m1].lvls[l].virt_start; + end = xen_state.mappings[m1].lvls[l].virt_end; + pg = get_pg_table_virt(m1, l); + for (m2 = 0; m2 < xen_state.n_mappings; m2++) + { + lvl = (l > 0) ? xen_state.mappings[m2].lvls + l - 1 + : &xen_state.mappings[m2].area; + if (l > 0 && lvl->n_pt_pages == 0) + continue; + if (lvl->virt_start >= end || lvl->virt_end <= start) + continue; + p_s = (grub_max (start, lvl->virt_start) - start) >> + (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE); + p_e = (grub_min (end, lvl->virt_end) - start) >> + (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE); + pfn = ((grub_max (start, lvl->virt_start) - lvl->virt_start) >> + (PAGE_SHIFT + l * LOG_POINTERS_PER_PAGE)) + lvl->pfn_start; + grub_dprintf ("xen", "write page table entries level %d pg %p " + "mapping %d/%d index %lx-%lx pfn %llx\n", + l, pg, m1, m2, p_s, p_e, (unsigned long long) pfn); + for (p = p_s; p <= p_e; p++) + { + pg[p] = page2offset (mfn_list[pfn]) | + get_pg_table_prot (l, pfn); + pfn++; + } + } + } } } static grub_err_t -set_mfns (grub_xen_mfn_t * new_mfn_list, grub_xen_mfn_t pfn) +set_mfns (grub_xen_mfn_t pfn) { grub_xen_mfn_t i, t; grub_xen_mfn_t cn_pfn = -1, st_pfn = -1; @@ -175,32 +274,34 @@ set_mfns (grub_xen_mfn_t * new_mfn_list, grub_xen_mfn_t pfn) for (i = 0; i < grub_xen_start_page_addr->nr_pages; i++) { - if (new_mfn_list[i] == grub_xen_start_page_addr->console.domU.mfn) + if (xen_state.virt_mfn_list[i] == + grub_xen_start_page_addr->console.domU.mfn) cn_pfn = i; - if (new_mfn_list[i] == grub_xen_start_page_addr->store_mfn) + if (xen_state.virt_mfn_list[i] == grub_xen_start_page_addr->store_mfn) st_pfn = i; } if (cn_pfn == (grub_xen_mfn_t)-1) return grub_error (GRUB_ERR_BUG, "no console"); if (st_pfn == (grub_xen_mfn_t)-1) return grub_error (GRUB_ERR_BUG, "no store"); - t = new_mfn_list[pfn]; - new_mfn_list[pfn] = new_mfn_list[cn_pfn]; - new_mfn_list[cn_pfn] = t; - t = new_mfn_list[pfn + 1]; - new_mfn_list[pfn + 1] = new_mfn_list[st_pfn]; - new_mfn_list[st_pfn] = t; + t = xen_state.virt_mfn_list[pfn]; + xen_state.virt_mfn_list[pfn] = xen_state.virt_mfn_list[cn_pfn]; + xen_state.virt_mfn_list[cn_pfn] = t; + t = xen_state.virt_mfn_list[pfn + 1]; + xen_state.virt_mfn_list[pfn + 1] = xen_state.virt_mfn_list[st_pfn]; + xen_state.virt_mfn_list[st_pfn] = t; - m2p_updates[0].ptr = page2offset (new_mfn_list[pfn]) | MMU_MACHPHYS_UPDATE; + m2p_updates[0].ptr = + page2offset (xen_state.virt_mfn_list[pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[0].val = pfn; m2p_updates[1].ptr = - page2offset (new_mfn_list[pfn + 1]) | MMU_MACHPHYS_UPDATE; + page2offset (xen_state.virt_mfn_list[pfn + 1]) | MMU_MACHPHYS_UPDATE; m2p_updates[1].val = pfn + 1; m2p_updates[2].ptr = - page2offset (new_mfn_list[cn_pfn]) | MMU_MACHPHYS_UPDATE; + page2offset (xen_state.virt_mfn_list[cn_pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[2].val = cn_pfn; m2p_updates[3].ptr = - page2offset (new_mfn_list[st_pfn]) | MMU_MACHPHYS_UPDATE; + page2offset (xen_state.virt_mfn_list[st_pfn]) | MMU_MACHPHYS_UPDATE; m2p_updates[3].val = st_pfn; grub_xen_mmu_update (m2p_updates, 4, NULL, DOMID_SELF); @@ -209,96 +310,223 @@ set_mfns (grub_xen_mfn_t * new_mfn_list, grub_xen_mfn_t pfn) } static grub_err_t -grub_xen_boot (void) +grub_xen_p2m_alloc (void) +{ + grub_relocator_chunk_t ch; + grub_size_t p2msize, p2malloc; + grub_err_t err; + struct grub_xen_mapping *map; + + if (xen_state.virt_mfn_list) + return GRUB_ERR_NONE; + + map = xen_state.mappings + xen_state.n_mappings; + p2msize = ALIGN_UP (sizeof (grub_xen_mfn_t) * + grub_xen_start_page_addr->nr_pages, PAGE_SIZE); + if (xen_state.xen_inf.has_p2m_base) + { + err = get_pgtable_size (xen_state.xen_inf.p2m_base, + xen_state.xen_inf.p2m_base + p2msize, + (xen_state.max_addr + p2msize) >> PAGE_SHIFT); + if (err) + return err; + + map->area.pfn_start = xen_state.max_addr >> PAGE_SHIFT; + p2malloc = p2msize + page2offset (map->area.n_pt_pages); + xen_state.n_mappings++; + xen_state.next_start.mfn_list = xen_state.xen_inf.p2m_base; + xen_state.next_start.first_p2m_pfn = map->area.pfn_start; + xen_state.next_start.nr_p2m_frames = p2malloc >> PAGE_SHIFT; + } + else + { + xen_state.next_start.mfn_list = + xen_state.max_addr + xen_state.xen_inf.virt_base; + p2malloc = p2msize; + } + + xen_state.state.mfn_list = xen_state.max_addr; + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, p2malloc); + if (err) + return err; + xen_state.virt_mfn_list = get_virtual_current_address (ch); + if (xen_state.xen_inf.has_p2m_base) + map->where = (grub_uint64_t *) xen_state.virt_mfn_list + + p2msize / sizeof (grub_uint64_t); + grub_memcpy (xen_state.virt_mfn_list, + (void *) grub_xen_start_page_addr->mfn_list, p2msize); + xen_state.max_addr += p2malloc; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_xen_special_alloc (void) +{ + grub_relocator_chunk_t ch; + grub_err_t err; + + if (xen_state.virt_start_info) + return GRUB_ERR_NONE; + + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, + sizeof (xen_state.next_start)); + if (err) + return err; + xen_state.state.start_info = xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.virt_start_info = get_virtual_current_address (ch); + xen_state.max_addr = + ALIGN_UP (xen_state.max_addr + sizeof (xen_state.next_start), PAGE_SIZE); + xen_state.console_pfn = xen_state.max_addr >> PAGE_SHIFT; + xen_state.max_addr += 2 * PAGE_SIZE; + + xen_state.next_start.nr_pages = grub_xen_start_page_addr->nr_pages; + grub_memcpy (xen_state.next_start.magic, grub_xen_start_page_addr->magic, + sizeof (xen_state.next_start.magic)); + xen_state.next_start.store_mfn = grub_xen_start_page_addr->store_mfn; + xen_state.next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; + xen_state.next_start.console.domU = grub_xen_start_page_addr->console.domU; + xen_state.next_start.shared_info = grub_xen_start_page_addr->shared_info; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_xen_pt_alloc (void) { - struct grub_relocator_xen_state state; grub_relocator_chunk_t ch; grub_err_t err; - grub_size_t pgtsize; - struct start_info *nst; grub_uint64_t nr_info_pages; - grub_uint64_t nr_pages, nr_pt_pages, nr_need_pages; + grub_uint64_t nr_need_pages; + grub_uint64_t try_virt_end; + struct grub_xen_mapping *map; + + if (xen_state.pgtbl_end) + return GRUB_ERR_NONE; + + map = xen_state.mappings + xen_state.n_mappings; + xen_state.map_reloc = map + 1; + + xen_state.next_start.pt_base = + xen_state.max_addr + xen_state.xen_inf.virt_base; + nr_info_pages = xen_state.max_addr >> PAGE_SHIFT; + nr_need_pages = nr_info_pages; + + while (1) + { + try_virt_end = ALIGN_UP (xen_state.xen_inf.virt_base + + page2offset (nr_need_pages) + + ADDITIONAL_SIZE + STACK_SIZE, ALIGN_SIZE); + if (!xen_state.xen_inf.virt_base) + try_virt_end += PAGE_SIZE; + + err = get_pgtable_size (xen_state.xen_inf.virt_base, try_virt_end, + nr_info_pages); + if (err) + return err; + xen_state.n_mappings++; + + /* Map the relocator page either at virtual 0 or after end of area. */ + nr_need_pages = nr_info_pages + map->area.n_pt_pages; + if (xen_state.xen_inf.virt_base) + err = get_pgtable_size (0, PAGE_SIZE, nr_need_pages); + else + err = get_pgtable_size (try_virt_end - PAGE_SIZE, try_virt_end, + nr_need_pages); + if (err) + return err; + nr_need_pages += xen_state.map_reloc->area.n_pt_pages; + + if (xen_state.xen_inf.virt_base + page2offset (nr_need_pages) <= + try_virt_end) + break; + + xen_state.n_mappings--; + } + + xen_state.n_mappings++; + nr_need_pages = map->area.n_pt_pages + xen_state.map_reloc->area.n_pt_pages; + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, + page2offset (nr_need_pages)); + if (err) + return err; + + map->where = get_virtual_current_address (ch); + map->area.pfn_start = 0; + xen_state.max_addr += page2offset (nr_need_pages); + xen_state.state.stack = + xen_state.max_addr + STACK_SIZE + xen_state.xen_inf.virt_base; + xen_state.next_start.nr_pt_frames = nr_need_pages; + xen_state.max_addr = try_virt_end - xen_state.xen_inf.virt_base; + xen_state.pgtbl_end = xen_state.max_addr >> PAGE_SHIFT; + xen_state.map_reloc->where = (grub_uint64_t *) ((char *) map->where + + page2offset (map->area.n_pt_pages)); + + return GRUB_ERR_NONE; +} + +/* Allocate all not yet allocated areas mapped by initial page tables. */ +static grub_err_t +grub_xen_alloc_boot_data (void) +{ + grub_err_t err; + + if (!xen_state.xen_inf.has_p2m_base) + { + err = grub_xen_p2m_alloc (); + if (err) + return err; + } + err = grub_xen_special_alloc (); + if (err) + return err; + err = grub_xen_pt_alloc (); + if (err) + return err; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_xen_boot (void) +{ + grub_err_t err; + grub_uint64_t nr_pages; struct gnttab_set_version gnttab_setver; - grub_xen_mfn_t *new_mfn_list; grub_size_t i; if (grub_xen_n_allocated_shared_pages) return grub_error (GRUB_ERR_BUG, "active grants"); - state.mfn_list = max_addr; - next_start.mfn_list = max_addr + xen_inf.virt_base; - next_start.first_p2m_pfn = max_addr >> PAGE_SHIFT; /* Is this right? */ - pgtsize = sizeof (grub_xen_mfn_t) * grub_xen_start_page_addr->nr_pages; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, pgtsize); - next_start.nr_p2m_frames = (pgtsize + PAGE_SIZE - 1) >> PAGE_SHIFT; + err = grub_xen_alloc_boot_data (); if (err) return err; - new_mfn_list = get_virtual_current_address (ch); - grub_memcpy (new_mfn_list, - (void *) grub_xen_start_page_addr->mfn_list, pgtsize); - max_addr = ALIGN_UP (max_addr + pgtsize, PAGE_SIZE); - - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, sizeof (next_start)); - if (err) - return err; - state.start_info = max_addr + xen_inf.virt_base; - nst = get_virtual_current_address (ch); - max_addr = ALIGN_UP (max_addr + sizeof (next_start), PAGE_SIZE); - - next_start.nr_pages = grub_xen_start_page_addr->nr_pages; - grub_memcpy (next_start.magic, grub_xen_start_page_addr->magic, - sizeof (next_start.magic)); - next_start.store_mfn = grub_xen_start_page_addr->store_mfn; - next_start.store_evtchn = grub_xen_start_page_addr->store_evtchn; - next_start.console.domU = grub_xen_start_page_addr->console.domU; - next_start.shared_info = grub_xen_start_page_addr->shared_info; - - err = set_mfns (new_mfn_list, max_addr >> PAGE_SHIFT); - if (err) - return err; - max_addr += 2 * PAGE_SIZE; - - next_start.pt_base = max_addr + xen_inf.virt_base; - state.paging_start = max_addr >> PAGE_SHIFT; - - nr_info_pages = max_addr >> PAGE_SHIFT; - nr_pages = nr_info_pages; - - while (1) + if (xen_state.xen_inf.has_p2m_base) { - nr_pages = ALIGN_UP (nr_pages, (ALIGN_SIZE >> PAGE_SHIFT)); - nr_pt_pages = get_pgtable_size (nr_pages, xen_inf.virt_base); - nr_need_pages = - nr_info_pages + nr_pt_pages + - ((ADDITIONAL_SIZE + STACK_SIZE) >> PAGE_SHIFT); - if (nr_pages >= nr_need_pages) - break; - nr_pages = nr_need_pages; + err = grub_xen_p2m_alloc (); + if (err) + return err; } - grub_dprintf ("xen", "bootstrap domain %llx+%llx\n", - (unsigned long long) xen_inf.virt_base, - (unsigned long long) page2offset (nr_pages)); - - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, page2offset (nr_pt_pages)); + err = set_mfns (xen_state.console_pfn); if (err) return err; - generate_page_table (get_virtual_current_address (ch), - max_addr >> PAGE_SHIFT, nr_pages, - xen_inf.virt_base, new_mfn_list); + nr_pages = xen_state.max_addr >> PAGE_SHIFT; - max_addr += page2offset (nr_pt_pages); - state.stack = max_addr + STACK_SIZE + xen_inf.virt_base; - state.entry_point = xen_inf.entry_point; + grub_dprintf ("xen", "bootstrap domain %llx+%llx\n", + (unsigned long long) xen_state.xen_inf.virt_base, + (unsigned long long) page2offset (nr_pages)); - next_start.nr_p2m_frames += nr_pt_pages; - next_start.nr_pt_frames = nr_pt_pages; - state.paging_size = nr_pt_pages; + xen_state.map_reloc->area.pfn_start = nr_pages; + generate_page_table (xen_state.virt_mfn_list); - *nst = next_start; + xen_state.state.entry_point = xen_state.xen_inf.entry_point; + + *xen_state.virt_start_info = xen_state.next_start; grub_memset (&gnttab_setver, 0, sizeof (gnttab_setver)); @@ -308,19 +536,27 @@ grub_xen_boot (void) for (i = 0; i < ARRAY_SIZE (grub_xen_shared_info->evtchn_pending); i++) grub_xen_shared_info->evtchn_pending[i] = 0; - return grub_relocator_xen_boot (relocator, state, nr_pages, - xen_inf.virt_base < + return grub_relocator_xen_boot (xen_state.relocator, xen_state.state, nr_pages, + xen_state.xen_inf.virt_base < PAGE_SIZE ? page2offset (nr_pages) : 0, - nr_pages - 1, - page2offset (nr_pages - 1) + - xen_inf.virt_base); + xen_state.pgtbl_end - 1, + page2offset (xen_state.pgtbl_end - 1) + + xen_state.xen_inf.virt_base); +} + +static void +grub_xen_reset (void) +{ + grub_relocator_unload (xen_state.relocator); + + grub_memset (&xen_state, 0, sizeof (xen_state)); } static grub_err_t grub_xen_unload (void) { + grub_xen_reset (); grub_dl_unref (my_mod); - loaded = 0; return GRUB_ERR_NONE; } @@ -397,124 +633,125 @@ grub_cmd_xen (grub_command_t cmd __attribute__ ((unused)), grub_file_t file; grub_elf_t elf; grub_err_t err; + void *kern_chunk_src; + grub_relocator_chunk_t ch; + grub_addr_t kern_start; + grub_addr_t kern_end; if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); + /* Call grub_loader_unset early to avoid it being called by grub_loader_set */ grub_loader_unset (); - grub_memset (&next_start, 0, sizeof (next_start)); - - xen_module_info_page = NULL; - n_modules = 0; + grub_xen_reset (); grub_create_loader_cmdline (argc - 1, argv + 1, - (char *) next_start.cmd_line, - sizeof (next_start.cmd_line) - 1); + (char *) xen_state.next_start.cmd_line, + sizeof (xen_state.next_start.cmd_line) - 1); file = grub_file_open (argv[0]); if (!file) return grub_errno; elf = grub_xen_file_and_cmdline (file, - (char *) next_start.cmd_line, - sizeof (next_start.cmd_line) - 1); + (char *) xen_state.next_start.cmd_line, + sizeof (xen_state.next_start.cmd_line) - 1); if (!elf) goto fail; - err = grub_xen_get_info (elf, &xen_inf); + err = grub_xen_get_info (elf, &xen_state.xen_inf); if (err) goto fail; #ifdef __x86_64__ - if (xen_inf.arch != GRUB_XEN_FILE_X86_64) + if (xen_state.xen_inf.arch != GRUB_XEN_FILE_X86_64) #else - if (xen_inf.arch != GRUB_XEN_FILE_I386_PAE - && xen_inf.arch != GRUB_XEN_FILE_I386_PAE_BIMODE) + if (xen_state.xen_inf.arch != GRUB_XEN_FILE_I386_PAE + && xen_state.xen_inf.arch != GRUB_XEN_FILE_I386_PAE_BIMODE) #endif { grub_error (GRUB_ERR_BAD_OS, "incompatible architecture: %d", - xen_inf.arch); + xen_state.xen_inf.arch); goto fail; } - if (xen_inf.virt_base & (PAGE_SIZE - 1)) + if (xen_state.xen_inf.virt_base & (PAGE_SIZE - 1)) { grub_error (GRUB_ERR_BAD_OS, "unaligned virt_base"); goto fail; } grub_dprintf ("xen", "virt_base = %llx, entry = %llx\n", - (unsigned long long) xen_inf.virt_base, - (unsigned long long) xen_inf.entry_point); + (unsigned long long) xen_state.xen_inf.virt_base, + (unsigned long long) xen_state.xen_inf.entry_point); - relocator = grub_relocator_new (); - if (!relocator) + xen_state.relocator = grub_relocator_new (); + if (!xen_state.relocator) goto fail; - grub_relocator_chunk_t ch; - grub_addr_t kern_start = xen_inf.kern_start - xen_inf.paddr_offset; - grub_addr_t kern_end = xen_inf.kern_end - xen_inf.paddr_offset; + kern_start = xen_state.xen_inf.kern_start - xen_state.xen_inf.paddr_offset; + kern_end = xen_state.xen_inf.kern_end - xen_state.xen_inf.paddr_offset; - if (xen_inf.has_hypercall_page) + if (xen_state.xen_inf.has_hypercall_page) { grub_dprintf ("xen", "hypercall page at 0x%llx\n", - (unsigned long long) xen_inf.hypercall_page); - if (xen_inf.hypercall_page - xen_inf.virt_base < kern_start) - kern_start = xen_inf.hypercall_page - xen_inf.virt_base; - - if (xen_inf.hypercall_page - xen_inf.virt_base + PAGE_SIZE > kern_end) - kern_end = xen_inf.hypercall_page - xen_inf.virt_base + PAGE_SIZE; + (unsigned long long) xen_state.xen_inf.hypercall_page); + kern_start = grub_min (kern_start, xen_state.xen_inf.hypercall_page - + xen_state.xen_inf.virt_base); + kern_end = grub_max (kern_end, xen_state.xen_inf.hypercall_page - + xen_state.xen_inf.virt_base + PAGE_SIZE); } - max_addr = ALIGN_UP (kern_end, PAGE_SIZE); + xen_state.max_addr = ALIGN_UP (kern_end, PAGE_SIZE); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, kern_start, + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, kern_start, kern_end - kern_start); if (err) goto fail; kern_chunk_src = get_virtual_current_address (ch); grub_dprintf ("xen", "paddr_offset = 0x%llx\n", - (unsigned long long) xen_inf.paddr_offset); + (unsigned long long) xen_state.xen_inf.paddr_offset); grub_dprintf ("xen", "kern_start = 0x%llx, kern_end = 0x%llx\n", - (unsigned long long) xen_inf.kern_start, - (unsigned long long) xen_inf.kern_end); + (unsigned long long) xen_state.xen_inf.kern_start, + (unsigned long long) xen_state.xen_inf.kern_end); err = grub_elfXX_load (elf, argv[0], (grub_uint8_t *) kern_chunk_src - kern_start - - xen_inf.paddr_offset, 0, 0, 0); + - xen_state.xen_inf.paddr_offset, 0, 0, 0); - if (xen_inf.has_hypercall_page) + if (xen_state.xen_inf.has_hypercall_page) { unsigned i; for (i = 0; i < PAGE_SIZE / HYPERCALL_INTERFACE_SIZE; i++) set_hypercall_interface ((grub_uint8_t *) kern_chunk_src + i * HYPERCALL_INTERFACE_SIZE + - xen_inf.hypercall_page - xen_inf.virt_base - - kern_start, i); + xen_state.xen_inf.hypercall_page - + xen_state.xen_inf.virt_base - kern_start, i); } if (err) goto fail; grub_dl_ref (my_mod); - loaded = 1; + xen_state.loaded = 1; grub_loader_set (grub_xen_boot, grub_xen_unload, 0); - loaded = 1; goto fail; fail: + /* grub_errno might be clobbered by further calls, save the error reason. */ + err = grub_errno; if (elf) grub_elf_close (elf); else if (file) grub_file_close (file); - if (grub_errno != GRUB_ERR_NONE) - loaded = 0; + if (err != GRUB_ERR_NONE) + grub_xen_reset (); - return grub_errno; + return err; } static grub_err_t @@ -532,19 +769,26 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } - if (!loaded) + if (!xen_state.loaded) { grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); goto fail; } - if (next_start.mod_start || next_start.mod_len) + if (xen_state.next_start.mod_start || xen_state.next_start.mod_len) { grub_error (GRUB_ERR_BAD_ARGUMENT, N_("initrd already loaded")); goto fail; } + if (xen_state.xen_inf.unmapped_initrd) + { + err = grub_xen_alloc_boot_data (); + if (err) + goto fail; + } + if (grub_initrd_init (argc, argv, &initrd_ctx)) goto fail; @@ -552,22 +796,32 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), if (size) { - err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, size); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, size); if (err) - return err; + goto fail; if (grub_initrd_load (&initrd_ctx, argv, get_virtual_current_address (ch))) goto fail; } - next_start.mod_start = max_addr + xen_inf.virt_base; - next_start.mod_len = size; + xen_state.next_start.mod_len = size; - max_addr = ALIGN_UP (max_addr + size, PAGE_SIZE); + if (xen_state.xen_inf.unmapped_initrd) + { + xen_state.next_start.flags |= SIF_MOD_START_PFN; + xen_state.next_start.mod_start = xen_state.max_addr >> PAGE_SHIFT; + } + else + xen_state.next_start.mod_start = + xen_state.max_addr + xen_state.xen_inf.virt_base; grub_dprintf ("xen", "Initrd, addr=0x%x, size=0x%x\n", - (unsigned) next_start.mod_start, (unsigned) size); + (unsigned) (xen_state.max_addr + xen_state.xen_inf.virt_base), + (unsigned) size); + + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); fail: grub_initrd_close (&initrd_ctx); @@ -599,45 +853,49 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected")); - if (!loaded) + if (!xen_state.loaded) { return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("you need to load the kernel first")); } - if ((next_start.mod_start || next_start.mod_len) && !xen_module_info_page) + if ((xen_state.next_start.mod_start || xen_state.next_start.mod_len) && + !xen_state.module_info_page) { return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("initrd already loaded")); } /* Leave one space for terminator. */ - if (n_modules >= MAX_MODULES - 1) + if (xen_state.n_modules >= MAX_MODULES - 1) { return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many modules"); } - if (!xen_module_info_page) + if (!xen_state.module_info_page) { - n_modules = 0; - max_addr = ALIGN_UP (max_addr, PAGE_SIZE); - modules_target_start = max_addr; - next_start.mod_start = max_addr + xen_inf.virt_base; - next_start.flags |= SIF_MULTIBOOT_MOD; + xen_state.xen_inf.unmapped_initrd = 0; + xen_state.n_modules = 0; + xen_state.max_addr = ALIGN_UP (xen_state.max_addr, PAGE_SIZE); + xen_state.modules_target_start = xen_state.max_addr; + xen_state.next_start.mod_start = + xen_state.max_addr + xen_state.xen_inf.virt_base; + xen_state.next_start.flags |= SIF_MULTIBOOT_MOD; - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, MAX_MODULES + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, MAX_MODULES * - sizeof (xen_module_info_page + sizeof (xen_state.module_info_page [0])); if (err) return err; - xen_module_info_page = get_virtual_current_address (ch); - grub_memset (xen_module_info_page, 0, MAX_MODULES - * sizeof (xen_module_info_page[0])); - max_addr += MAX_MODULES * sizeof (xen_module_info_page[0]); + xen_state.module_info_page = get_virtual_current_address (ch); + grub_memset (xen_state.module_info_page, 0, MAX_MODULES + * sizeof (xen_state.module_info_page[0])); + xen_state.max_addr += + MAX_MODULES * sizeof (xen_state.module_info_page[0]); } - max_addr = ALIGN_UP (max_addr, PAGE_SIZE); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr, PAGE_SIZE); if (nounzip) grub_file_filter_disable_compression (); @@ -648,20 +906,22 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), cmdline_len = grub_loader_cmdline_size (argc - 1, argv + 1); - err = grub_relocator_alloc_chunk_addr (relocator, &ch, - max_addr, cmdline_len); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, cmdline_len); if (err) goto fail; grub_create_loader_cmdline (argc - 1, argv + 1, get_virtual_current_address (ch), cmdline_len); - xen_module_info_page[n_modules].cmdline = max_addr - modules_target_start; - max_addr = ALIGN_UP (max_addr + cmdline_len, PAGE_SIZE); + xen_state.module_info_page[xen_state.n_modules].cmdline = + xen_state.max_addr - xen_state.modules_target_start; + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + cmdline_len, PAGE_SIZE); if (size) { - err = grub_relocator_alloc_chunk_addr (relocator, &ch, max_addr, size); + err = grub_relocator_alloc_chunk_addr (xen_state.relocator, &ch, + xen_state.max_addr, size); if (err) goto fail; if (grub_file_read (file, get_virtual_current_address (ch), size) @@ -673,15 +933,17 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)), goto fail; } } - next_start.mod_len = max_addr + size - modules_target_start; - xen_module_info_page[n_modules].mod_start = max_addr - modules_target_start; - xen_module_info_page[n_modules].mod_end = - max_addr + size - modules_target_start; + xen_state.next_start.mod_len = + xen_state.max_addr + size - xen_state.modules_target_start; + xen_state.module_info_page[xen_state.n_modules].mod_start = + xen_state.max_addr - xen_state.modules_target_start; + xen_state.module_info_page[xen_state.n_modules].mod_end = + xen_state.max_addr + size - xen_state.modules_target_start; - n_modules++; + xen_state.n_modules++; grub_dprintf ("xen", "module, addr=0x%x, size=0x%x\n", - (unsigned) max_addr, (unsigned) size); - max_addr = ALIGN_UP (max_addr + size, PAGE_SIZE); + (unsigned) xen_state.max_addr, (unsigned) size); + xen_state.max_addr = ALIGN_UP (xen_state.max_addr + size, PAGE_SIZE); fail: diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c index a5cd714fa..f1faf6ff0 100644 --- a/grub-core/loader/i386/xen_file.c +++ b/grub-core/loader/i386/xen_file.c @@ -65,14 +65,14 @@ grub_xen_file_and_cmdline (grub_file_t file, grub_dprintf ("xen", "found bzimage payload 0x%llx-0x%llx\n", (unsigned long long) (lh.setup_sects + 1) * 512 + lh.payload_offset, - (unsigned long long) lh.payload_length - 4); + (unsigned long long) lh.payload_length); if (cmdline) grub_pass_verity_hash (&lh, cmdline, cmdline_max_len); off_file = grub_file_offset_open (file, (lh.setup_sects + 1) * 512 + lh.payload_offset, - lh.payload_length - 4); + lh.payload_length); if (!off_file) goto fail; diff --git a/grub-core/loader/i386/xen_fileXX.c b/grub-core/loader/i386/xen_fileXX.c index 1ba5649e2..fb66e66fe 100644 --- a/grub-core/loader/i386/xen_fileXX.c +++ b/grub-core/loader/i386/xen_fileXX.c @@ -18,6 +18,7 @@ #include #include +#include static grub_err_t parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, @@ -26,6 +27,8 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, char *buf; char *ptr; int has_paddr = 0; + + grub_errno = GRUB_ERR_NONE; if (grub_file_seek (elf->file, off) == (grub_off_t) -1) return grub_errno; buf = grub_malloc (sz); @@ -35,7 +38,8 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, if (grub_file_read (elf->file, buf, sz) != (grub_ssize_t) sz) { if (grub_errno) - return grub_errno; + goto out; + grub_free (buf); return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), elf->file->name); } @@ -123,14 +127,14 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, { xi->virt_base = grub_strtoull (ptr + sizeof ("VIRT_BASE=") - 1, &ptr, 16); if (grub_errno) - return grub_errno; + goto out; continue; } if (grub_strncmp (ptr, "VIRT_ENTRY=", sizeof ("VIRT_ENTRY=") - 1) == 0) { xi->entry_point = grub_strtoull (ptr + sizeof ("VIRT_ENTRY=") - 1, &ptr, 16); if (grub_errno) - return grub_errno; + goto out; continue; } if (grub_strncmp (ptr, "HYPERCALL_PAGE=", sizeof ("HYPERCALL_PAGE=") - 1) == 0) @@ -138,7 +142,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->hypercall_page = grub_strtoull (ptr + sizeof ("HYPERCALL_PAGE=") - 1, &ptr, 16); xi->has_hypercall_page = 1; if (grub_errno) - return grub_errno; + goto out; continue; } if (grub_strncmp (ptr, "ELF_PADDR_OFFSET=", sizeof ("ELF_PADDR_OFFSET=") - 1) == 0) @@ -146,7 +150,7 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->paddr_offset = grub_strtoull (ptr + sizeof ("ELF_PADDR_OFFSET=") - 1, &ptr, 16); has_paddr = 1; if (grub_errno) - return grub_errno; + goto out; continue; } } @@ -154,7 +158,11 @@ parse_xen_guest (grub_elf_t elf, struct grub_xen_file_info *xi, xi->hypercall_page = (xi->hypercall_page << 12) + xi->virt_base; if (!has_paddr) xi->paddr_offset = xi->virt_base; - return GRUB_ERR_NONE; + +out: + grub_free (buf); + + return grub_errno; } #pragma GCC diagnostic ignored "-Wcast-align" @@ -196,35 +204,35 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi, xi->has_note = 1; switch (nh->n_type) { - case 1: + case XEN_ELFNOTE_ENTRY: xi->entry_point = grub_le_to_cpu_addr (*(Elf_Addr *) desc); break; - case 2: + case XEN_ELFNOTE_HYPERCALL_PAGE: xi->hypercall_page = grub_le_to_cpu_addr (*(Elf_Addr *) desc); xi->has_hypercall_page = 1; break; - case 3: + case XEN_ELFNOTE_VIRT_BASE: xi->virt_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc); break; - case 4: + case XEN_ELFNOTE_PADDR_OFFSET: xi->paddr_offset = grub_le_to_cpu_addr (*(Elf_Addr *) desc); break; - case 5: + case XEN_ELFNOTE_XEN_VERSION: grub_dprintf ("xen", "xenversion = `%s'\n", (char *) desc); break; - case 6: + case XEN_ELFNOTE_GUEST_OS: grub_dprintf ("xen", "name = `%s'\n", (char *) desc); break; - case 7: + case XEN_ELFNOTE_GUEST_VERSION: grub_dprintf ("xen", "version = `%s'\n", (char *) desc); break; - case 8: + case XEN_ELFNOTE_LOADER: if (descsz < 7 || grub_memcmp (desc, "generic", descsz == 7 ? 7 : 8) != 0) return grub_error (GRUB_ERR_BAD_OS, "invalid loader"); break; /* PAE */ - case 9: + case XEN_ELFNOTE_PAE_MODE: grub_dprintf ("xen", "pae = `%s', %d, %d\n", (char *) desc, xi->arch, descsz); if (xi->arch != GRUB_XEN_FILE_I386 @@ -253,6 +261,13 @@ parse_note (grub_elf_t elf, struct grub_xen_file_info *xi, descsz == 2 ? 2 : 3) == 0) xi->arch = GRUB_XEN_FILE_I386; break; + case XEN_ELFNOTE_INIT_P2M: + xi->p2m_base = grub_le_to_cpu_addr (*(Elf_Addr *) desc); + xi->has_p2m_base = 1; + break; + case XEN_ELFNOTE_MOD_START_PFN: + xi->unmapped_initrd = !!grub_le_to_cpu32(*(grub_uint32_t *) desc); + break; default: grub_dprintf ("xen", "unknown note type %d\n", nh->n_type); break; diff --git a/grub-core/loader/i386/xnu.c b/grub-core/loader/i386/xnu.c index 2fe1fdc1f..59ef73a73 100644 --- a/grub-core/loader/i386/xnu.c +++ b/grub-core/loader/i386/xnu.c @@ -35,6 +35,7 @@ #include #include #include +#include #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) @@ -338,7 +339,7 @@ grub_xnu_devprop_add_property_utf16 (struct grub_xnu_devprop_device_descriptor * utf8 = grub_malloc (namelen * 4 + 1); if (!utf8) { - grub_free (utf8); + grub_free (utf16); return grub_errno; } @@ -577,11 +578,31 @@ static grub_err_t grub_cpu_xnu_fill_devicetree (grub_uint64_t *fsbfreq_out) { struct grub_xnu_devtree_key *efikey; + struct grub_xnu_devtree_key *chosenkey; struct grub_xnu_devtree_key *cfgtablekey; struct grub_xnu_devtree_key *curval; struct grub_xnu_devtree_key *runtimesrvkey; struct grub_xnu_devtree_key *platformkey; unsigned i, j; + grub_err_t err; + + chosenkey = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + if (! chosenkey) + return grub_errno; + + /* Random seed. */ + curval = grub_xnu_create_value (&(chosenkey->first_child), "random-seed"); + if (! curval) + return grub_errno; + curval->datasize = 64; + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_errno; + /* Our random is not peer-reviewed but xnu uses this seed only for + ASLR in kernel. */ + err = grub_crypto_get_random (curval->data, curval->datasize); + if (err) + return err; /* The value "model". */ /* FIXME: may this value be sometimes different? */ @@ -897,6 +918,28 @@ grub_xnu_set_video (struct grub_xnu_boot_params_common *params) return GRUB_ERR_NONE; } +static int +total_ram_hook (grub_uint64_t addr __attribute__ ((unused)), grub_uint64_t size, + grub_memory_type_t type, + void *data) +{ + grub_uint64_t *result = data; + + if (type != GRUB_MEMORY_AVAILABLE) + return 0; + *result += size; + return 0; +} + +static grub_uint64_t +get_total_ram (void) +{ + grub_uint64_t result = 0; + + grub_mmap_iterate (total_ram_hook, &result); + return result; +} + /* Boot xnu. */ grub_err_t grub_xnu_boot (void) @@ -973,6 +1016,7 @@ grub_xnu_boot (void) { bootparams_common = &bootparams->v2.common; bootparams->v2.fsbfreq = fsbfreq; + bootparams->v2.ram_size = get_total_ram(); } else bootparams_common = &bootparams->v1.common; @@ -1080,7 +1124,7 @@ grub_xnu_boot (void) bootparams_common->efi_mmap = memory_map_target; bootparams_common->efi_mmap_size = memory_map_size; bootparams_common->heap_start = grub_xnu_heap_target_start; - bootparams_common->heap_size = grub_xnu_heap_size; + bootparams_common->heap_size = curruntimepage * GRUB_XNU_PAGESIZE - grub_xnu_heap_target_start; /* Parameters for asm helper. */ grub_xnu_stack = bootparams_common->heap_start diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c index e85623899..a97ed8739 100644 --- a/grub-core/loader/multiboot.c +++ b/grub-core/loader/multiboot.c @@ -119,6 +119,48 @@ grub_multiboot_set_video_mode (void) return err; } +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +#define grub_relocator_efi_boot grub_relocator64_efi_boot +#define grub_relocator_efi_state grub_relocator64_efi_state +#endif +#endif + +#ifdef grub_relocator_efi_boot +static void +efi_boot (struct grub_relocator *rel, + grub_uint32_t target) +{ + struct grub_relocator_efi_state state_efi = MULTIBOOT_EFI_INITIAL_STATE; + + state_efi.MULTIBOOT_EFI_ENTRY_REGISTER = grub_multiboot_payload_eip; + state_efi.MULTIBOOT_EFI_MBI_REGISTER = target; + + grub_relocator_efi_boot (rel, state_efi); +} +#else +#define grub_efi_is_finished 1 +static void +efi_boot (struct grub_relocator *rel __attribute__ ((unused)), + grub_uint32_t target __attribute__ ((unused))) +{ +} +#endif + +#if defined (__i386__) || defined (__x86_64__) +static void +normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state) +{ + grub_relocator32_boot (rel, state, 0); +} +#else +static void +normal_boot (struct grub_relocator *rel, struct grub_relocator32_state state) +{ + grub_relocator32_boot (rel, state); +} +#endif + static grub_err_t grub_multiboot_boot (void) { @@ -132,11 +174,10 @@ grub_multiboot_boot (void) if (err) return err; -#if defined (__i386__) || defined (__x86_64__) - grub_relocator32_boot (grub_multiboot_relocator, state, 0); -#else - grub_relocator32_boot (grub_multiboot_relocator, state); -#endif + if (grub_efi_is_finished) + normal_boot (grub_multiboot_relocator, state); + else + efi_boot (grub_multiboot_relocator, state.MULTIBOOT_MBI_REGISTER); /* Not reached. */ return GRUB_ERR_NONE; @@ -167,13 +208,12 @@ static grub_uint64_t highest_load; /* Load ELF32 or ELF64. */ grub_err_t -grub_multiboot_load_elf (grub_file_t file, const char *filename, - void *buffer) +grub_multiboot_load_elf (mbi_load_data_t *mld) { - if (grub_multiboot_is_elf32 (buffer)) - return grub_multiboot_load_elf32 (file, filename, buffer); - else if (grub_multiboot_is_elf64 (buffer)) - return grub_multiboot_load_elf64 (file, filename, buffer); + if (grub_multiboot_is_elf32 (mld->buffer)) + return grub_multiboot_load_elf32 (mld); + else if (grub_multiboot_is_elf64 (mld->buffer)) + return grub_multiboot_load_elf64 (mld); return grub_error (GRUB_ERR_UNKNOWN_OS, N_("invalid arch-dependent ELF magic")); } diff --git a/grub-core/loader/multiboot_elfxx.c b/grub-core/loader/multiboot_elfxx.c index 6a220bdc1..5e649ed25 100644 --- a/grub-core/loader/multiboot_elfxx.c +++ b/grub-core/loader/multiboot_elfxx.c @@ -51,11 +51,15 @@ CONCAT(grub_multiboot_is_elf, XX) (void *buffer) } static grub_err_t -CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, void *buffer) +CONCAT(grub_multiboot_load_elf, XX) (mbi_load_data_t *mld) { - Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer; + Elf_Ehdr *ehdr = (Elf_Ehdr *) mld->buffer; char *phdr_base; + grub_err_t err; + grub_relocator_chunk_t ch; + grub_uint32_t load_offset, load_size; int i; + void *source; if (ehdr->e_ident[EI_MAG0] != ELFMAG0 || ehdr->e_ident[EI_MAG1] != ELFMAG1 @@ -72,57 +76,89 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi return grub_error (GRUB_ERR_UNKNOWN_OS, N_("this ELF file is not of the right type")); /* FIXME: Should we support program headers at strange locations? */ - if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) + if (ehdr->e_phoff + (grub_uint32_t) ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); - phdr_base = (char *) buffer + ehdr->e_phoff; + phdr_base = (char *) mld->buffer + ehdr->e_phoff; #define phdr(i) ((Elf_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) + mld->link_base_addr = ~0; + + /* Calculate lowest and highest load address. */ + for (i = 0; i < ehdr->e_phnum; i++) + if (phdr(i)->p_type == PT_LOAD) + { + mld->link_base_addr = grub_min (mld->link_base_addr, phdr(i)->p_paddr); + highest_load = grub_max (highest_load, phdr(i)->p_paddr + phdr(i)->p_memsz); + } + +#ifdef MULTIBOOT_LOAD_ELF64 + if (highest_load >= 0x100000000) + return grub_error (GRUB_ERR_BAD_OS, "segment crosses 4 GiB border"); +#endif + + load_size = highest_load - mld->link_base_addr; + + if (mld->relocatable) + { + if (load_size > mld->max_addr || mld->min_addr > mld->max_addr - load_size) + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + + err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + mld->min_addr, mld->max_addr - load_size, + load_size, mld->align ? mld->align : 1, + mld->preference, mld->avoid_efi_boot_services); + } + else + err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, &ch, + mld->link_base_addr, load_size); + + if (err) + { + grub_dprintf ("multiboot_loader", "Cannot allocate memory for OS image\n"); + return err; + } + + mld->load_base_addr = get_physical_target_address (ch); + source = get_virtual_current_address (ch); + + grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " + "load_size=0x%x, relocatable=%d\n", mld->link_base_addr, + mld->load_base_addr, load_size, mld->relocatable); + + if (mld->relocatable) + grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", + (long) mld->align, mld->preference, mld->avoid_efi_boot_services); + /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { if (phdr(i)->p_type == PT_LOAD) { - grub_err_t err; - void *source; - - if (phdr(i)->p_paddr + phdr(i)->p_memsz > highest_load) - highest_load = phdr(i)->p_paddr + phdr(i)->p_memsz; grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n", i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr); - { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, - &ch, phdr(i)->p_paddr, - phdr(i)->p_memsz); - if (err) - { - grub_dprintf ("multiboot_loader", "Error loading phdr %d\n", i); - return err; - } - source = get_virtual_current_address (ch); - } + load_offset = phdr(i)->p_paddr - mld->link_base_addr; if (phdr(i)->p_filesz != 0) { - if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) + if (grub_file_seek (mld->file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) return grub_errno; - if (grub_file_read (file, source, phdr(i)->p_filesz) + if (grub_file_read (mld->file, (grub_uint8_t *) source + load_offset, phdr(i)->p_filesz) != (grub_ssize_t) phdr(i)->p_filesz) { if (!grub_errno) grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), - filename); + mld->filename); return grub_errno; } } if (phdr(i)->p_filesz < phdr(i)->p_memsz) - grub_memset ((grub_uint8_t *) source + phdr(i)->p_filesz, 0, + grub_memset ((grub_uint8_t *) source + load_offset + phdr(i)->p_filesz, 0, phdr(i)->p_memsz - phdr(i)->p_filesz); } } @@ -164,22 +200,22 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi { grub_uint8_t *shdr, *shdrptr; - shdr = grub_malloc (ehdr->e_shnum * ehdr->e_shentsize); + shdr = grub_malloc ((grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize); if (!shdr) return grub_errno; - if (grub_file_seek (file, ehdr->e_shoff) == (grub_off_t) -1) + if (grub_file_seek (mld->file, ehdr->e_shoff) == (grub_off_t) -1) { grub_free (shdr); return grub_errno; } - if (grub_file_read (file, shdr, ehdr->e_shnum * ehdr->e_shentsize) + if (grub_file_read (mld->file, shdr, (grub_uint32_t) ehdr->e_shnum * ehdr->e_shentsize) != (grub_ssize_t) ehdr->e_shnum * ehdr->e_shentsize) { if (!grub_errno) grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), - filename); + mld->filename); return grub_errno; } @@ -189,7 +225,9 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi Elf_Shdr *sh = (Elf_Shdr *) shdrptr; void *src; grub_addr_t target; - grub_err_t err; + + if (mld->mbi_ver >= 2 && (sh->sh_type == SHT_REL || sh->sh_type == SHT_RELA)) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ELF files with relocs are not supported yet"); /* This section is a loaded section, so we don't care. */ @@ -200,33 +238,28 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, const char *filename, voi if (sh->sh_size == 0) continue; - { - grub_relocator_chunk_t ch; - err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, - &ch, 0, - (0xffffffff - sh->sh_size) - + 1, sh->sh_size, - sh->sh_addralign, - GRUB_RELOCATOR_PREFERENCE_NONE, - 0); - if (err) - { - grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i); - return err; - } - src = get_virtual_current_address (ch); - target = get_physical_target_address (ch); - } + err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, 0, + (0xffffffff - sh->sh_size) + 1, + sh->sh_size, sh->sh_addralign, + GRUB_RELOCATOR_PREFERENCE_NONE, + mld->avoid_efi_boot_services); + if (err) + { + grub_dprintf ("multiboot_loader", "Error loading shdr %d\n", i); + return err; + } + src = get_virtual_current_address (ch); + target = get_physical_target_address (ch); - if (grub_file_seek (file, sh->sh_offset) == (grub_off_t) -1) + if (grub_file_seek (mld->file, sh->sh_offset) == (grub_off_t) -1) return grub_errno; - if (grub_file_read (file, src, sh->sh_size) + if (grub_file_read (mld->file, src, sh->sh_size) != (grub_ssize_t) sh->sh_size) { if (!grub_errno) grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"), - filename); + mld->filename); return grub_errno; } sh->sh_addr = target; diff --git a/grub-core/loader/multiboot_mbi2.c b/grub-core/loader/multiboot_mbi2.c index 501842815..c62ced3dc 100644 --- a/grub-core/loader/multiboot_mbi2.c +++ b/grub-core/loader/multiboot_mbi2.c @@ -69,6 +69,7 @@ static grub_size_t elf_sec_num, elf_sec_entsize; static unsigned elf_sec_shstrndx; static void *elf_sections; static int keep_bs = 0; +static grub_uint32_t load_base_addr; void grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize, @@ -102,39 +103,43 @@ find_header (grub_properly_aligned_t *buffer, grub_ssize_t len) grub_err_t grub_multiboot_load (grub_file_t file, const char *filename) { - grub_properly_aligned_t *buffer; grub_ssize_t len; struct multiboot_header *header; grub_err_t err; struct multiboot_header_tag *tag; struct multiboot_header_tag_address *addr_tag = NULL; - int entry_specified = 0; - grub_addr_t entry = 0; + struct multiboot_header_tag_relocatable *rel_tag; + int entry_specified = 0, efi_entry_specified = 0; + grub_addr_t entry = 0, efi_entry = 0; grub_uint32_t console_required = 0; struct multiboot_header_tag_framebuffer *fbtag = NULL; int accepted_consoles = GRUB_MULTIBOOT_CONSOLE_EGA_TEXT; + mbi_load_data_t mld; - buffer = grub_malloc (MULTIBOOT_SEARCH); - if (!buffer) + mld.mbi_ver = 2; + mld.relocatable = 0; + + mld.buffer = grub_malloc (MULTIBOOT_SEARCH); + if (!mld.buffer) return grub_errno; - len = grub_file_read (file, buffer, MULTIBOOT_SEARCH); + len = grub_file_read (file, mld.buffer, MULTIBOOT_SEARCH); if (len < 32) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"), filename); } COMPILE_TIME_ASSERT (MULTIBOOT_HEADER_ALIGN % 4 == 0); - grub_tpm_measure ((unsigned char *)buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename); + grub_tpm_measure ((unsigned char *)mld.buffer, len, GRUB_BINARY_PCR, "grub_multiboot", filename); grub_print_error(); - header = find_header (buffer, len); + header = find_header (mld.buffer, len); if (header == 0) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_BAD_ARGUMENT, "no multiboot header found"); } @@ -176,10 +181,13 @@ grub_multiboot_load (grub_file_t file, const char *filename) case MULTIBOOT_TAG_TYPE_NETWORK: case MULTIBOOT_TAG_TYPE_EFI_MMAP: case MULTIBOOT_TAG_TYPE_EFI_BS: + case MULTIBOOT_TAG_TYPE_EFI32_IH: + case MULTIBOOT_TAG_TYPE_EFI64_IH: + case MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR: break; default: - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, "unsupported information tag: 0x%x", request_tag->requests[i]); @@ -196,6 +204,13 @@ grub_multiboot_load (grub_file_t file, const char *filename) entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr; break; + case MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64: +#if defined (GRUB_MACHINE_EFI) && defined (__x86_64__) + efi_entry_specified = 1; + efi_entry = ((struct multiboot_header_tag_entry_address *) tag)->entry_addr; +#endif + break; + case MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS: if (!(((struct multiboot_header_tag_console_flags *) tag)->console_flags & MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED)) @@ -210,27 +225,50 @@ grub_multiboot_load (grub_file_t file, const char *filename) accepted_consoles |= GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER; break; + case MULTIBOOT_HEADER_TAG_RELOCATABLE: + mld.relocatable = 1; + rel_tag = (struct multiboot_header_tag_relocatable *) tag; + mld.min_addr = rel_tag->min_addr; + mld.max_addr = rel_tag->max_addr; + mld.align = rel_tag->align; + switch (rel_tag->preference) + { + case MULTIBOOT_LOAD_PREFERENCE_LOW: + mld.preference = GRUB_RELOCATOR_PREFERENCE_LOW; + break; + + case MULTIBOOT_LOAD_PREFERENCE_HIGH: + mld.preference = GRUB_RELOCATOR_PREFERENCE_HIGH; + break; + + default: + mld.preference = GRUB_RELOCATOR_PREFERENCE_NONE; + } + break; + /* GRUB always page-aligns modules. */ case MULTIBOOT_HEADER_TAG_MODULE_ALIGN: break; case MULTIBOOT_HEADER_TAG_EFI_BS: +#ifdef GRUB_MACHINE_EFI keep_bs = 1; +#endif break; default: if (! (tag->flags & MULTIBOOT_HEADER_TAG_OPTIONAL)) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, "unsupported tag: 0x%x", tag->type); } break; } - if (addr_tag && !entry_specified) + if (addr_tag && !entry_specified && !(keep_bs && efi_entry_specified)) { - grub_free (buffer); + grub_free (mld.buffer); return grub_error (GRUB_ERR_UNKNOWN_OS, "load address tag without entry address tag"); } @@ -239,8 +277,8 @@ grub_multiboot_load (grub_file_t file, const char *filename) { grub_uint64_t load_addr = (addr_tag->load_addr + 1) ? addr_tag->load_addr : (addr_tag->header_addr - - ((char *) header - (char *) buffer)); - int offset = ((char *) header - (char *) buffer - + - ((char *) header - (char *) mld.buffer)); + int offset = ((char *) header - (char *) mld.buffer - (addr_tag->header_addr - load_addr)); int load_size = ((addr_tag->load_end_addr == 0) ? file->size - offset : addr_tag->load_end_addr - addr_tag->load_addr); @@ -253,27 +291,50 @@ grub_multiboot_load (grub_file_t file, const char *filename) else code_size = load_size; - err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, - &ch, load_addr, - code_size); + if (mld.relocatable) + { + if (code_size > mld.max_addr || mld.min_addr > mld.max_addr - code_size) + { + grub_free (mld.buffer); + return grub_error (GRUB_ERR_BAD_OS, "invalid min/max address and/or load size"); + } + + err = grub_relocator_alloc_chunk_align (grub_multiboot_relocator, &ch, + mld.min_addr, mld.max_addr - code_size, + code_size, mld.align ? mld.align : 1, + mld.preference, keep_bs); + } + else + err = grub_relocator_alloc_chunk_addr (grub_multiboot_relocator, + &ch, load_addr, code_size); if (err) { grub_dprintf ("multiboot_loader", "Error loading aout kludge\n"); - grub_free (buffer); + grub_free (mld.buffer); return err; } + mld.link_base_addr = load_addr; + mld.load_base_addr = get_physical_target_address (ch); source = get_virtual_current_address (ch); + grub_dprintf ("multiboot_loader", "link_base_addr=0x%x, load_base_addr=0x%x, " + "load_size=0x%lx, relocatable=%d\n", mld.link_base_addr, + mld.load_base_addr, (long) code_size, mld.relocatable); + + if (mld.relocatable) + grub_dprintf ("multiboot_loader", "align=0x%lx, preference=0x%x, avoid_efi_boot_services=%d\n", + (long) mld.align, mld.preference, keep_bs); + if ((grub_file_seek (file, offset)) == (grub_off_t) -1) { - grub_free (buffer); + grub_free (mld.buffer); return grub_errno; } grub_file_read (file, source, load_size); if (grub_errno) { - grub_free (buffer); + grub_free (mld.buffer); return grub_errno; } @@ -283,17 +344,41 @@ grub_multiboot_load (grub_file_t file, const char *filename) } else { - err = grub_multiboot_load_elf (file, filename, buffer); + mld.file = file; + mld.filename = filename; + mld.avoid_efi_boot_services = keep_bs; + err = grub_multiboot_load_elf (&mld); if (err) { - grub_free (buffer); + grub_free (mld.buffer); return err; } } - if (entry_specified) + load_base_addr = mld.load_base_addr; + + if (keep_bs && efi_entry_specified) + grub_multiboot_payload_eip = efi_entry; + else if (entry_specified) grub_multiboot_payload_eip = entry; + if (mld.relocatable) + { + /* + * Both branches are mathematically equivalent. However, it looks + * that real life (C?) is more complicated. I am trying to avoid + * wrap around here if mld.load_base_addr < mld.link_base_addr. + * If you look at C operator precedence then everything should work. + * However, I am not 100% sure that a given compiler will not + * optimize/break this stuff. So, maybe we should use signed + * 64-bit int here. + */ + if (mld.load_base_addr >= mld.link_base_addr) + grub_multiboot_payload_eip += mld.load_base_addr - mld.link_base_addr; + else + grub_multiboot_payload_eip -= mld.link_base_addr - mld.load_base_addr; + } + if (fbtag) err = grub_multiboot_set_console (GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER, accepted_consoles, @@ -381,7 +466,7 @@ static grub_size_t grub_multiboot_get_mbi_size (void) { #ifdef GRUB_MACHINE_EFI - if (!efi_mmap_size) + if (!keep_bs && !efi_mmap_size) find_efi_mmap_size (); #endif return 2 * sizeof (grub_uint32_t) + sizeof (struct multiboot_tag) @@ -400,13 +485,16 @@ grub_multiboot_get_mbi_size (void) + grub_get_multiboot_mmap_count () * sizeof (struct multiboot_mmap_entry)), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), MULTIBOOT_TAG_ALIGN) - + ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN) - + ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_old_acpi) + sizeof (struct grub_acpi_rsdp_v10), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_load_base_addr), MULTIBOOT_TAG_ALIGN) + acpiv2_size () + net_size () #ifdef GRUB_MACHINE_EFI + + ALIGN_UP (sizeof (struct multiboot_tag_efi32), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_efi32_ih), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_efi64), MULTIBOOT_TAG_ALIGN) + + ALIGN_UP (sizeof (struct multiboot_tag_efi64_ih), MULTIBOOT_TAG_ALIGN) + ALIGN_UP (sizeof (struct multiboot_tag_efi_mmap) + efi_mmap_size, MULTIBOOT_TAG_ALIGN) #endif @@ -424,6 +512,7 @@ grub_fill_multiboot_mmap_iter (grub_uint64_t addr, grub_uint64_t size, (*mmap_entry)->addr = addr; (*mmap_entry)->len = size; (*mmap_entry)->type = type; + (*mmap_entry)->zero = 0; (*mmap_entry)++; return 0; @@ -681,6 +770,15 @@ grub_multiboot_make_mbi (grub_uint32_t *target) % sizeof (grub_properly_aligned_t) == 0); ptrorig += (2 * sizeof (grub_uint32_t)) / sizeof (grub_properly_aligned_t); + { + struct multiboot_tag_load_base_addr *tag = (struct multiboot_tag_load_base_addr *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR; + tag->size = sizeof (struct multiboot_tag_load_base_addr); + tag->load_base_addr = load_base_addr; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } + { struct multiboot_tag_string *tag = (struct multiboot_tag_string *) ptrorig; tag->type = MULTIBOOT_TAG_TYPE_CMDLINE; @@ -743,12 +841,13 @@ grub_multiboot_make_mbi (grub_uint32_t *target) } } - { - struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig; - grub_fill_multiboot_mmap (tag); - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); - } + if (!keep_bs) + { + struct multiboot_tag_mmap *tag = (struct multiboot_tag_mmap *) ptrorig; + grub_fill_multiboot_mmap (tag); + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } { struct multiboot_tag_elf_sections *tag @@ -764,18 +863,19 @@ grub_multiboot_make_mbi (grub_uint32_t *target) / sizeof (grub_properly_aligned_t); } - { - struct multiboot_tag_basic_meminfo *tag - = (struct multiboot_tag_basic_meminfo *) ptrorig; - tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO; - tag->size = sizeof (struct multiboot_tag_basic_meminfo); + if (!keep_bs) + { + struct multiboot_tag_basic_meminfo *tag + = (struct multiboot_tag_basic_meminfo *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO; + tag->size = sizeof (struct multiboot_tag_basic_meminfo); - /* Convert from bytes to kilobytes. */ - tag->mem_lower = grub_mmap_get_lower () / 1024; - tag->mem_upper = grub_mmap_get_upper () / 1024; - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); - } + /* Convert from bytes to kilobytes. */ + tag->mem_lower = grub_mmap_get_lower () / 1024; + tag->mem_upper = grub_mmap_get_upper () / 1024; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } { struct grub_net_network_level_interface *net; @@ -874,36 +974,57 @@ grub_multiboot_make_mbi (grub_uint32_t *target) grub_efi_uintn_t efi_desc_size; grub_efi_uint32_t efi_desc_version; - tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP; - tag->size = sizeof (*tag) + efi_mmap_size; - if (!keep_bs) - err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL, - &efi_desc_size, &efi_desc_version); - else { - if (grub_efi_get_memory_map (&efi_mmap_size, (void *) tag->efi_mmap, - NULL, - &efi_desc_size, &efi_desc_version) <= 0) - err = grub_error (GRUB_ERR_IO, "couldn't retrieve memory map"); - } - if (err) - return err; - tag->descr_size = efi_desc_size; - tag->descr_vers = efi_desc_version; - tag->size = sizeof (*tag) + efi_mmap_size; + tag->type = MULTIBOOT_TAG_TYPE_EFI_MMAP; + tag->size = sizeof (*tag) + efi_mmap_size; - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + err = grub_efi_finish_boot_services (&efi_mmap_size, tag->efi_mmap, NULL, + &efi_desc_size, &efi_desc_version); + + if (err) + return err; + + tag->descr_size = efi_desc_size; + tag->descr_vers = efi_desc_version; + tag->size = sizeof (*tag) + efi_mmap_size; + + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } } if (keep_bs) { - struct multiboot_tag *tag = (struct multiboot_tag *) ptrorig; - tag->type = MULTIBOOT_TAG_TYPE_EFI_BS; - tag->size = sizeof (struct multiboot_tag); - ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) - / sizeof (grub_properly_aligned_t); + { + struct multiboot_tag *tag = (struct multiboot_tag *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_EFI_BS; + tag->size = sizeof (struct multiboot_tag); + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } + +#ifdef __i386__ + { + struct multiboot_tag_efi32_ih *tag = (struct multiboot_tag_efi32_ih *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_EFI32_IH; + tag->size = sizeof (struct multiboot_tag_efi32_ih); + tag->pointer = (grub_addr_t) grub_efi_image_handle; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } +#endif + +#ifdef __x86_64__ + { + struct multiboot_tag_efi64_ih *tag = (struct multiboot_tag_efi64_ih *) ptrorig; + tag->type = MULTIBOOT_TAG_TYPE_EFI64_IH; + tag->size = sizeof (struct multiboot_tag_efi64_ih); + tag->pointer = (grub_addr_t) grub_efi_image_handle; + ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) + / sizeof (grub_properly_aligned_t); + } +#endif } #endif diff --git a/grub-core/loader/sparc64/ieee1275/linux.c b/grub-core/loader/sparc64/ieee1275/linux.c index 346d9538e..67ef04883 100644 --- a/grub-core/loader/sparc64/ieee1275/linux.c +++ b/grub-core/loader/sparc64/ieee1275/linux.c @@ -140,17 +140,17 @@ grub_linux_boot (void) grub_dprintf ("loader", "Jumping to Linux...\n"); /* Boot the kernel. */ - asm volatile ("sethi %hi(grub_ieee1275_entry_fn), %o1\n" - "ldx [%o1 + %lo(grub_ieee1275_entry_fn)], %o4\n" - "sethi %hi(grub_ieee1275_original_stack), %o1\n" - "ldx [%o1 + %lo(grub_ieee1275_original_stack)], %o6\n" - "sethi %hi(linux_addr), %o1\n" - "ldx [%o1 + %lo(linux_addr)], %o5\n" - "mov %g0, %o0\n" - "mov %g0, %o2\n" - "mov %g0, %o3\n" - "jmp %o5\n" - "mov %g0, %o1\n"); + asm volatile ("ldx %0, %%o4\n" + "ldx %1, %%o6\n" + "ldx %2, %%o5\n" + "mov %%g0, %%o0\n" + "mov %%g0, %%o2\n" + "mov %%g0, %%o3\n" + "jmp %%o5\n" + "mov %%g0, %%o1\n": : + "m"(grub_ieee1275_entry_fn), + "m"(grub_ieee1275_original_stack), + "m"(linux_addr)); return GRUB_ERR_NONE; } @@ -203,20 +203,20 @@ alloc_phys_choose (grub_uint64_t addr, grub_uint64_t len, if (addr + ctx->size >= end) return 0; - if (addr >= grub_phys_start && addr < grub_phys_end) - { - addr = ALIGN_UP (grub_phys_end, FOUR_MB); - if (addr + ctx->size >= end) - return 0; - } - if ((addr + ctx->size) >= grub_phys_start - && (addr + ctx->size) < grub_phys_end) + /* OBP available region contains grub. Start at grub_phys_end. */ + /* grub_phys_start does not start at the beginning of the memory region */ + if ((grub_phys_start >= addr && grub_phys_end < end) || + (addr > grub_phys_start && addr < grub_phys_end)) { addr = ALIGN_UP (grub_phys_end, FOUR_MB); if (addr + ctx->size >= end) return 0; } + grub_dprintf("loader", + "addr = 0x%lx grub_phys_start = 0x%lx grub_phys_end = 0x%lx\n", + addr, grub_phys_start, grub_phys_end); + if (loaded) { grub_addr_t linux_end = ALIGN_UP (linux_paddr + linux_size, FOUR_MB); diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c index a40163a6f..0da8e2499 100644 --- a/grub-core/net/bootp.c +++ b/grub-core/net/bootp.c @@ -100,7 +100,7 @@ parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask) grub_memcpy (&gw.ipv4, ptr, sizeof (gw.ipv4)); rname = grub_xasprintf ("%s:default", name); if (rname) - grub_net_add_route_gw (rname, target, gw); + grub_net_add_route_gw (rname, target, gw, NULL); grub_free (rname); } break; @@ -160,6 +160,7 @@ grub_net_configure_by_dhcp_ack (const char *name, grub_net_link_level_address_t hwaddr; struct grub_net_network_level_interface *inter; int mask = -1; + char server_ip[sizeof ("xxx.xxx.xxx.xxx")]; addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV4; addr.ipv4 = bp->your_ip; @@ -175,6 +176,9 @@ grub_net_configure_by_dhcp_ack (const char *name, hwaddr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; inter = grub_net_add_addr (name, card, &addr, &hwaddr, flags); + if (!inter) + return 0; + #if 0 /* This is likely based on misunderstanding. gateway_ip refers to address of BOOTP relay and should not be used after BOOTP transaction @@ -207,15 +211,22 @@ grub_net_configure_by_dhcp_ack (const char *name, if (size > OFFSET_OF (boot_file, bp)) grub_env_set_net_property (name, "boot_file", bp->boot_file, sizeof (bp->boot_file)); + if (bp->server_ip) + { + grub_snprintf (server_ip, sizeof (server_ip), "%d.%d.%d.%d", + ((grub_uint8_t *) &bp->server_ip)[0], + ((grub_uint8_t *) &bp->server_ip)[1], + ((grub_uint8_t *) &bp->server_ip)[2], + ((grub_uint8_t *) &bp->server_ip)[3]); + grub_env_set_net_property (name, "next_server", server_ip, sizeof (server_ip)); + grub_print_error (); + } + if (is_def) grub_net_default_server = 0; if (is_def && !grub_net_default_server && bp->server_ip) { - grub_net_default_server = grub_xasprintf ("%d.%d.%d.%d", - ((grub_uint8_t *) &bp->server_ip)[0], - ((grub_uint8_t *) &bp->server_ip)[1], - ((grub_uint8_t *) &bp->server_ip)[2], - ((grub_uint8_t *) &bp->server_ip)[3]); + grub_net_default_server = grub_strdup (server_ip); grub_print_error (); } @@ -227,11 +238,7 @@ grub_net_configure_by_dhcp_ack (const char *name, if (device && !*device && bp->server_ip) { - *device = grub_xasprintf ("tftp,%d.%d.%d.%d", - ((grub_uint8_t *) &bp->server_ip)[0], - ((grub_uint8_t *) &bp->server_ip)[1], - ((grub_uint8_t *) &bp->server_ip)[2], - ((grub_uint8_t *) &bp->server_ip)[3]); + *device = grub_xasprintf ("tftp,%s", server_ip); grub_print_error (); } if (size > OFFSET_OF (server_name, bp) @@ -386,6 +393,7 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (grub_strcmp (args[3], "string") == 0) { + grub_err_t err = GRUB_ERR_NONE; char *val = grub_malloc (taglength + 1); if (!val) return grub_errno; @@ -394,8 +402,9 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (args[0][0] == '-' && args[0][1] == 0) grub_printf ("%s\n", val); else - return grub_env_set (args[0], val); - return GRUB_ERR_NONE; + err = grub_env_set (args[0], val); + grub_free (val); + return err; } if (grub_strcmp (args[3], "number") == 0) @@ -417,6 +426,7 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (grub_strcmp (args[3], "hex") == 0) { + grub_err_t err = GRUB_ERR_NONE; char *val = grub_malloc (2 * taglength + 1); int i; if (!val) @@ -430,8 +440,9 @@ grub_cmd_dhcpopt (struct grub_command *cmd __attribute__ ((unused)), if (args[0][0] == '-' && args[0][1] == 0) grub_printf ("%s\n", val); else - return grub_env_set (args[0], val); - return GRUB_ERR_NONE; + err = grub_env_set (args[0], val); + grub_free (val); + return err; } return grub_error (GRUB_ERR_BAD_ARGUMENT, diff --git a/grub-core/net/dns.c b/grub-core/net/dns.c index 35942d6b8..5deb1efd3 100644 --- a/grub-core/net/dns.c +++ b/grub-core/net/dns.c @@ -238,6 +238,15 @@ recv_hook (grub_net_udp_socket_t sock __attribute__ ((unused)), char *redirect_save = NULL; grub_uint32_t ttl_all = ~0U; + /* Code apparently assumed that only one packet is received as response. + We may get multiple responses due to network condition, so check here + and quit early. */ + if (*data->addresses) + { + grub_netbuff_free (nb); + return GRUB_ERR_NONE; + } + head = (struct dns_header *) nb->data; ptr = (grub_uint8_t *) (head + 1); if (ptr >= nb->tail) diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c index eff9085ed..a78d164db 100644 --- a/grub-core/net/drivers/ieee1275/ofnet.c +++ b/grub-core/net/drivers/ieee1275/ofnet.c @@ -85,24 +85,30 @@ get_card_packet (struct grub_net_card *dev) grub_uint64_t start_time; struct grub_net_buff *nb; - nb = grub_netbuff_alloc (dev->mtu + 64 + 2); + start_time = grub_get_time_ms (); + do + rc = grub_ieee1275_read (data->handle, dev->rcvbuf, dev->rcvbufsize, &actual); + while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200)); + + if (actual <= 0) + return NULL; + + nb = grub_netbuff_alloc (actual + 2); if (!nb) return NULL; /* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible by 4. So that IP header is aligned on 4 bytes. */ grub_netbuff_reserve (nb, 2); - start_time = grub_get_time_ms (); - do - rc = grub_ieee1275_read (data->handle, nb->data, dev->mtu + 64, &actual); - while ((actual <= 0 || rc < 0) && (grub_get_time_ms () - start_time < 200)); - if (actual > 0) + grub_memcpy (nb->data, dev->rcvbuf, actual); + + if (grub_netbuff_put (nb, actual)) { - grub_netbuff_put (nb, actual); - return nb; + grub_netbuff_free (nb); + return NULL; } - grub_netbuff_free (nb); - return NULL; + + return nb; } static struct grub_net_card_driver ofdriver = @@ -151,7 +157,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, grub_net_network_level_address_t client_addr, gateway_addr, subnet_mask; grub_net_link_level_address_t hw_addr; grub_net_interface_flags_t flags = 0; - struct grub_net_network_level_interface *inter; + struct grub_net_network_level_interface *inter = NULL; hw_addr.type = GRUB_NET_LINK_LEVEL_PROTOCOL_ETHERNET; @@ -221,7 +227,7 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath, target.ipv4.masksize = 0; rname = grub_xasprintf ("%s:default", ((*card)->name)); if (rname) - grub_net_add_route_gw (rname, target, gateway_addr); + grub_net_add_route_gw (rname, target, gateway_addr, inter); else return grub_errno; } @@ -294,6 +300,91 @@ grub_ieee1275_net_config_real (const char *devpath, char **device, char **path, } } +/* Allocate memory with alloc-mem */ +static void * +grub_ieee1275_alloc_mem (grub_size_t len) +{ + struct alloc_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t len; + grub_ieee1275_cell_t catch; + grub_ieee1275_cell_t result; + } + args; + + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + { + grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); + return NULL; + } + + INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2); + args.len = len; + args.method = (grub_ieee1275_cell_t) "alloc-mem"; + + if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || args.catch) + { + grub_error (GRUB_ERR_INVALID_COMMAND, N_("alloc-mem failed")); + return NULL; + } + else + return (void *)args.result; +} + +/* Free memory allocated by alloc-mem */ +static grub_err_t +grub_ieee1275_free_mem (void *addr, grub_size_t len) +{ + struct free_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t len; + grub_ieee1275_cell_t addr; + grub_ieee1275_cell_t catch; + } + args; + + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + { + grub_error (GRUB_ERR_UNKNOWN_COMMAND, N_("interpret is not supported")); + return grub_errno; + } + + INIT_IEEE1275_COMMON (&args.common, "interpret", 3, 1); + args.addr = (grub_ieee1275_cell_t)addr; + args.len = len; + args.method = (grub_ieee1275_cell_t) "free-mem"; + + if (IEEE1275_CALL_ENTRY_FN(&args) == -1 || args.catch) + { + grub_error (GRUB_ERR_INVALID_COMMAND, N_("free-mem failed")); + return grub_errno; + } + + return GRUB_ERR_NONE; +} + +static void * +ofnet_alloc_netbuf (grub_size_t len) +{ + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) + return grub_ieee1275_alloc_mem (len); + else + return grub_zalloc (len); +} + +static void +ofnet_free_netbuf (void *addr, grub_size_t len) +{ + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) + grub_ieee1275_free_mem (addr, len); + else + grub_free (addr); +} + static int search_net_devices (struct grub_ieee1275_devalias *alias) { @@ -409,40 +500,19 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->default_address = lla; card->txbufsize = ALIGN_UP (card->mtu, 64) + 256; + card->rcvbufsize = ALIGN_UP (card->mtu, 64) + 256; - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_VIRT_TO_REAL_BROKEN)) - { - struct alloc_args - { - struct grub_ieee1275_common_hdr common; - grub_ieee1275_cell_t method; - grub_ieee1275_cell_t len; - grub_ieee1275_cell_t catch; - grub_ieee1275_cell_t result; - } - args; - INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2); - args.len = card->txbufsize; - args.method = (grub_ieee1275_cell_t) "alloc-mem"; - - if (IEEE1275_CALL_ENTRY_FN (&args) == -1 - || args.catch) - { - card->txbuf = 0; - grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory")); - } - else - card->txbuf = (void *) args.result; - } - else - card->txbuf = grub_zalloc (card->txbufsize); + card->txbuf = ofnet_alloc_netbuf (card->txbufsize); if (!card->txbuf) + goto fail_netbuf; + + card->rcvbuf = ofnet_alloc_netbuf (card->rcvbufsize); + if (!card->rcvbuf) { - grub_free (ofdata->path); - grub_free (ofdata); - grub_free (card); - grub_print_error (); - return 0; + grub_error_push (); + ofnet_free_netbuf (card->txbuf, card->txbufsize); + grub_error_pop (); + goto fail_netbuf; } card->driver = NULL; card->data = ofdata; @@ -455,6 +525,13 @@ search_net_devices (struct grub_ieee1275_devalias *alias) card->driver = &ofdriver; grub_net_card_register (card); return 0; + +fail_netbuf: + grub_free (ofdata->path); + grub_free (ofdata); + grub_free (card); + grub_print_error (); + return 0; } static void diff --git a/grub-core/net/http.c b/grub-core/net/http.c index 0dbb49a5e..389a78ee0 100644 --- a/grub-core/net/http.c +++ b/grub-core/net/http.c @@ -381,9 +381,8 @@ http_establish (struct grub_file *file, grub_off_t offset, int initial) ptr = nb->tail; grub_snprintf ((char *) ptr, sizeof ("Range: bytes=XXXXXXXXXXXXXXXXXXXX-" - "\r\n" "\r\n"), - "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n\r\n", + "Range: bytes=%" PRIuGRUB_UINT64_T "-\r\n", offset); grub_netbuff_put (nb, grub_strlen ((char *) ptr)); } @@ -454,6 +453,7 @@ http_seek (struct grub_file *file, grub_off_t off) } file->device->net->stall = 0; + file->device->net->eof = 0; file->device->net->offset = off; data = grub_zalloc (sizeof (*data)); diff --git a/grub-core/net/icmp6.c b/grub-core/net/icmp6.c index 7953e68ec..2cbd95dce 100644 --- a/grub-core/net/icmp6.c +++ b/grub-core/net/icmp6.c @@ -115,6 +115,7 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, grub_uint8_t ttl) { struct icmp_header *icmph; + struct grub_net_network_level_interface *orig_inf = inf; grub_err_t err; grub_uint16_t checksum; @@ -345,14 +346,31 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, { grub_uint8_t *ptr; struct option_header *ohdr; + struct router_adv *radv; + struct grub_net_network_level_interface *route_inf = NULL; + int default_route = 0; if (icmph->code) break; + radv = (struct router_adv *)nb->data; err = grub_netbuff_pull (nb, sizeof (struct router_adv)); if (err) { grub_netbuff_free (nb); return err; } + if (grub_be_to_cpu16 (radv->router_lifetime) > 0) + { + struct grub_net_route *route; + + FOR_NET_ROUTES (route) + { + if (!grub_memcmp (&route->gw, source, sizeof (route->gw))) + break; + } + if (route == NULL) + default_route = 1; + } + for (ptr = (grub_uint8_t *) nb->data; ptr < nb->tail; ptr += ohdr->len * 8) { @@ -413,7 +431,11 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, /* Update lease time if needed here once we have lease times. */ if (inf) - continue; + { + if (!route_inf) + route_inf = inf; + continue; + } grub_dprintf ("net", "creating slaac\n"); @@ -429,12 +451,51 @@ grub_net_recv_icmp6_packet (struct grub_net_buff *nb, inf = grub_net_add_addr (name, card, &addr, &slaac->address, 0); + if (!route_inf) + route_inf = inf; grub_net_add_route (name, netaddr, inf); grub_free (name); } } } } + if (default_route) + { + char *name; + grub_net_network_level_netaddress_t netaddr; + name = grub_xasprintf ("%s:ra:default6", card->name); + if (!name) + { + grub_errno = GRUB_ERR_NONE; + goto next; + } + /* Default routes take alll of the traffic, so make the mask huge */ + netaddr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; + netaddr.ipv6.masksize = 0; + netaddr.ipv6.base[0] = 0; + netaddr.ipv6.base[1] = 0; + + /* May not have gotten slaac info, find a global address on this + card. */ + if (route_inf == NULL) + { + FOR_NET_NETWORK_LEVEL_INTERFACES (inf) + { + if (inf->card == card && inf != orig_inf + && inf->address.type == GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6 + && grub_net_hwaddr_cmp(&inf->hwaddress, + &orig_inf->hwaddress) == 0) + { + route_inf = inf; + break; + } + } + } + if (route_inf != NULL) + grub_net_add_route_gw (name, netaddr, *source, route_inf); + grub_free (name); + } +next: if (ptr != nb->tail) break; } diff --git a/grub-core/net/ip.c b/grub-core/net/ip.c index 8c56baaf7..aba4f8908 100644 --- a/grub-core/net/ip.c +++ b/grub-core/net/ip.c @@ -363,7 +363,9 @@ static void free_old_fragments (void) { struct reassemble *rsm, **prev; - grub_uint64_t limit_time = grub_get_time_ms () - 90000; + grub_uint64_t limit_time = grub_get_time_ms (); + + limit_time = (limit_time > 90000) ? limit_time - 90000 : 0; for (prev = &reassembles, rsm = *prev; rsm; rsm = *prev) if (rsm->last_time < limit_time) diff --git a/grub-core/net/net.c b/grub-core/net/net.c index e17c64a71..5e3704831 100644 --- a/grub-core/net/net.c +++ b/grub-core/net/net.c @@ -37,21 +37,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); char *grub_net_default_server; -struct grub_net_route -{ - struct grub_net_route *next; - struct grub_net_route **prev; - grub_net_network_level_netaddress_t target; - char *name; - struct grub_net_network_level_protocol *prot; - int is_gateway; - union - { - struct grub_net_network_level_interface *interface; - grub_net_network_level_address_t gw; - }; -}; - struct grub_net_route *grub_net_routes = NULL; struct grub_net_network_level_interface *grub_net_network_level_interfaces = NULL; struct grub_net_card *grub_net_cards = NULL; @@ -299,12 +284,6 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, char *ptr; grub_net_network_level_address_t addr; - name = grub_malloc (grub_strlen (card->name) - + GRUB_NET_MAX_STR_HWADDR_LEN - + sizeof (":link")); - if (!name) - return NULL; - addr.type = GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6; addr.ipv6[0] = grub_cpu_to_be64_compile_time (0xfe80ULL << 48); addr.ipv6[1] = grub_net_ipv6_get_id (hwaddr); @@ -317,6 +296,12 @@ grub_net_ipv6_get_link_local (struct grub_net_card *card, return inf; } + name = grub_malloc (grub_strlen (card->name) + + GRUB_NET_MAX_STR_HWADDR_LEN + + sizeof (":link")); + if (!name) + return NULL; + ptr = grub_stpcpy (name, card->name); if (grub_net_hwaddr_cmp (&card->default_address, hwaddr) != 0) { @@ -410,14 +395,6 @@ grub_cmd_ipv6_autoconf (struct grub_command *cmd __attribute__ ((unused)), return err; } -static inline void -grub_net_route_register (struct grub_net_route *route) -{ - grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), - GRUB_AS_LIST (route)); -} - -#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) static int parse_ip (const char *val, grub_uint32_t *ip, const char **rest) @@ -524,6 +501,8 @@ match_net (const grub_net_network_level_netaddress_t *net, case GRUB_NET_NETWORK_LEVEL_PROTOCOL_IPV6: { grub_uint64_t mask[2]; + if (net->ipv6.masksize == 0) + return 1; if (net->ipv6.masksize <= 64) { mask[0] = 0xffffffffffffffffULL << (64 - net->ipv6.masksize); @@ -687,7 +666,14 @@ grub_net_route_address (grub_net_network_level_address_t addr, return GRUB_ERR_NONE; } if (depth == 0) - *gateway = bestroute->gw; + { + *gateway = bestroute->gw; + if (bestroute->interface != NULL) + { + *interf = bestroute->interface; + return GRUB_ERR_NONE; + } + } curtarget = bestroute->gw; } @@ -1109,7 +1095,8 @@ grub_net_add_route (const char *name, grub_err_t grub_net_add_route_gw (const char *name, grub_net_network_level_netaddress_t target, - grub_net_network_level_address_t gw) + grub_net_network_level_address_t gw, + struct grub_net_network_level_interface *inter) { struct grub_net_route *route; @@ -1127,6 +1114,7 @@ grub_net_add_route_gw (const char *name, route->target = target; route->is_gateway = 1; route->gw = gw; + route->interface = inter; grub_net_route_register (route); @@ -1152,7 +1140,7 @@ grub_cmd_addroute (struct grub_command *cmd __attribute__ ((unused)), err = grub_net_resolve_address (args[3], &gw); if (err) return err; - return grub_net_add_route_gw (args[0], target, gw); + return grub_net_add_route_gw (args[0], target, gw, NULL); } else { @@ -1333,7 +1321,8 @@ grub_net_open_real (const char *name) if (!ret) return NULL; ret->protocol = proto; - if (server) + ret->server = grub_strdup (server); + if (!ret->server) { ret->server = grub_strdup (server); ret->port = port; @@ -1343,11 +1332,7 @@ grub_net_open_real (const char *name) return NULL; } } - else - ret->server = NULL; ret->fs = &grub_net_fs; - ret->offset = 0; - ret->eof = 0; return ret; } } @@ -1377,6 +1362,15 @@ grub_net_open_real (const char *name) continue; } + if (grub_strncmp (prefdev, "pxe", sizeof ("pxe") - 1) == 0 && + (!prefdev[sizeof ("pxe") - 1] || (prefdev[sizeof("pxe") - 1] == ':'))) + { + grub_free (prefdev); + prefdev = grub_strdup ("tftp"); + if (!prefdev) + continue; + } + comma = grub_strchr (prefdev, ','); if (comma) *comma = '\0'; @@ -1440,7 +1434,10 @@ grub_net_fs_open (struct grub_file *file_out, const char *name) file->device->net->packs.last = NULL; file->device->net->name = grub_strdup (name); if (!file->device->net->name) - return grub_errno; + { + grub_free (file); + return grub_errno; + } err = file->device->net->protocol->open (file, name); if (err) @@ -1700,6 +1697,7 @@ grub_net_seek_real (struct grub_file *file, grub_off_t offset) file->device->net->packs.last = NULL; file->device->net->offset = 0; file->device->net->eof = 0; + file->device->net->stall = 0; err = file->device->net->protocol->open (file, file->device->net->name); if (err) return err; diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c index 576f68498..e8ad34b84 100644 --- a/grub-core/net/tcp.c +++ b/grub-core/net/tcp.c @@ -606,10 +606,15 @@ grub_net_tcp_open (char *server, nb = grub_netbuff_alloc (sizeof (*tcph) + 128); if (!nb) - return NULL; + { + grub_free (socket); + return NULL; + } + err = grub_netbuff_reserve (nb, 128); if (err) { + grub_free (socket); grub_netbuff_free (nb); return NULL; } @@ -617,12 +622,14 @@ grub_net_tcp_open (char *server, err = grub_netbuff_put (nb, sizeof (*tcph)); if (err) { + grub_free (socket); grub_netbuff_free (nb); return NULL; } socket->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); if (!socket->pq) { + grub_free (socket); grub_netbuff_free (nb); return NULL; } @@ -978,6 +985,7 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, cmp); if (!sock->pq) { + grub_free (sock); grub_netbuff_free (nb); return grub_errno; } diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c index 1319671ff..7d90bf66e 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -326,7 +326,10 @@ tftp_open (struct grub_file *file, const char *filename) grub_netbuff_reserve (&nb, 1500); err = grub_netbuff_push (&nb, sizeof (*tftph)); if (err) - return err; + { + grub_free (data); + return err; + } tftph = (struct tftphdr *) nb.data; @@ -361,19 +364,26 @@ tftp_open (struct grub_file *file, const char *filename) err = grub_netbuff_unput (&nb, nb.tail - (nb.data + hdrlen)); if (err) - return err; + { + grub_free (data); + return err; + } file->not_easily_seekable = 1; file->data = data; data->pq = grub_priority_queue_new (sizeof (struct grub_net_buff *), cmp); if (!data->pq) - return grub_errno; + { + grub_free (data); + return grub_errno; + } err = grub_net_resolve_address (file->device->net->server, &addr); if (err) { destroy_pq (data); + grub_free (data); return err; } @@ -383,6 +393,7 @@ tftp_open (struct grub_file *file, const char *filename) if (!data->sock) { destroy_pq (data); + grub_free (data); return grub_errno; } @@ -396,6 +407,7 @@ tftp_open (struct grub_file *file, const char *filename) { grub_net_udp_close (data->sock); destroy_pq (data); + grub_free (data); return err; } grub_net_poll_cards (GRUB_NET_INTERVAL + (i * GRUB_NET_INTERVAL_ADDITION), @@ -412,6 +424,7 @@ tftp_open (struct grub_file *file, const char *filename) { grub_net_udp_close (data->sock); destroy_pq (data); + grub_free (data); return grub_errno; } diff --git a/grub-core/normal/menu_entry.c b/grub-core/normal/menu_entry.c index 62c7e1627..eeeee5580 100644 --- a/grub-core/normal/menu_entry.c +++ b/grub-core/normal/menu_entry.c @@ -126,9 +126,13 @@ ensure_space (struct line *linep, int extra) static int get_logical_num_lines (struct line *linep, struct per_term_screen *term_screen) { - return (grub_getstringwidth (linep->buf, linep->buf + linep->len, - term_screen->term) - / (unsigned) term_screen->geo.entry_width) + 1; + grub_size_t width = grub_getstringwidth (linep->buf, linep->buf + linep->len, + term_screen->term); + + /* Empty line still consumes space on screen */ + return width ? (width + (unsigned) term_screen->geo.entry_width - 1) / + (unsigned) term_screen->geo.entry_width + : 1; } static void @@ -250,6 +254,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, mode = ALL_LINES; } + grub_term_setcursor (term_screen->term, 0); + if (mode != NO_LINE) { /* Draw lines. This code is tricky, because this must calculate logical @@ -357,6 +363,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen, } + grub_term_setcursor (term_screen->term, 1); + grub_term_refresh (term_screen->term); } @@ -472,7 +480,10 @@ insert_string (struct screen *screen, const char *s, int update) (grub_uint8_t *) s, (p - s), 0); if (! ensure_space (current_linep, size)) - return 0; + { + grub_free (unicode_msg); + return 0; + } grub_memmove (current_linep->buf + screen->column + size, current_linep->buf + screen->column, @@ -1261,6 +1272,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (! screen->lines[i].pos) { grub_print_error (); + destroy_screen (screen); grub_errno = GRUB_ERR_NONE; return; } @@ -1270,6 +1282,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (!screen->terms) { grub_print_error (); + destroy_screen (screen); grub_errno = GRUB_ERR_NONE; return; } diff --git a/grub-core/normal/term.c b/grub-core/normal/term.c index 4c2238b25..ac5d69f0f 100644 --- a/grub-core/normal/term.c +++ b/grub-core/normal/term.c @@ -77,8 +77,6 @@ print_more (void) grub_term_output_t term; grub_uint32_t *unicode_str, *unicode_last_position; - pos = grub_term_save_pos (); - /* TRANSLATORS: This has to fit on one line. It's ok to include few words but don't write poems. */ grub_utf8_to_ucs4_alloc (_("--MORE--"), &unicode_str, @@ -90,6 +88,8 @@ print_more (void) return; } + pos = grub_term_save_pos (); + grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); FOR_ACTIVE_TERM_OUTPUTS(term) diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index 64419f678..a13a39c96 100644 --- a/grub-core/osdep/devmapper/getroot.c +++ b/grub-core/osdep/devmapper/getroot.c @@ -40,6 +40,12 @@ #include #endif +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif + #include #include @@ -137,7 +143,7 @@ grub_util_get_dm_abstraction (const char *os_dev) grub_free (uuid); return GRUB_DEV_ABSTRACTION_LVM; } - if (strncmp (uuid, "CRYPT-LUKS1-", 4) == 0) + if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0) { grub_free (uuid); return GRUB_DEV_ABSTRACTION_LUKS; @@ -223,11 +229,14 @@ grub_util_get_devmapper_grub_dev (const char *os_dev) uuid = get_dm_uuid (os_dev); if (!uuid) return NULL; - - if (strncmp (uuid, "LVM-", sizeof ("LVM-") - 1) == 0) + + switch (grub_util_get_dev_abstraction (os_dev)) { + case GRUB_DEV_ABSTRACTION_LVM: + { unsigned i; int dashes[] = { 0, 6, 10, 14, 18, 22, 26, 32, 38, 42, 46, 50, 54, 58}; + grub_dev = xmalloc (grub_strlen (uuid) + 40); optr = grub_stpcpy (grub_dev, "lvmid/"); for (i = 0; i < ARRAY_SIZE (dashes) - 1; i++) @@ -245,19 +254,23 @@ grub_util_get_devmapper_grub_dev (const char *os_dev) return grub_dev; } - if (strncmp (uuid, "CRYPT-LUKS1-", sizeof ("CRYPT-LUKS1-") - 1) == 0) - { - char *dash; - dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-'); - if (dash) - *dash = 0; - grub_dev = grub_xasprintf ("cryptouuid/%s", - uuid + sizeof ("CRYPT-LUKS1-") - 1); + case GRUB_DEV_ABSTRACTION_LUKS: + { + char *dash; + + dash = grub_strchr (uuid + sizeof ("CRYPT-LUKS1-") - 1, '-'); + if (dash) + *dash = 0; + grub_dev = grub_xasprintf ("cryptouuid/%s", + uuid + sizeof ("CRYPT-LUKS1-") - 1); + grub_free (uuid); + return grub_dev; + } + + default: grub_free (uuid); - return grub_dev; + return NULL; } - grub_free (uuid); - return NULL; } char * diff --git a/grub-core/osdep/devmapper/hostdisk.c b/grub-core/osdep/devmapper/hostdisk.c index 19c1101fd..a697bcb4d 100644 --- a/grub-core/osdep/devmapper/hostdisk.c +++ b/grub-core/osdep/devmapper/hostdisk.c @@ -24,6 +24,11 @@ #include #include +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif #ifdef HAVE_DEVICE_MAPPER # include diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 3978c7114..09e7e6e6d 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -35,6 +35,12 @@ #include #endif +#if defined(MAJOR_IN_MKDEV) +#include +#elif defined(MAJOR_IN_SYSMACROS) +#include +#endif + #include #include /* ioctl */ #include @@ -1075,7 +1081,7 @@ grub_util_get_grub_dev_os (const char *os_dev) switch (grub_util_get_dev_abstraction (os_dev)) { /* Fallback for non-devmapper build. In devmapper-builds LVM is handled - in rub_util_get_devmapper_grub_dev and this point isn't reached. + in grub_util_get_devmapper_grub_dev and this point isn't reached. */ case GRUB_DEV_ABSTRACTION_LVM: { diff --git a/grub-core/osdep/unix/getroot.c b/grub-core/osdep/unix/getroot.c index 1079a919d..4bf37b027 100644 --- a/grub-core/osdep/unix/getroot.c +++ b/grub-core/osdep/unix/getroot.c @@ -51,8 +51,10 @@ #endif #include -#if defined(HAVE_SYS_MKDEV_H) +#if defined(MAJOR_IN_MKDEV) #include +#elif defined(MAJOR_IN_SYSMACROS) +#include #endif #if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR) diff --git a/grub-core/osdep/windows/platform.c b/grub-core/osdep/windows/platform.c index d217efe17..912269191 100644 --- a/grub-core/osdep/windows/platform.c +++ b/grub-core/osdep/windows/platform.c @@ -370,9 +370,9 @@ grub_install_register_efi (grub_device_t efidir_grub_dev, } hddp->partition_start = grub_partition_get_start (efidir_grub_dev->disk->partition) - << (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); hddp->partition_size = grub_disk_get_size (efidir_grub_dev->disk) - << (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); + >> (efidir_grub_dev->disk->log_sector_size - GRUB_DISK_SECTOR_BITS); pathptr = hddp + 1; filep = pathptr; diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c index bcca91e08..488bc6bc8 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -682,18 +682,14 @@ grub_script_arglist_to_argv (struct grub_script_arglist *arglist, } *op = '\0'; - if (grub_script_argv_append (&result, p, op - p)) - { - grub_free (p); - need_cleanup = 1; - /* Fall through to cleanup */ - } + need_cleanup = grub_script_argv_append (&result, p, op - p); + grub_free (p); + /* Fall through to cleanup */ } else { - if (append (&result, values[i], 1)) - need_cleanup = 1; - /* Fall through to cleanup */ + need_cleanup = append (&result, values[i], 1); + /* Fall through to cleanup */ } } diff --git a/grub-core/script/parser.y b/grub-core/script/parser.y index 1d60e9de2..4f0ab8319 100644 --- a/grub-core/script/parser.y +++ b/grub-core/script/parser.y @@ -30,7 +30,6 @@ #include "grub_script.tab.h" -#pragma GCC diagnostic ignored "-Wunreachable-code" #pragma GCC diagnostic ignored "-Wmissing-declarations" %} diff --git a/grub-core/script/yylex.l b/grub-core/script/yylex.l index 9c2cfe115..95b219170 100644 --- a/grub-core/script/yylex.l +++ b/grub-core/script/yylex.l @@ -92,7 +92,7 @@ typedef size_t yy_size_t; #define stdout 0 #define fprintf(...) 0 -#define exit(...) +#define exit(...) grub_fatal("fatal error in lexer") #endif } diff --git a/grub-core/term/at_keyboard.c b/grub-core/term/at_keyboard.c index c234e92f2..b4ea9ff7e 100644 --- a/grub-core/term/at_keyboard.c +++ b/grub-core/term/at_keyboard.c @@ -88,7 +88,7 @@ static const grub_uint8_t set1_mapping[128] = /* 0x4c */ GRUB_KEYBOARD_KEY_NUM5, GRUB_KEYBOARD_KEY_NUM6, /* 0x4e */ GRUB_KEYBOARD_KEY_NUMPLUS, GRUB_KEYBOARD_KEY_NUM1, /* 0x50 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM3, - /* 0x52 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUMDOT, + /* 0x52 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, /* 0x54 */ 0, 0, /* 0x56 */ GRUB_KEYBOARD_KEY_102ND, GRUB_KEYBOARD_KEY_F11, /* 0x58 */ GRUB_KEYBOARD_KEY_F12, 0, @@ -193,7 +193,7 @@ static const grub_uint8_t set2_mapping[256] = /* 0x6a */ GRUB_KEYBOARD_KEY_JP_YEN, GRUB_KEYBOARD_KEY_NUM4, /* 0x6c */ GRUB_KEYBOARD_KEY_NUM7, GRUB_KEYBOARD_KEY_KPCOMMA, /* 0x6e */ 0, 0, - /* 0x70 */ GRUB_KEYBOARD_KEY_NUMDOT, GRUB_KEYBOARD_KEY_NUM0, + /* 0x70 */ GRUB_KEYBOARD_KEY_NUM0, GRUB_KEYBOARD_KEY_NUMDOT, /* 0x72 */ GRUB_KEYBOARD_KEY_NUM2, GRUB_KEYBOARD_KEY_NUM5, /* 0x74 */ GRUB_KEYBOARD_KEY_NUM6, GRUB_KEYBOARD_KEY_NUM8, /* 0x76 */ GRUB_KEYBOARD_KEY_ESCAPE, GRUB_KEYBOARD_KEY_NUM_LOCK, diff --git a/grub-core/term/usb_keyboard.c b/grub-core/term/usb_keyboard.c index 3b7484635..e67b8f785 100644 --- a/grub-core/term/usb_keyboard.c +++ b/grub-core/term/usb_keyboard.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include diff --git a/grub-core/tests/checksums.h b/grub-core/tests/checksums.h index c9807a0dc..2320158d4 100644 --- a/grub-core/tests/checksums.h +++ b/grub-core/tests/checksums.h @@ -1,465 +1,129 @@ - { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x7dbff368, 0x7dbff368, 0x5a5bdc8d, 0x5a5bdc8d, 0x79753177, 0x79753177, 0xd01ede5b, 0xd01ede5b, 0x13708a73, 0x13708a73, 0x90186de3, 0x90186de3, 0xe63d02a2, 0xe63d02a2, 0x2c9dc262, 0x2c9dc262, 0x3eebd7b, 0x3eebd7b, 0xe8f3a5d8, 0xe8f3a5d8, 0xd38ecfe3, 0xd38ecfe3, 0x51878485, 0x51878485, 0xcbdb6d67, 0xcbdb6d67, 0xca25582, 0xca25582, 0x5bea0484, 0x5bea0484, 0x9ec5f71d, 0x9ec5f71d, 0x3f0bd7bc, 0x3f0bd7bc, 0xdbb0a5d2, 0xdbb0a5d2, 0xea710e2f, 0xea710e2f, 0xd14933fe, 0xd14933fe, 0x4906b783, 0xffd1d04b, 0xa159bdf9, 0xa159bdf9, }, 45 }, - { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xf1546749, 0xf1546749, 0x95d30576, 0x95d30576, 0x77f13935, 0x77f13935, 0xcc296836, 0xcc296836, 0x9af42bc7, 0x9af42bc7, 0x84c23709, 0x84c23709, 0x26b5a3c5, 0x26b5a3c5, 0x52d943fb, 0x52d943fb, 0x38beda82, 0x38beda82, 0xc12306b1, 0xc12306b1, 0xed251115, 0xed251115, 0xe0099a2f, 0xe0099a2f, 0xee929157, 0xee929157, 0xd96a1169, 0xd96a1169, 0x42fac799, 0x42fac799, 0x635af416, 0x635af416, 0x8e90342f, 0x8e90342f, 0xed467cbf, 0xed467cbf, 0x999fc60b, 0x999fc60b, 0xb45d2b1f, 0xb45d2b1f, 0x7e23ccef, 0x8e988beb, 0x8783fdf8, 0x8783fdf8, }, 45 }, - { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x50b82239, 0x50b82239, 0x82c36c12, 0x82c36c12, 0x6311208d, 0x6311208d, 0x816bd4b3, 0x816bd4b3, 0xc9281fd0, 0xc9281fd0, 0x75767bac, 0x75767bac, 0x52edeac, 0x52edeac, 0xfdb551f7, 0xfdb551f7, 0xba21cd3, 0xba21cd3, 0xf2b3468a, 0xf2b3468a, 0xd5560323, 0xd5560323, 0x12c650f6, 0x12c650f6, 0x3d6c5861, 0x3d6c5861, 0x50062423, 0x50062423, 0x2ce22983, 0x2ce22983, 0x4996bc4d, 0x4996bc4d, 0x50450525, 0x50450525, 0xe1c94312, 0xe1c94312, 0x21224aac, 0x21224aac, 0x94cbe214, 0x94cbe214, 0x4578c664, 0x38a9dbd2, 0xa9eb4c48, 0xa9eb4c48, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xbb687653, 0xbb687653, 0xa81427a7, 0xa81427a7, 0x71d7f3b, 0x71d7f3b, 0x25fea6ca, 0x25fea6ca, 0x17c19d74, 0x17c19d74, 0x4779bf48, 0x4779bf48, 0xe424e759, 0xe424e759, 0xb57fb5ae, 0xb57fb5ae, 0xd877002b, 0xd877002b, 0xdd8d7442, 0xdd8d7442, 0xe2536fde, 0xe2536fde, 0x1ebba341, 0x1ebba341, 0xef042176, 0xef042176, 0x6137f228, 0x6137f228, 0xf04a8558, 0xf04a8558, 0xff72172d, 0xff72172d, 0x5f26278f, 0x5f26278f, 0x3ed777c, 0x3ed777c, 0xb1d686e, 0xb1d686e, 0x5cead249, 0x5cead249, 0x271487f6, 0x9b7201b9, 0x6c2f147d, 0x6c2f147d, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x378dc141, 0x378dc141, 0xc7564497, 0xc7564497, 0xd20e9dba, 0xd20e9dba, 0xf84e8efb, 0xf84e8efb, 0x620d984, 0x620d984, 0x509042b4, 0x509042b4, 0x2bf32e11, 0x2bf32e11, 0x7c6fe3a0, 0x7c6fe3a0, 0x18106e6f, 0x18106e6f, 0xba983948, 0xba983948, 0xd85321cc, 0xd85321cc, 0xc22777cd, 0xc22777cd, 0x85b737c8, 0x85b737c8, 0x55590c10, 0x55590c10, 0x371ba701, 0x371ba701, 0x2da6264, 0x2da6264, 0x77c1ff46, 0x77c1ff46, 0xf2485577, 0xf2485577, 0x93e9eeeb, 0x93e9eeeb, 0x1460059, 0x1460059, 0xfbbbaa1, 0xa03c490a, 0x234dcb08, 0x234dcb08, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd803b53b, 0xd803b53b, 0x70b7ae8b, 0x70b7ae8b, 0xa20d9a15, 0xa20d9a15, 0x6113d33b, 0x6113d33b, 0xfd38d301, 0xfd38d301, 0x8b04db4, 0x8b04db4, 0xdae859df, 0xdae859df, 0x80cf138b, 0x80cf138b, 0xdfa6ef9, 0xdfa6ef9, 0x856adaf0, 0x856adaf0, 0x7023cc2d, 0x7023cc2d, 0xad7e7d54, 0xad7e7d54, 0xde8eff49, 0xde8eff49, 0x34355cc3, 0x34355cc3, 0x25adccda, 0x25adccda, 0x6d6c350d, 0x6d6c350d, 0x1c49b499, 0x1c49b499, 0x8188f1b4, 0x8188f1b4, 0x5556dc0c, 0x5556dc0c, 0xbd9ef1f5, 0xbd9ef1f5, 0x5176575b, 0x19da9ee1, 0x6e2f07c, 0x6e2f07c, }, 45 }, - { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xed7d2809, 0xed7d2809, 0x52c14224, 0x52c14224, 0xec52d912, 0xec52d912, 0x63276ae2, 0x63276ae2, 0xeeb4bfa4, 0xeeb4bfa4, 0xdf0f1ff0, 0xdf0f1ff0, 0xe2021708, 0xe2021708, 0x67c17085, 0x67c17085, 0x646e4d78, 0x646e4d78, 0x3b15f4b6, 0x3b15f4b6, 0xf4945ac5, 0xf4945ac5, 0x6cf60c00, 0x6cf60c00, 0x126648cd, 0x126648cd, 0xe7b8e348, 0xe7b8e348, 0x1626e35f, 0x1626e35f, 0x8022976c, 0x8022976c, 0xbc7e6d22, 0xbc7e6d22, 0xa2d50ad6, 0xa2d50ad6, 0x5072fea, 0x5072fea, 0x8481a563, 0x8481a563, 0x60a95143, 0x12fda168, 0xc8fe0549, 0xc8fe0549, }, 45 }, - { "cmdline_cat", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x7dbff368, 0x7dbff368, 0x5a5bdc8d, 0x5a5bdc8d, 0x79753177, 0x79753177, 0xd01ede5b, 0xd01ede5b, 0x13708a73, 0x13708a73, 0x90186de3, 0x90186de3, 0xe63d02a2, 0xe63d02a2, 0x2c9dc262, 0x2c9dc262, 0x3eebd7b, 0x3eebd7b, 0xe8f3a5d8, 0xe8f3a5d8, 0xd38ecfe3, 0xd38ecfe3, 0x51878485, 0x51878485, 0xcbdb6d67, 0xcbdb6d67, 0xca25582, 0xca25582, 0x5bea0484, 0x5bea0484, 0x9ec5f71d, 0x9ec5f71d, 0x3f0bd7bc, 0x3f0bd7bc, 0xdbb0a5d2, 0xdbb0a5d2, 0xea710e2f, 0xea710e2f, 0xd14933fe, 0xd14933fe, 0x4906b783, 0xffd1d04b, 0xa159bdf9, 0xa159bdf9, }, 45 }, - { "cmdline_cat", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xf1546749, 0xf1546749, 0x95d30576, 0x95d30576, 0x77f13935, 0x77f13935, 0xcc296836, 0xcc296836, 0x9af42bc7, 0x9af42bc7, 0x84c23709, 0x84c23709, 0x26b5a3c5, 0x26b5a3c5, 0x52d943fb, 0x52d943fb, 0x38beda82, 0x38beda82, 0xc12306b1, 0xc12306b1, 0xed251115, 0xed251115, 0xe0099a2f, 0xe0099a2f, 0xee929157, 0xee929157, 0xd96a1169, 0xd96a1169, 0x42fac799, 0x42fac799, 0x635af416, 0x635af416, 0x8e90342f, 0x8e90342f, 0xed467cbf, 0xed467cbf, 0x999fc60b, 0x999fc60b, 0xb45d2b1f, 0xb45d2b1f, 0x7e23ccef, 0x8e988beb, 0x8783fdf8, 0x8783fdf8, }, 45 }, - { "cmdline_cat", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x50b82239, 0x50b82239, 0x82c36c12, 0x82c36c12, 0x6311208d, 0x6311208d, 0x816bd4b3, 0x816bd4b3, 0xc9281fd0, 0xc9281fd0, 0x75767bac, 0x75767bac, 0x52edeac, 0x52edeac, 0xfdb551f7, 0xfdb551f7, 0xba21cd3, 0xba21cd3, 0xf2b3468a, 0xf2b3468a, 0xd5560323, 0xd5560323, 0x12c650f6, 0x12c650f6, 0x3d6c5861, 0x3d6c5861, 0x50062423, 0x50062423, 0x2ce22983, 0x2ce22983, 0x4996bc4d, 0x4996bc4d, 0x50450525, 0x50450525, 0xe1c94312, 0xe1c94312, 0x21224aac, 0x21224aac, 0x94cbe214, 0x94cbe214, 0x4578c664, 0x38a9dbd2, 0xa9eb4c48, 0xa9eb4c48, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x93fbd3a3, 0x93fbd3a3, 0x1617bee0, 0x1617bee0, 0x4bfbae7f, 0x4bfbae7f, 0xa3558248, 0xa3558248, 0xaf468a11, 0xaf468a11, 0x68ac5986, 0x68ac5986, 0xd8065600, 0xd8065600, 0xef6c6222, 0xef6c6222, 0x1a04371, 0x1a04371, 0xc92981b6, 0xc92981b6, 0x53f9bfc8, 0x53f9bfc8, 0xfef01300, 0xfef01300, 0xce753805, 0xce753805, 0x858f6540, 0x858f6540, 0x6429dae4, 0x6429dae4, 0x19222aa5, 0x19222aa5, 0x3f9a0303, 0x3f9a0303, 0x978a47da, 0x978a47da, 0x6bf7f199, 0x6bf7f199, 0x97dab6d, 0x97dab6d, 0xeb643dbd, 0x9fe6a006, 0x2b7a0b5b, 0x2b7a0b5b, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xe8381636, 0xe8381636, 0x977b32f5, 0x977b32f5, 0x54bb62c1, 0x54bb62c1, 0xe26211f2, 0xe26211f2, 0xb0d0aca3, 0xb0d0aca3, 0x8d1f7491, 0x8d1f7491, 0x261a3820, 0x261a3820, 0x571c16d3, 0x571c16d3, 0xdc5fb880, 0xdc5fb880, 0xc8b086fe, 0xc8b086fe, 0x55b07770, 0x55b07770, 0x1d5e160, 0x1d5e160, 0x5e5dddc8, 0x5e5dddc8, 0xceeaa332, 0xceeaa332, 0x81c9d3f3, 0x81c9d3f3, 0xa6bbab67, 0xa6bbab67, 0x9366a264, 0x9366a264, 0x4bcbc84c, 0x4bcbc84c, 0x8aacda73, 0x8aacda73, 0x356159d0, 0x356159d0, 0x74872545, 0x5a28a86f, 0x3a1f5494, 0x3a1f5494, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xccbd401, 0xccbd401, 0x35859629, 0x35859629, 0x269f013b, 0x269f013b, 0xe8c8196, 0xe8c8196, 0x95e2849c, 0x95e2849c, 0xb2019543, 0xb2019543, 0xf739b6c9, 0xf739b6c9, 0xd8227519, 0xd8227519, 0x6b1ae8cf, 0x6b1ae8cf, 0x84fbe9b2, 0x84fbe9b2, 0xed69a305, 0xed69a305, 0x15f4f0cf, 0x15f4f0cf, 0x57ce0973, 0x57ce0973, 0x3f5b0b97, 0x3f5b0b97, 0xc3e87bef, 0xc3e87bef, 0x3ac7584b, 0x3ac7584b, 0xdb95f2c7, 0xdb95f2c7, 0xc1942d4c, 0xc1942d4c, 0x17e9634e, 0x17e9634e, 0xd8dd41a3, 0xd8dd41a3, 0x927a8a2f, 0x339d3240, 0x398e6a2a, 0x398e6a2a, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa06498a0, 0xa06498a0, 0xd1336ad7, 0xd1336ad7, 0x68c888e0, 0x68c888e0, 0xf01fb74, 0xf01fb74, 0x6b743235, 0x6b743235, 0xe7b71a49, 0xe7b71a49, 0x798da4d7, 0x798da4d7, 0x5398f44b, 0x5398f44b, 0x4794ee5e, 0x4794ee5e, 0x61c2cb0d, 0x61c2cb0d, 0xad3fcef3, 0xad3fcef3, 0xd9b6f291, 0xd9b6f291, 0xbaf0962d, 0xbaf0962d, 0x11848b9e, 0x11848b9e, 0xb8f3d2bf, 0xb8f3d2bf, 0x3f9978, 0x3f9978, 0xafd76c24, 0xafd76c24, 0xee0b9b9e, 0xee0b9b9e, 0x1f80451e, 0x1f80451e, 0x817e030a, 0x817e030a, 0x64ee9a5d, 0x1d187aed, 0xb2c05a4a, 0xb2c05a4a, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x95c83b7d, 0x95c83b7d, 0xb8cac2b5, 0xb8cac2b5, 0xf0ef977f, 0xf0ef977f, 0xc4640770, 0xc4640770, 0x8ea8595e, 0x8ea8595e, 0xc7d26302, 0xc7d26302, 0x6f756fbc, 0x6f756fbc, 0x68bc6258, 0x68bc6258, 0xe77cff10, 0xe77cff10, 0x835ae8e5, 0x835ae8e5, 0x622cfc05, 0x622cfc05, 0xe192499f, 0xe192499f, 0x3b976218, 0x3b976218, 0xe2dcd75, 0xe2dcd75, 0xed05eae8, 0xed05eae8, 0xc0b8ee9a, 0xc0b8ee9a, 0x255ec66a, 0x255ec66a, 0x3391d9b6, 0x3391d9b6, 0x779834b3, 0x779834b3, 0xdf77a37f, 0xdf77a37f, 0xd3cc8a1d, 0xfec30b6e, 0x884fa360, 0x884fa360, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x698515fa, 0x698515fa, 0xc313ebe6, 0xc313ebe6, 0x32b9228f, 0x32b9228f, 0xa58d78e8, 0xa58d78e8, 0xf41d5153, 0xf41d5153, 0xdfa3af16, 0xdfa3af16, 0xd4a68422, 0xd4a68422, 0xa7ea67e0, 0xa7ea67e0, 0xaee4c8f6, 0xaee4c8f6, 0x78ddd8aa, 0x78ddd8aa, 0xe662b827, 0xe662b827, 0x190ab892, 0x190ab892, 0x7c1e04ab, 0x7c1e04ab, 0xae4e2ed2, 0xae4e2ed2, 0x9ac52f8d, 0x9ac52f8d, 0x7e7b6776, 0x7e7b6776, 0x21c37700, 0x21c37700, 0x4fc11e7c, 0x4fc11e7c, 0x612a17d, 0x612a17d, 0x1f549440, 0x1f549440, 0xd6ce5af0, 0x2751d45f, 0x41e24797, 0x41e24797, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x7a06e04b, 0x7a06e04b, 0x122f59ab, 0x122f59ab, 0x993a50b9, 0x993a50b9, 0x5545f8f, 0x5545f8f, 0xcdd2b587, 0xcdd2b587, 0x18bec138, 0x18bec138, 0xa9b4345d, 0xa9b4345d, 0x92c6eb1c, 0x92c6eb1c, 0x2aa44d63, 0x2aa44d63, 0xc9e7b549, 0xc9e7b549, 0x24732d85, 0x24732d85, 0xeedce06, 0xeedce06, 0x69a732a1, 0x69a732a1, 0xc53906e5, 0xc53906e5, 0x306e0f4b, 0x306e0f4b, 0x895e6f09, 0x895e6f09, 0x27f1c24e, 0x27f1c24e, 0x76a2b606, 0x76a2b606, 0x9fdd1ff3, 0x9fdd1ff3, 0x408d0a19, 0x408d0a19, 0xc9b3f877, 0xce19a637, 0x8cfd7321, 0x8cfd7321, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x9fa21cbe, 0x9fa21cbe, 0xa9ad84e6, 0xa9ad84e6, 0x4f4ccbc, 0x4f4ccbc, 0x6a4f5fda, 0x6a4f5fda, 0x4d4ccb50, 0x4d4ccb50, 0xb854236c, 0xb854236c, 0x990a5b4a, 0x990a5b4a, 0xa9dba8c8, 0xa9dba8c8, 0xe12b4ca1, 0xe12b4ca1, 0x4200ebc0, 0x4200ebc0, 0x86a931cf, 0x86a931cf, 0xda3a178, 0xda3a178, 0x2739917d, 0x2739917d, 0x48005e41, 0x48005e41, 0x550a94ac, 0x550a94ac, 0x73f363b6, 0x73f363b6, 0x4811082a, 0x4811082a, 0xdc025f10, 0xdc025f10, 0x4f18937e, 0x4f18937e, 0xa3749fd8, 0xa3749fd8, 0x93ce5c0b, 0xdddd4de6, 0x97f43654, 0x97f43654, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x7d9b5dd7, 0x7d9b5dd7, 0x42e1176a, 0x42e1176a, 0x7e2da576, 0x7e2da576, 0xd5a8afa, 0xd5a8afa, 0x3eb2146b, 0x3eb2146b, 0x60d9b3, 0x60d9b3, 0xb893f5ca, 0xb893f5ca, 0xd431b2bf, 0xd431b2bf, 0x8ea1b6a6, 0x8ea1b6a6, 0x4d730ad0, 0x4d730ad0, 0x28d1888b, 0x28d1888b, 0x6d8c3672, 0x6d8c3672, 0x65dec2dd, 0x65dec2dd, 0x9d7c6d99, 0x9d7c6d99, 0xdfcd1eba, 0xdfcd1eba, 0xed4fb650, 0xed4fb650, 0xd9f1574c, 0xd9f1574c, 0x2b05a17e, 0x2b05a17e, 0x64e652f5, 0x64e652f5, 0x5f83fdb1, 0x5f83fdb1, 0x7918b180, 0xf54e3c4a, 0xe26cf2de, 0xe26cf2de, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x93fbd3a3, 0x93fbd3a3, 0x1617bee0, 0x1617bee0, 0x4bfbae7f, 0x4bfbae7f, 0xa3558248, 0xa3558248, 0xaf468a11, 0xaf468a11, 0x68ac5986, 0x68ac5986, 0xd8065600, 0xd8065600, 0xef6c6222, 0xef6c6222, 0x1a04371, 0x1a04371, 0xc92981b6, 0xc92981b6, 0x53f9bfc8, 0x53f9bfc8, 0xfef01300, 0xfef01300, 0xce753805, 0xce753805, 0x858f6540, 0x858f6540, 0x6429dae4, 0x6429dae4, 0x19222aa5, 0x19222aa5, 0x3f9a0303, 0x3f9a0303, 0x978a47da, 0x978a47da, 0x6bf7f199, 0x6bf7f199, 0x97dab6d, 0x97dab6d, 0xeb643dbd, 0x9fe6a006, 0x2b7a0b5b, 0x2b7a0b5b, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xe8381636, 0xe8381636, 0x977b32f5, 0x977b32f5, 0x54bb62c1, 0x54bb62c1, 0xe26211f2, 0xe26211f2, 0xb0d0aca3, 0xb0d0aca3, 0x8d1f7491, 0x8d1f7491, 0x261a3820, 0x261a3820, 0x571c16d3, 0x571c16d3, 0xdc5fb880, 0xdc5fb880, 0xc8b086fe, 0xc8b086fe, 0x55b07770, 0x55b07770, 0x1d5e160, 0x1d5e160, 0x5e5dddc8, 0x5e5dddc8, 0xceeaa332, 0xceeaa332, 0x81c9d3f3, 0x81c9d3f3, 0xa6bbab67, 0xa6bbab67, 0x9366a264, 0x9366a264, 0x4bcbc84c, 0x4bcbc84c, 0x8aacda73, 0x8aacda73, 0x356159d0, 0x356159d0, 0x74872545, 0x5a28a86f, 0x3a1f5494, 0x3a1f5494, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xccbd401, 0xccbd401, 0x35859629, 0x35859629, 0x269f013b, 0x269f013b, 0xe8c8196, 0xe8c8196, 0x95e2849c, 0x95e2849c, 0xb2019543, 0xb2019543, 0xf739b6c9, 0xf739b6c9, 0xd8227519, 0xd8227519, 0x6b1ae8cf, 0x6b1ae8cf, 0x84fbe9b2, 0x84fbe9b2, 0xed69a305, 0xed69a305, 0x15f4f0cf, 0x15f4f0cf, 0x57ce0973, 0x57ce0973, 0x3f5b0b97, 0x3f5b0b97, 0xc3e87bef, 0xc3e87bef, 0x3ac7584b, 0x3ac7584b, 0xdb95f2c7, 0xdb95f2c7, 0xc1942d4c, 0xc1942d4c, 0x17e9634e, 0x17e9634e, 0xd8dd41a3, 0xd8dd41a3, 0x927a8a2f, 0x339d3240, 0x398e6a2a, 0x398e6a2a, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa06498a0, 0xa06498a0, 0xd1336ad7, 0xd1336ad7, 0x68c888e0, 0x68c888e0, 0xf01fb74, 0xf01fb74, 0x6b743235, 0x6b743235, 0xe7b71a49, 0xe7b71a49, 0x798da4d7, 0x798da4d7, 0x5398f44b, 0x5398f44b, 0x4794ee5e, 0x4794ee5e, 0x61c2cb0d, 0x61c2cb0d, 0xad3fcef3, 0xad3fcef3, 0xd9b6f291, 0xd9b6f291, 0xbaf0962d, 0xbaf0962d, 0x11848b9e, 0x11848b9e, 0xb8f3d2bf, 0xb8f3d2bf, 0x3f9978, 0x3f9978, 0xafd76c24, 0xafd76c24, 0xee0b9b9e, 0xee0b9b9e, 0x1f80451e, 0x1f80451e, 0x817e030a, 0x817e030a, 0x64ee9a5d, 0x1d187aed, 0xb2c05a4a, 0xb2c05a4a, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x95c83b7d, 0x95c83b7d, 0xb8cac2b5, 0xb8cac2b5, 0xf0ef977f, 0xf0ef977f, 0xc4640770, 0xc4640770, 0x8ea8595e, 0x8ea8595e, 0xc7d26302, 0xc7d26302, 0x6f756fbc, 0x6f756fbc, 0x68bc6258, 0x68bc6258, 0xe77cff10, 0xe77cff10, 0x835ae8e5, 0x835ae8e5, 0x622cfc05, 0x622cfc05, 0xe192499f, 0xe192499f, 0x3b976218, 0x3b976218, 0xe2dcd75, 0xe2dcd75, 0xed05eae8, 0xed05eae8, 0xc0b8ee9a, 0xc0b8ee9a, 0x255ec66a, 0x255ec66a, 0x3391d9b6, 0x3391d9b6, 0x779834b3, 0x779834b3, 0xdf77a37f, 0xdf77a37f, 0xd3cc8a1d, 0xfec30b6e, 0x884fa360, 0x884fa360, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x698515fa, 0x698515fa, 0xc313ebe6, 0xc313ebe6, 0x32b9228f, 0x32b9228f, 0xa58d78e8, 0xa58d78e8, 0xf41d5153, 0xf41d5153, 0xdfa3af16, 0xdfa3af16, 0xd4a68422, 0xd4a68422, 0xa7ea67e0, 0xa7ea67e0, 0xaee4c8f6, 0xaee4c8f6, 0x78ddd8aa, 0x78ddd8aa, 0xe662b827, 0xe662b827, 0x190ab892, 0x190ab892, 0x7c1e04ab, 0x7c1e04ab, 0xae4e2ed2, 0xae4e2ed2, 0x9ac52f8d, 0x9ac52f8d, 0x7e7b6776, 0x7e7b6776, 0x21c37700, 0x21c37700, 0x4fc11e7c, 0x4fc11e7c, 0x612a17d, 0x612a17d, 0x1f549440, 0x1f549440, 0xd6ce5af0, 0x2751d45f, 0x41e24797, 0x41e24797, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x7a06e04b, 0x7a06e04b, 0x122f59ab, 0x122f59ab, 0x993a50b9, 0x993a50b9, 0x5545f8f, 0x5545f8f, 0xcdd2b587, 0xcdd2b587, 0x18bec138, 0x18bec138, 0xa9b4345d, 0xa9b4345d, 0x92c6eb1c, 0x92c6eb1c, 0x2aa44d63, 0x2aa44d63, 0xc9e7b549, 0xc9e7b549, 0x24732d85, 0x24732d85, 0xeedce06, 0xeedce06, 0x69a732a1, 0x69a732a1, 0xc53906e5, 0xc53906e5, 0x306e0f4b, 0x306e0f4b, 0x895e6f09, 0x895e6f09, 0x27f1c24e, 0x27f1c24e, 0x76a2b606, 0x76a2b606, 0x9fdd1ff3, 0x9fdd1ff3, 0x408d0a19, 0x408d0a19, 0xc9b3f877, 0xce19a637, 0x8cfd7321, 0x8cfd7321, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x9fa21cbe, 0x9fa21cbe, 0xa9ad84e6, 0xa9ad84e6, 0x4f4ccbc, 0x4f4ccbc, 0x6a4f5fda, 0x6a4f5fda, 0x4d4ccb50, 0x4d4ccb50, 0xb854236c, 0xb854236c, 0x990a5b4a, 0x990a5b4a, 0xa9dba8c8, 0xa9dba8c8, 0xe12b4ca1, 0xe12b4ca1, 0x4200ebc0, 0x4200ebc0, 0x86a931cf, 0x86a931cf, 0xda3a178, 0xda3a178, 0x2739917d, 0x2739917d, 0x48005e41, 0x48005e41, 0x550a94ac, 0x550a94ac, 0x73f363b6, 0x73f363b6, 0x4811082a, 0x4811082a, 0xdc025f10, 0xdc025f10, 0x4f18937e, 0x4f18937e, 0xa3749fd8, 0xa3749fd8, 0x93ce5c0b, 0xdddd4de6, 0x97f43654, 0x97f43654, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x7d9b5dd7, 0x7d9b5dd7, 0x42e1176a, 0x42e1176a, 0x7e2da576, 0x7e2da576, 0xd5a8afa, 0xd5a8afa, 0x3eb2146b, 0x3eb2146b, 0x60d9b3, 0x60d9b3, 0xb893f5ca, 0xb893f5ca, 0xd431b2bf, 0xd431b2bf, 0x8ea1b6a6, 0x8ea1b6a6, 0x4d730ad0, 0x4d730ad0, 0x28d1888b, 0x28d1888b, 0x6d8c3672, 0x6d8c3672, 0x65dec2dd, 0x65dec2dd, 0x9d7c6d99, 0x9d7c6d99, 0xdfcd1eba, 0xdfcd1eba, 0xed4fb650, 0xed4fb650, 0xd9f1574c, 0xd9f1574c, 0x2b05a17e, 0x2b05a17e, 0x64e652f5, 0x64e652f5, 0x5f83fdb1, 0x5f83fdb1, 0x7918b180, 0xf54e3c4a, 0xe26cf2de, 0xe26cf2de, }, 45 }, - { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xbb687653, 0xbb687653, 0xa81427a7, 0xa81427a7, 0x71d7f3b, 0x71d7f3b, 0x25fea6ca, 0x25fea6ca, 0x17c19d74, 0x17c19d74, 0x4779bf48, 0x4779bf48, 0xe424e759, 0xe424e759, 0xb57fb5ae, 0xb57fb5ae, 0xd877002b, 0xd877002b, 0xdd8d7442, 0xdd8d7442, 0xe2536fde, 0xe2536fde, 0x1ebba341, 0x1ebba341, 0xef042176, 0xef042176, 0x6137f228, 0x6137f228, 0xf04a8558, 0xf04a8558, 0xff72172d, 0xff72172d, 0x5f26278f, 0x5f26278f, 0x3ed777c, 0x3ed777c, 0xb1d686e, 0xb1d686e, 0x5cead249, 0x5cead249, 0x271487f6, 0x9b7201b9, 0x6c2f147d, 0x6c2f147d, }, 45 }, - { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x378dc141, 0x378dc141, 0xc7564497, 0xc7564497, 0xd20e9dba, 0xd20e9dba, 0xf84e8efb, 0xf84e8efb, 0x620d984, 0x620d984, 0x509042b4, 0x509042b4, 0x2bf32e11, 0x2bf32e11, 0x7c6fe3a0, 0x7c6fe3a0, 0x18106e6f, 0x18106e6f, 0xba983948, 0xba983948, 0xd85321cc, 0xd85321cc, 0xc22777cd, 0xc22777cd, 0x85b737c8, 0x85b737c8, 0x55590c10, 0x55590c10, 0x371ba701, 0x371ba701, 0x2da6264, 0x2da6264, 0x77c1ff46, 0x77c1ff46, 0xf2485577, 0xf2485577, 0x93e9eeeb, 0x93e9eeeb, 0x1460059, 0x1460059, 0xfbbbaa1, 0xa03c490a, 0x234dcb08, 0x234dcb08, }, 45 }, - { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xd803b53b, 0xd803b53b, 0x70b7ae8b, 0x70b7ae8b, 0xa20d9a15, 0xa20d9a15, 0x6113d33b, 0x6113d33b, 0xfd38d301, 0xfd38d301, 0x8b04db4, 0x8b04db4, 0xdae859df, 0xdae859df, 0x80cf138b, 0x80cf138b, 0xdfa6ef9, 0xdfa6ef9, 0x856adaf0, 0x856adaf0, 0x7023cc2d, 0x7023cc2d, 0xad7e7d54, 0xad7e7d54, 0xde8eff49, 0xde8eff49, 0x34355cc3, 0x34355cc3, 0x25adccda, 0x25adccda, 0x6d6c350d, 0x6d6c350d, 0x1c49b499, 0x1c49b499, 0x8188f1b4, 0x8188f1b4, 0x5556dc0c, 0x5556dc0c, 0xbd9ef1f5, 0xbd9ef1f5, 0x5176575b, 0x19da9ee1, 0x6e2f07c, 0x6e2f07c, }, 45 }, - { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xc5faf369, 0x64eb297a, 0xc5faf369, 0x860c3e2e, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x860c3e2e, 0x860c3e2e, 0x59c36f00, }, 20 }, - { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd50b0276, 0x23b87c98, 0xd50b0276, 0xfb0e8709, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xfb0e8709, 0xfb0e8709, 0xaa4593fe, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x353bd15d, 0x79836ff2, 0x353bd15d, 0x682cbcd9, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x682cbcd9, 0x682cbcd9, 0xc9cbf769, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x22bcc2fc, 0xc6c23ab4, 0x22bcc2fc, 0x72a46652, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x72a46652, 0x72a46652, 0x9813a416, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3afb9165, 0x767dd6a7, 0x3afb9165, 0x31409f, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x31409f, 0x31409f, 0x5fcf013d, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe13f0039, 0xb5783cd1, 0xe13f0039, 0x814ca453, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x814ca453, 0x814ca453, 0xdd28f52b, }, 20 }, - { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x154ac813, 0x5c191673, 0x154ac813, 0xeb0cc57e, 0x43d1f34, 0x43d1f34, 0xd204ac75, 0xd204ac75, 0xd204ac75, 0xad0e05dd, 0xad0e05dd, 0xad0e05dd, 0x452e3cf4, 0x452e3cf4, 0x452e3cf4, 0x43d1f34, 0xeb0cc57e, 0xeb0cc57e, 0x43d1f34, }, 20 }, - { "gfxterm_menu", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xc5faf369, 0x64eb297a, 0xc5faf369, 0x860c3e2e, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x860c3e2e, 0x860c3e2e, 0x59c36f00, }, 20 }, - { "gfxterm_menu", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xd50b0276, 0x23b87c98, 0xd50b0276, 0xfb0e8709, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xfb0e8709, 0xfb0e8709, 0xaa4593fe, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x353bd15d, 0x79836ff2, 0x353bd15d, 0x682cbcd9, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x682cbcd9, 0x682cbcd9, 0xc9cbf769, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe967dfb6, 0x7fedccee, 0xe967dfb6, 0xad6c250a, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xad6c250a, 0xad6c250a, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x985bd9b5, 0xd5604814, 0x985bd9b5, 0x2233942a, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x2233942a, 0x2233942a, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x928c0a8e, 0xd25dcf03, 0x928c0a8e, 0x83f9bfdb, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x83f9bfdb, 0x83f9bfdb, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x116c0258, 0xed7d4786, 0x116c0258, 0xfef8bf61, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0xfef8bf61, 0xfef8bf61, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xd49b1c35, 0x37f70b09, 0xd49b1c35, 0xa55122d9, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xa55122d9, 0xa55122d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x2b3f0273, 0x6da0f134, 0x2b3f0273, 0xd9ed8903, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd9ed8903, 0xd9ed8903, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x1e6b0284, 0x18f0ad39, 0x1e6b0284, 0x1e0bba22, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x1e0bba22, 0x1e0bba22, 0x1c955882, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x1f279ca1, 0x976cb6e3, 0x1f279ca1, 0xdb3505a5, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0xdb3505a5, 0xdb3505a5, 0x4d266f7a, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x21235dde, 0x13b8b442, 0x21235dde, 0xbdd75c39, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xbdd75c39, 0xbdd75c39, 0x1ed9d731, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe967dfb6, 0x7fedccee, 0xe967dfb6, 0xad6c250a, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xad6c250a, 0xad6c250a, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x985bd9b5, 0xd5604814, 0x985bd9b5, 0x2233942a, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x2233942a, 0x2233942a, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x928c0a8e, 0xd25dcf03, 0x928c0a8e, 0x83f9bfdb, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x83f9bfdb, 0x83f9bfdb, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x116c0258, 0xed7d4786, 0x116c0258, 0xfef8bf61, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0xfef8bf61, 0xfef8bf61, 0x5387d57f, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xd49b1c35, 0x37f70b09, 0xd49b1c35, 0xa55122d9, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xa55122d9, 0xa55122d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x2b3f0273, 0x6da0f134, 0x2b3f0273, 0xd9ed8903, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd9ed8903, 0xd9ed8903, 0x724366e5, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x1e6b0284, 0x18f0ad39, 0x1e6b0284, 0x1e0bba22, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x1e0bba22, 0x1e0bba22, 0x1c955882, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x1f279ca1, 0x976cb6e3, 0x1f279ca1, 0xdb3505a5, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0xdb3505a5, 0xdb3505a5, 0x4d266f7a, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x21235dde, 0x13b8b442, 0x21235dde, 0xbdd75c39, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xbdd75c39, 0xbdd75c39, 0x1ed9d731, }, 20 }, - { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x22bcc2fc, 0xc6c23ab4, 0x22bcc2fc, 0x72a46652, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x72a46652, 0x72a46652, 0x9813a416, }, 20 }, - { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3afb9165, 0x767dd6a7, 0x3afb9165, 0x31409f, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x31409f, 0x31409f, 0x5fcf013d, }, 20 }, - { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe13f0039, 0xb5783cd1, 0xe13f0039, 0x814ca453, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x814ca453, 0x814ca453, 0xdd28f52b, }, 20 }, - { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x28e6b07d, 0xf54b3d6a, 0x28e6b07d, 0x7d0bdbfb, 0x9a2e0d26, 0xb22b0963, 0xb22b0963, 0xb22b0963, 0xeef3ffa3, 0xeef3ffa3, 0xeef3ffa3, 0x36f73b6, 0x36f73b6, 0x36f73b6, 0x59c36f00, 0x7d0bdbfb, 0x7d0bdbfb, }, 18 }, - { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x15bb581c, 0x7da084c6, 0x15bb581c, 0xcedba42f, 0xbc06c96d, 0xb3a8a15b, 0xb3a8a15b, 0xb3a8a15b, 0xe6f70b51, 0xe6f70b51, 0xe6f70b51, 0x8ce38109, 0x8ce38109, 0x8ce38109, 0xaa4593fe, 0xcedba42f, 0xcedba42f, }, 18 }, - { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x817e5fe2, 0x134e87ff, 0x817e5fe2, 0xb83ddd98, 0xdcd8c986, 0x79244533, 0x79244533, 0x79244533, 0x69ae3a7, 0x69ae3a7, 0x69ae3a7, 0xfc10b74f, 0xfc10b74f, 0xfc10b74f, 0xc9cbf769, 0xb83ddd98, 0xb83ddd98, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x95048302, 0x9f5bac7c, 0x95048302, 0x28413b7c, 0x740d78cf, 0x620e8524, 0x620e8524, 0x620e8524, 0x89ab6f58, 0x89ab6f58, 0x89ab6f58, 0x90218e3d, 0x90218e3d, 0x90218e3d, 0x1c3742c9, 0x28413b7c, 0x28413b7c, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x6cf38a7e, 0x35fcd6e8, 0x6cf38a7e, 0x618c203c, 0xe925e70d, 0xff9c8a81, 0xff9c8a81, 0xff9c8a81, 0x90d55690, 0x90d55690, 0x90d55690, 0xd3df13a0, 0xd3df13a0, 0xd3df13a0, 0xcc5a7bed, 0x618c203c, 0x618c203c, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0xd610d630, 0x98774981, 0xd610d630, 0x4469957c, 0x9869130b, 0xfb592a0d, 0xfb592a0d, 0xfb592a0d, 0x3deb6e13, 0x3deb6e13, 0x3deb6e13, 0xeaf96ec4, 0xeaf96ec4, 0xeaf96ec4, 0xef4a3312, 0x4469957c, 0x4469957c, }, 18 }, - { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xf5c7a904, 0xaf9e8139, 0xf5c7a904, 0xf108ef6b, 0x91c7d0fe, 0xb57ab567, 0xb57ab567, 0xb57ab567, 0x348943b6, 0x348943b6, 0x348943b6, 0x9b076791, 0x9b076791, 0x9b076791, 0x54e48d80, 0xf108ef6b, 0xf108ef6b, }, 18 }, - { "gfxmenu", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xff8ab96b, 0x72a93e7f, 0xff8ab96b, 0x47d54a82, 0x42b837cf, 0x6abd338a, 0x6abd338a, 0x6abd338a, 0x3665c54a, 0x3665c54a, 0x3665c54a, 0xdbf9495f, 0xdbf9495f, 0xdbf9495f, 0x59c36f00, 0x47d54a82, 0x47d54a82, }, 18 }, - { "gfxmenu", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x73ad05f, 0x8434d91c, 0x73ad05f, 0x5316d3c6, 0xd7e75590, 0xd8493da6, 0xd8493da6, 0xd8493da6, 0x8d1697ac, 0x8d1697ac, 0x8d1697ac, 0xe7021df4, 0xe7021df4, 0xe7021df4, 0xaa4593fe, 0x5316d3c6, 0x5316d3c6, }, 18 }, - { "gfxmenu", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x83e29007, 0xd4329e28, 0x83e29007, 0x8c37fac6, 0x97d4f246, 0x32287ef3, 0x32287ef3, 0x32287ef3, 0x4d96d867, 0x4d96d867, 0x4d96d867, 0xb71c8c8f, 0xb71c8c8f, 0xb71c8c8f, 0xc9cbf769, 0x8c37fac6, 0x8c37fac6, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe535f843, 0x39fb9c6c, 0xe535f843, 0x2fbd1b9, 0x7c892c8d, 0x3a8a1482, 0x3a8a1482, 0x3a8a1482, 0x2d7a2495, 0x2d7a2495, 0x2d7a2495, 0x84d821d, 0x84d821d, 0x84d821d, 0x5387d57f, 0x2fbd1b9, 0x2fbd1b9, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8f8338d3, 0xdcad6ccd, 0x8f8338d3, 0x30c612d8, 0x36353d2b, 0xa9546353, 0xa9546353, 0xa9546353, 0x960ace5a, 0x960ace5a, 0x960ace5a, 0x62e43bb9, 0x62e43bb9, 0x62e43bb9, 0xf83ee7aa, 0x30c612d8, 0x30c612d8, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xb7a13882, 0x68141e3a, 0xb7a13882, 0x65f6d15, 0x3101c32f, 0xc2b93e36, 0xc2b93e36, 0xc2b93e36, 0x1bee651a, 0x1bee651a, 0x1bee651a, 0xf7d3f08f, 0xf7d3f08f, 0xf7d3f08f, 0x724366e5, 0x65f6d15, 0x65f6d15, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x88a3c3aa, 0x8eade265, 0x88a3c3aa, 0xa5bf47d6, 0x9f8ae196, 0x56e34121, 0x56e34121, 0x56e34121, 0x2ccef01f, 0x2ccef01f, 0x2ccef01f, 0x7d1eee3b, 0x7d1eee3b, 0x7d1eee3b, 0x5387d57f, 0xa5bf47d6, 0xa5bf47d6, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8452c39c, 0x65759f4c, 0x8452c39c, 0x7459c042, 0xf9023dca, 0xe78b8902, 0xe78b8902, 0xe78b8902, 0xf0960107, 0xf0960107, 0xf0960107, 0xd52b2285, 0xd52b2285, 0xd52b2285, 0xf83ee7aa, 0x7459c042, 0x7459c042, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x938d42a2, 0x709bc8ab, 0x938d42a2, 0x4db0e2de, 0xd710f4c, 0x4e9cc80d, 0x4e9cc80d, 0x4e9cc80d, 0x9bc8a372, 0x9bc8a372, 0x9bc8a372, 0xbac90ac7, 0xbac90ac7, 0xbac90ac7, 0x724366e5, 0x4db0e2de, 0x4db0e2de, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xc060102b, 0x960bef0c, 0xc060102b, 0x1589677a, 0xe97d0978, 0xc795e31, 0xc795e31, 0xc795e31, 0xab33090, 0xab33090, 0xab33090, 0xbeea3971, 0xbeea3971, 0xbeea3971, 0x1c955882, 0x1589677a, 0x1589677a, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x6a4b2b8d, 0x274440b, 0x6a4b2b8d, 0xdef115d2, 0xed0808ad, 0x8d8ebcbb, 0x8d8ebcbb, 0x8d8ebcbb, 0x2b9b5d26, 0x2b9b5d26, 0x2b9b5d26, 0x790e10e2, 0x790e10e2, 0x790e10e2, 0x4d266f7a, 0xdef115d2, 0xdef115d2, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xdb8085be, 0x51d897c7, 0xdb8085be, 0xa3ce0221, 0x30fbd5f9, 0x12d25f5, 0x12d25f5, 0x12d25f5, 0xa4a480cb, 0xa4a480cb, 0xa4a480cb, 0xf3adca34, 0xf3adca34, 0xf3adca34, 0x1ed9d731, 0xa3ce0221, 0xa3ce0221, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x475beaa4, 0xa62db977, 0x475beaa4, 0x3a62be0, 0x311b5810, 0x7718601f, 0x7718601f, 0x7718601f, 0x60e85008, 0x60e85008, 0x60e85008, 0x45dff680, 0x45dff680, 0x45dff680, 0x5387d57f, 0x3a62be0, 0x3a62be0, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x5788a7ac, 0xd4336209, 0x5788a7ac, 0x354678e9, 0x783d77de, 0xe75c29a6, 0xe75c29a6, 0xe75c29a6, 0xd80284af, 0xd80284af, 0xd80284af, 0x2cec714c, 0x2cec714c, 0x2cec714c, 0xf83ee7aa, 0x354678e9, 0x354678e9, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xd1f64ea0, 0x4abd595a, 0xd1f64ea0, 0x97a6bea1, 0xf22a4cdb, 0x192b1c2, 0x192b1c2, 0x192b1c2, 0xd8c5eaee, 0xd8c5eaee, 0xd8c5eaee, 0x34f87f7b, 0x34f87f7b, 0x34f87f7b, 0x724366e5, 0x97a6bea1, 0x97a6bea1, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xfcd5f4bb, 0x36d1826d, 0xfcd5f4bb, 0x43d7de40, 0x84467c83, 0x4d2fdc34, 0x4d2fdc34, 0x4d2fdc34, 0x37026d0a, 0x37026d0a, 0x37026d0a, 0x66d2732e, 0x66d2732e, 0x66d2732e, 0x5387d57f, 0x43d7de40, 0x43d7de40, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x21e820a3, 0x2f9bf273, 0x21e820a3, 0xaa229449, 0x61b241cd, 0x7f3bf505, 0x7f3bf505, 0x7f3bf505, 0x68267d00, 0x68267d00, 0x68267d00, 0x4d9b5e82, 0x4d9b5e82, 0x4d9b5e82, 0xf83ee7aa, 0xaa229449, 0xaa229449, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x6fe66840, 0x64229598, 0x6fe66840, 0xedc02d98, 0x7131f7aa, 0x32dc30eb, 0x32dc30eb, 0x32dc30eb, 0xe7885b94, 0xe7885b94, 0xe7885b94, 0xc689f221, 0xc689f221, 0xc689f221, 0x724366e5, 0xedc02d98, 0xedc02d98, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xdb159e45, 0x9b1475c9, 0xdb159e45, 0xaee6597b, 0x573454, 0xe553631d, 0xe553631d, 0xe553631d, 0xe3990dbc, 0xe3990dbc, 0xe3990dbc, 0x57c0045d, 0x57c0045d, 0x57c0045d, 0x1c955882, 0xaee6597b, 0xaee6597b, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x9a43dfc6, 0x67153087, 0x9a43dfc6, 0xe9bd482c, 0xe763cddd, 0x87e579cb, 0x87e579cb, 0x87e579cb, 0x21f09856, 0x21f09856, 0x21f09856, 0x7365d592, 0x7365d592, 0x7365d592, 0x4d266f7a, 0xe9bd482c, 0xe9bd482c, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x78bf287, 0x8e68ddb4, 0x78bf287, 0xb2b0d4a4, 0xcb49fd6e, 0xfa9f0d62, 0xfa9f0d62, 0xfa9f0d62, 0x5f16a85c, 0x5f16a85c, 0x5f16a85c, 0x81fe2a3, 0x81fe2a3, 0x81fe2a3, 0x1ed9d731, 0xb2b0d4a4, 0xb2b0d4a4, }, 18 }, - { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x1c3742c9, 0xb7ccf7ca, 0xfe517937, 0xb7ccf7ca, 0xfa1f93fd, 0x83d93b90, 0x95dac67b, 0x95dac67b, 0x95dac67b, 0x7e7f2c07, 0x7e7f2c07, 0x7e7f2c07, 0x67f5cd62, 0x67f5cd62, 0x67f5cd62, 0x1c3742c9, 0xfa1f93fd, 0xfa1f93fd, }, 18 }, - { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0x663d292a, 0xa008c39, 0x663d292a, 0xcd82113f, 0x1c0b0f02, 0xab2628e, 0xab2628e, 0xab2628e, 0x65fbbe9f, 0x65fbbe9f, 0x65fbbe9f, 0x26f1fbaf, 0x26f1fbaf, 0x26f1fbaf, 0xcc5a7bed, 0xcd82113f, 0xcd82113f, }, 18 }, - { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xef4a3312, 0xfc2f0ab1, 0x6861f25e, 0xfc2f0ab1, 0x11b6b6f7, 0xcd618f3f, 0xae51b639, 0xae51b639, 0xae51b639, 0x68e3f227, 0x68e3f227, 0x68e3f227, 0xbff1f2f0, 0xbff1f2f0, 0xbff1f2f0, 0xef4a3312, 0x11b6b6f7, 0x11b6b6f7, }, 18 }, - { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xe0b5a23e, 0xee551fa6, 0xe0b5a23e, 0xa3436f79, 0x59c36f00, 0x59c36f00, 0x5e67c1f2, 0x5e67c1f2, 0x5e67c1f2, 0x20e7ac94, 0x20e7ac94, 0x20e7ac94, 0xe3c59159, 0xe3c59159, 0xe3c59159, 0x59c36f00, 0xa3436f79, 0xa3436f79, 0x59c36f00, }, 20 }, - { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2bb3c18d, 0xdfae36a1, 0x2bb3c18d, 0x5b644f2, 0xaa4593fe, 0xaa4593fe, 0xccb764da, 0xccb764da, 0xccb764da, 0x6a4269bd, 0x6a4269bd, 0x6a4269bd, 0xe8e58bd6, 0xe8e58bd6, 0xe8e58bd6, 0xaa4593fe, 0x5b644f2, 0x5b644f2, 0xaa4593fe, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xdae90963, 0xc865b2ee, 0xdae90963, 0x87fe64e7, 0xc9cbf769, 0xc9cbf769, 0xbdb21287, 0xbdb21287, 0xbdb21287, 0x436ad34b, 0x436ad34b, 0x436ad34b, 0xab3c7c47, 0xab3c7c47, 0xab3c7c47, 0xc9cbf769, 0x87fe64e7, 0x87fe64e7, 0xc9cbf769, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd5ca4355, 0xc8fbf114, 0xd5ca4355, 0x85d2e7fb, 0x9813a416, 0x9813a416, 0x4a1e101b, 0x4a1e101b, 0x4a1e101b, 0xdbc59628, 0xdbc59628, 0xdbc59628, 0x47b063ea, 0x47b063ea, 0x47b063ea, 0x9813a416, 0x85d2e7fb, 0x85d2e7fb, 0x9813a416, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x722a297e, 0xb34f27df, 0x722a297e, 0x48e0f884, 0x5fcf013d, 0x5fcf013d, 0xee9e0d69, 0xee9e0d69, 0xee9e0d69, 0x3c8e151f, 0x3c8e151f, 0x3c8e151f, 0x23a594e2, 0x23a594e2, 0x23a594e2, 0x5fcf013d, 0x48e0f884, 0x48e0f884, 0x5fcf013d, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x87be67c4, 0x484106d9, 0x87be67c4, 0xe7cdc3ae, 0xdd28f52b, 0xdd28f52b, 0x2063d7c8, 0x2063d7c8, 0x2063d7c8, 0x15f2e2c, 0x15f2e2c, 0x15f2e2c, 0x1b2e4dbd, 0x1b2e4dbd, 0x1b2e4dbd, 0xdd28f52b, 0xe7cdc3ae, 0xe7cdc3ae, 0xdd28f52b, }, 20 }, - { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbf799219, 0xcec61405, 0xbf799219, 0x413f9f74, 0x43d1f34, 0x43d1f34, 0x9dc6a6fb, 0x9dc6a6fb, 0x9dc6a6fb, 0xe2cc0f53, 0xe2cc0f53, 0xe2cc0f53, 0xaec367a, 0xaec367a, 0xaec367a, 0x43d1f34, 0x413f9f74, 0x413f9f74, 0x43d1f34, }, 20 }, - { "gfxterm_ar", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xe0b5a23e, 0xee551fa6, 0xe0b5a23e, 0xa3436f79, 0x59c36f00, 0x59c36f00, 0x5e67c1f2, 0x5e67c1f2, 0x5e67c1f2, 0x20e7ac94, 0x20e7ac94, 0x20e7ac94, 0xe3c59159, 0xe3c59159, 0xe3c59159, 0x59c36f00, 0xa3436f79, 0xa3436f79, 0x59c36f00, }, 20 }, - { "gfxterm_ar", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x2bb3c18d, 0xdfae36a1, 0x2bb3c18d, 0x5b644f2, 0xaa4593fe, 0xaa4593fe, 0xccb764da, 0xccb764da, 0xccb764da, 0x6a4269bd, 0x6a4269bd, 0x6a4269bd, 0xe8e58bd6, 0xe8e58bd6, 0xe8e58bd6, 0xaa4593fe, 0x5b644f2, 0x5b644f2, 0xaa4593fe, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xdae90963, 0xc865b2ee, 0xdae90963, 0x87fe64e7, 0xc9cbf769, 0xc9cbf769, 0xbdb21287, 0xbdb21287, 0xbdb21287, 0x436ad34b, 0x436ad34b, 0x436ad34b, 0xab3c7c47, 0xab3c7c47, 0xab3c7c47, 0xc9cbf769, 0x87fe64e7, 0x87fe64e7, 0xc9cbf769, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x3b1768ca, 0xf9e5eedd, 0x3b1768ca, 0x7f1c9276, 0x5387d57f, 0x5387d57f, 0x927c1c5d, 0x927c1c5d, 0x927c1c5d, 0x52257091, 0x52257091, 0x52257091, 0xb5fbf207, 0xb5fbf207, 0xb5fbf207, 0x5387d57f, 0x7f1c9276, 0x7f1c9276, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x54190c0f, 0xb6b42319, 0x54190c0f, 0xee714190, 0xf83ee7aa, 0xf83ee7aa, 0x1cbd869f, 0x1cbd869f, 0x1cbd869f, 0x80c4566c, 0x80c4566c, 0x80c4566c, 0xb877fdc4, 0xb877fdc4, 0xb877fdc4, 0xf83ee7aa, 0xee714190, 0xee714190, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x25774ca3, 0x3d74e13a, 0x25774ca3, 0x3402f9f6, 0x724366e5, 0x724366e5, 0x447ccdbb, 0x447ccdbb, 0x447ccdbb, 0x3458f41, 0x3458f41, 0x3458f41, 0x6e6ba80b, 0x6e6ba80b, 0x6e6ba80b, 0x724366e5, 0x3402f9f6, 0x3402f9f6, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9143e2a6, 0x6e596cd4, 0x9143e2a6, 0x7ed75f9f, 0x5387d57f, 0x5387d57f, 0x86a0aae, 0x86a0aae, 0x86a0aae, 0xd6a44573, 0xd6a44573, 0xd6a44573, 0x4527d76d, 0x4527d76d, 0x4527d76d, 0x5387d57f, 0x7ed75f9f, 0x7ed75f9f, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf943d873, 0xced7704, 0xf943d873, 0x8889e69f, 0xf83ee7aa, 0xf83ee7aa, 0x82576edb, 0x82576edb, 0x82576edb, 0xf08d7deb, 0xf08d7deb, 0xf08d7deb, 0xc1182c2d, 0xc1182c2d, 0xc1182c2d, 0xf83ee7aa, 0x8889e69f, 0x8889e69f, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x63bd59d2, 0xf34f52d5, 0x63bd59d2, 0x916fd2a2, 0x724366e5, 0x724366e5, 0x11262bd6, 0x11262bd6, 0x11262bd6, 0x48b6d886, 0x48b6d886, 0x48b6d886, 0x8001b6c4, 0x8001b6c4, 0x8001b6c4, 0x724366e5, 0x916fd2a2, 0x916fd2a2, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xed6af547, 0x9ff43eec, 0xed6af547, 0xed0a4de1, 0x1c955882, 0x1c955882, 0xa9dce4cb, 0xa9dce4cb, 0xa9dce4cb, 0x662ba95c, 0x662ba95c, 0x662ba95c, 0x9842a549, 0x9842a549, 0x9842a549, 0x1c955882, 0xed0a4de1, 0xed0a4de1, 0x1c955882, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xbda49d55, 0xf5b57989, 0xbda49d55, 0x79b60451, 0x4d266f7a, 0x4d266f7a, 0xeb1807b5, 0xeb1807b5, 0xeb1807b5, 0xd6f1c0a, 0xd6f1c0a, 0xd6f1c0a, 0x9556489a, 0x9556489a, 0x9556489a, 0x4d266f7a, 0x79b60451, 0x79b60451, 0x4d266f7a, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x90b1e6bc, 0xabcab9fe, 0x90b1e6bc, 0xc45e75b, 0x1ed9d731, 0x1ed9d731, 0xa6ac3ed0, 0xa6ac3ed0, 0xa6ac3ed0, 0x8c82015, 0x8c82015, 0x8c82015, 0x2ba131a3, 0x2ba131a3, 0x2ba131a3, 0x1ed9d731, 0xc45e75b, 0xc45e75b, 0x1ed9d731, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x3b1768ca, 0xf9e5eedd, 0x3b1768ca, 0x7f1c9276, 0x5387d57f, 0x5387d57f, 0x927c1c5d, 0x927c1c5d, 0x927c1c5d, 0x52257091, 0x52257091, 0x52257091, 0xb5fbf207, 0xb5fbf207, 0xb5fbf207, 0x5387d57f, 0x7f1c9276, 0x7f1c9276, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x54190c0f, 0xb6b42319, 0x54190c0f, 0xee714190, 0xf83ee7aa, 0xf83ee7aa, 0x1cbd869f, 0x1cbd869f, 0x1cbd869f, 0x80c4566c, 0x80c4566c, 0x80c4566c, 0xb877fdc4, 0xb877fdc4, 0xb877fdc4, 0xf83ee7aa, 0xee714190, 0xee714190, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x25774ca3, 0x3d74e13a, 0x25774ca3, 0x3402f9f6, 0x724366e5, 0x724366e5, 0x447ccdbb, 0x447ccdbb, 0x447ccdbb, 0x3458f41, 0x3458f41, 0x3458f41, 0x6e6ba80b, 0x6e6ba80b, 0x6e6ba80b, 0x724366e5, 0x3402f9f6, 0x3402f9f6, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9143e2a6, 0x6e596cd4, 0x9143e2a6, 0x7ed75f9f, 0x5387d57f, 0x5387d57f, 0x86a0aae, 0x86a0aae, 0x86a0aae, 0xd6a44573, 0xd6a44573, 0xd6a44573, 0x4527d76d, 0x4527d76d, 0x4527d76d, 0x5387d57f, 0x7ed75f9f, 0x7ed75f9f, 0x5387d57f, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf943d873, 0xced7704, 0xf943d873, 0x8889e69f, 0xf83ee7aa, 0xf83ee7aa, 0x82576edb, 0x82576edb, 0x82576edb, 0xf08d7deb, 0xf08d7deb, 0xf08d7deb, 0xc1182c2d, 0xc1182c2d, 0xc1182c2d, 0xf83ee7aa, 0x8889e69f, 0x8889e69f, 0xf83ee7aa, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x63bd59d2, 0xf34f52d5, 0x63bd59d2, 0x916fd2a2, 0x724366e5, 0x724366e5, 0x11262bd6, 0x11262bd6, 0x11262bd6, 0x48b6d886, 0x48b6d886, 0x48b6d886, 0x8001b6c4, 0x8001b6c4, 0x8001b6c4, 0x724366e5, 0x916fd2a2, 0x916fd2a2, 0x724366e5, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xed6af547, 0x9ff43eec, 0xed6af547, 0xed0a4de1, 0x1c955882, 0x1c955882, 0xa9dce4cb, 0xa9dce4cb, 0xa9dce4cb, 0x662ba95c, 0x662ba95c, 0x662ba95c, 0x9842a549, 0x9842a549, 0x9842a549, 0x1c955882, 0xed0a4de1, 0xed0a4de1, 0x1c955882, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xbda49d55, 0xf5b57989, 0xbda49d55, 0x79b60451, 0x4d266f7a, 0x4d266f7a, 0xeb1807b5, 0xeb1807b5, 0xeb1807b5, 0xd6f1c0a, 0xd6f1c0a, 0xd6f1c0a, 0x9556489a, 0x9556489a, 0x9556489a, 0x4d266f7a, 0x79b60451, 0x79b60451, 0x4d266f7a, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x90b1e6bc, 0xabcab9fe, 0x90b1e6bc, 0xc45e75b, 0x1ed9d731, 0x1ed9d731, 0xa6ac3ed0, 0xa6ac3ed0, 0xa6ac3ed0, 0x8c82015, 0x8c82015, 0x8c82015, 0x2ba131a3, 0x2ba131a3, 0x2ba131a3, 0x1ed9d731, 0xc45e75b, 0xc45e75b, 0x1ed9d731, }, 20 }, - { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xd5ca4355, 0xc8fbf114, 0xd5ca4355, 0x85d2e7fb, 0x9813a416, 0x9813a416, 0x4a1e101b, 0x4a1e101b, 0x4a1e101b, 0xdbc59628, 0xdbc59628, 0xdbc59628, 0x47b063ea, 0x47b063ea, 0x47b063ea, 0x9813a416, 0x85d2e7fb, 0x85d2e7fb, 0x9813a416, }, 20 }, - { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x722a297e, 0xb34f27df, 0x722a297e, 0x48e0f884, 0x5fcf013d, 0x5fcf013d, 0xee9e0d69, 0xee9e0d69, 0xee9e0d69, 0x3c8e151f, 0x3c8e151f, 0x3c8e151f, 0x23a594e2, 0x23a594e2, 0x23a594e2, 0x5fcf013d, 0x48e0f884, 0x48e0f884, 0x5fcf013d, }, 20 }, - { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x87be67c4, 0x484106d9, 0x87be67c4, 0xe7cdc3ae, 0xdd28f52b, 0xdd28f52b, 0x2063d7c8, 0x2063d7c8, 0x2063d7c8, 0x15f2e2c, 0x15f2e2c, 0x15f2e2c, 0x1b2e4dbd, 0x1b2e4dbd, 0x1b2e4dbd, 0xdd28f52b, 0xe7cdc3ae, 0xe7cdc3ae, 0xdd28f52b, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x36622078, 0x979da8f3, 0x36622078, 0x7594ed3f, 0x59c36f00, 0x59c36f00, 0xe5e5cf13, 0xe5e5cf13, 0xe5e5cf13, 0x9b65a275, 0x9b65a275, 0x9b65a275, 0x58479fb8, 0x58479fb8, 0x58479fb8, 0x59c36f00, 0x7594ed3f, 0x7594ed3f, 0x59c36f00, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x48ee0ceb, 0xc6eb6d53, 0x48ee0ceb, 0x66eb8994, 0xaa4593fe, 0xaa4593fe, 0x86ac5984, 0x86ac5984, 0x86ac5984, 0x205954e3, 0x205954e3, 0x205954e3, 0xa2feb688, 0xa2feb688, 0xa2feb688, 0xaa4593fe, 0x66eb8994, 0x66eb8994, 0xaa4593fe, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xfa53f185, 0xaf8fa3eb, 0xfa53f185, 0xa7449c01, 0xc9cbf769, 0xc9cbf769, 0x50b94b47, 0x50b94b47, 0x50b94b47, 0xae618a8b, 0xae618a8b, 0xae618a8b, 0x46372587, 0x46372587, 0x46372587, 0xc9cbf769, 0xa7449c01, 0xa7449c01, 0xc9cbf769, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xc6eb6e6e, 0xc5217d5b, 0xc6eb6e6e, 0x96f3cac0, 0x9813a416, 0x9813a416, 0x5752c3fe, 0x5752c3fe, 0x5752c3fe, 0xc68945cd, 0xc68945cd, 0xc68945cd, 0x5afcb00f, 0x5afcb00f, 0x5afcb00f, 0x9813a416, 0x96f3cac0, 0x96f3cac0, 0x9813a416, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7fd1def2, 0x98a2e53a, 0x7fd1def2, 0x451b0f08, 0x5fcf013d, 0x5fcf013d, 0x9f19ac09, 0x9f19ac09, 0x9f19ac09, 0x4d09b47f, 0x4d09b47f, 0x4d09b47f, 0x52223582, 0x52223582, 0x52223582, 0x5fcf013d, 0x451b0f08, 0x451b0f08, 0x5fcf013d, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xaac2ae55, 0x3e7a25f, 0xaac2ae55, 0xcab10a3f, 0xdd28f52b, 0xdd28f52b, 0x5f2b8179, 0x5f2b8179, 0x5f2b8179, 0x7e17789d, 0x7e17789d, 0x7e17789d, 0x64661b0c, 0x64661b0c, 0x64661b0c, 0xdd28f52b, 0xcab10a3f, 0xcab10a3f, 0xdd28f52b, }, 20 }, - { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xfbdee88, 0x812f047f, 0xfbdee88, 0xf1fbe3e5, 0x43d1f34, 0x43d1f34, 0x6694d5e, 0x6694d5e, 0x6694d5e, 0x7963e4f6, 0x7963e4f6, 0x7963e4f6, 0x9143dddf, 0x9143dddf, 0x9143dddf, 0x43d1f34, 0xf1fbe3e5, 0xf1fbe3e5, 0x43d1f34, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x36622078, 0x979da8f3, 0x36622078, 0x7594ed3f, 0x59c36f00, 0x59c36f00, 0xe5e5cf13, 0xe5e5cf13, 0xe5e5cf13, 0x9b65a275, 0x9b65a275, 0x9b65a275, 0x58479fb8, 0x58479fb8, 0x58479fb8, 0x59c36f00, 0x7594ed3f, 0x7594ed3f, 0x59c36f00, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x48ee0ceb, 0xc6eb6d53, 0x48ee0ceb, 0x66eb8994, 0xaa4593fe, 0xaa4593fe, 0x86ac5984, 0x86ac5984, 0x86ac5984, 0x205954e3, 0x205954e3, 0x205954e3, 0xa2feb688, 0xa2feb688, 0xa2feb688, 0xaa4593fe, 0x66eb8994, 0x66eb8994, 0xaa4593fe, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xfa53f185, 0xaf8fa3eb, 0xfa53f185, 0xa7449c01, 0xc9cbf769, 0xc9cbf769, 0x50b94b47, 0x50b94b47, 0x50b94b47, 0xae618a8b, 0xae618a8b, 0xae618a8b, 0x46372587, 0x46372587, 0x46372587, 0xc9cbf769, 0xa7449c01, 0xa7449c01, 0xc9cbf769, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd8d870b3, 0x9128b01a, 0xd8d870b3, 0x9cd38a0f, 0x5387d57f, 0x5387d57f, 0x136cad2, 0x136cad2, 0x136cad2, 0xc16fa61e, 0xc16fa61e, 0xc16fa61e, 0x26b12488, 0x26b12488, 0x26b12488, 0x5387d57f, 0x9cd38a0f, 0x9cd38a0f, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xeaeda16f, 0x36d21de0, 0xeaeda16f, 0x5085ecf0, 0xf83ee7aa, 0xf83ee7aa, 0x3eac591b, 0x3eac591b, 0x3eac591b, 0xa2d589e8, 0xa2d589e8, 0xa2d589e8, 0x9a662240, 0x9a662240, 0x9a662240, 0xf83ee7aa, 0x5085ecf0, 0x5085ecf0, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x333a0d08, 0x47d0c238, 0x333a0d08, 0x224fb85d, 0x724366e5, 0x724366e5, 0xf4044671, 0xf4044671, 0xf4044671, 0xb33d048b, 0xb33d048b, 0xb33d048b, 0xde1323c1, 0xde1323c1, 0xde1323c1, 0x724366e5, 0x224fb85d, 0x224fb85d, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4a43c1c8, 0xe019a943, 0x4a43c1c8, 0xa5d77cf1, 0x5387d57f, 0x5387d57f, 0x8171a604, 0x8171a604, 0x8171a604, 0x5fbfe9d9, 0x5fbfe9d9, 0x5fbfe9d9, 0xcc3c7bc7, 0xcc3c7bc7, 0xcc3c7bc7, 0x5387d57f, 0xa5d77cf1, 0xa5d77cf1, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb770c3fe, 0x50b21ef7, 0xb770c3fe, 0xc6bafd12, 0xf83ee7aa, 0xf83ee7aa, 0x8df53a5d, 0x8df53a5d, 0x8df53a5d, 0xff2f296d, 0xff2f296d, 0xff2f296d, 0xceba78ab, 0xceba78ab, 0xceba78ab, 0xf83ee7aa, 0xc6bafd12, 0xc6bafd12, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xe8f75cfb, 0x402c0692, 0xe8f75cfb, 0x1a25d78b, 0x724366e5, 0x724366e5, 0xaf01e304, 0xaf01e304, 0xaf01e304, 0xf6911054, 0xf6911054, 0xf6911054, 0x3e267e16, 0x3e267e16, 0x3e267e16, 0x724366e5, 0x1a25d78b, 0x1a25d78b, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x89f843d3, 0xc27ae37d, 0x89f843d3, 0x8998fb75, 0x1c955882, 0x1c955882, 0x698caa77, 0x698caa77, 0x698caa77, 0xa67be7e0, 0xa67be7e0, 0xa67be7e0, 0x5812ebf5, 0x5812ebf5, 0x5812ebf5, 0x1c955882, 0x8998fb75, 0x8998fb75, 0x1c955882, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xa10c24e6, 0x12eeef09, 0xa10c24e6, 0x651ebde2, 0x4d266f7a, 0x4d266f7a, 0x8ed47731, 0x8ed47731, 0x8ed47731, 0x68a36c8e, 0x68a36c8e, 0x68a36c8e, 0xf09a381e, 0xf09a381e, 0xf09a381e, 0x4d266f7a, 0x651ebde2, 0x651ebde2, 0x4d266f7a, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x85a30869, 0xbaa08e30, 0x85a30869, 0x1957098e, 0x1ed9d731, 0x1ed9d731, 0x4ffc007b, 0x4ffc007b, 0x4ffc007b, 0xe1981ebe, 0xe1981ebe, 0xe1981ebe, 0xc2f10f08, 0xc2f10f08, 0xc2f10f08, 0x1ed9d731, 0x1957098e, 0x1957098e, 0x1ed9d731, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd8d870b3, 0x9128b01a, 0xd8d870b3, 0x9cd38a0f, 0x5387d57f, 0x5387d57f, 0x136cad2, 0x136cad2, 0x136cad2, 0xc16fa61e, 0xc16fa61e, 0xc16fa61e, 0x26b12488, 0x26b12488, 0x26b12488, 0x5387d57f, 0x9cd38a0f, 0x9cd38a0f, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xeaeda16f, 0x36d21de0, 0xeaeda16f, 0x5085ecf0, 0xf83ee7aa, 0xf83ee7aa, 0x3eac591b, 0x3eac591b, 0x3eac591b, 0xa2d589e8, 0xa2d589e8, 0xa2d589e8, 0x9a662240, 0x9a662240, 0x9a662240, 0xf83ee7aa, 0x5085ecf0, 0x5085ecf0, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x333a0d08, 0x47d0c238, 0x333a0d08, 0x224fb85d, 0x724366e5, 0x724366e5, 0xf4044671, 0xf4044671, 0xf4044671, 0xb33d048b, 0xb33d048b, 0xb33d048b, 0xde1323c1, 0xde1323c1, 0xde1323c1, 0x724366e5, 0x224fb85d, 0x224fb85d, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4a43c1c8, 0xe019a943, 0x4a43c1c8, 0xa5d77cf1, 0x5387d57f, 0x5387d57f, 0x8171a604, 0x8171a604, 0x8171a604, 0x5fbfe9d9, 0x5fbfe9d9, 0x5fbfe9d9, 0xcc3c7bc7, 0xcc3c7bc7, 0xcc3c7bc7, 0x5387d57f, 0xa5d77cf1, 0xa5d77cf1, 0x5387d57f, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb770c3fe, 0x50b21ef7, 0xb770c3fe, 0xc6bafd12, 0xf83ee7aa, 0xf83ee7aa, 0x8df53a5d, 0x8df53a5d, 0x8df53a5d, 0xff2f296d, 0xff2f296d, 0xff2f296d, 0xceba78ab, 0xceba78ab, 0xceba78ab, 0xf83ee7aa, 0xc6bafd12, 0xc6bafd12, 0xf83ee7aa, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xe8f75cfb, 0x402c0692, 0xe8f75cfb, 0x1a25d78b, 0x724366e5, 0x724366e5, 0xaf01e304, 0xaf01e304, 0xaf01e304, 0xf6911054, 0xf6911054, 0xf6911054, 0x3e267e16, 0x3e267e16, 0x3e267e16, 0x724366e5, 0x1a25d78b, 0x1a25d78b, 0x724366e5, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x89f843d3, 0xc27ae37d, 0x89f843d3, 0x8998fb75, 0x1c955882, 0x1c955882, 0x698caa77, 0x698caa77, 0x698caa77, 0xa67be7e0, 0xa67be7e0, 0xa67be7e0, 0x5812ebf5, 0x5812ebf5, 0x5812ebf5, 0x1c955882, 0x8998fb75, 0x8998fb75, 0x1c955882, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xa10c24e6, 0x12eeef09, 0xa10c24e6, 0x651ebde2, 0x4d266f7a, 0x4d266f7a, 0x8ed47731, 0x8ed47731, 0x8ed47731, 0x68a36c8e, 0x68a36c8e, 0x68a36c8e, 0xf09a381e, 0xf09a381e, 0xf09a381e, 0x4d266f7a, 0x651ebde2, 0x651ebde2, 0x4d266f7a, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x85a30869, 0xbaa08e30, 0x85a30869, 0x1957098e, 0x1ed9d731, 0x1ed9d731, 0x4ffc007b, 0x4ffc007b, 0x4ffc007b, 0xe1981ebe, 0xe1981ebe, 0xe1981ebe, 0xc2f10f08, 0xc2f10f08, 0xc2f10f08, 0x1ed9d731, 0x1957098e, 0x1957098e, 0x1ed9d731, }, 20 }, - { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xc6eb6e6e, 0xc5217d5b, 0xc6eb6e6e, 0x96f3cac0, 0x9813a416, 0x9813a416, 0x5752c3fe, 0x5752c3fe, 0x5752c3fe, 0xc68945cd, 0xc68945cd, 0xc68945cd, 0x5afcb00f, 0x5afcb00f, 0x5afcb00f, 0x9813a416, 0x96f3cac0, 0x96f3cac0, 0x9813a416, }, 20 }, - { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7fd1def2, 0x98a2e53a, 0x7fd1def2, 0x451b0f08, 0x5fcf013d, 0x5fcf013d, 0x9f19ac09, 0x9f19ac09, 0x9f19ac09, 0x4d09b47f, 0x4d09b47f, 0x4d09b47f, 0x52223582, 0x52223582, 0x52223582, 0x5fcf013d, 0x451b0f08, 0x451b0f08, 0x5fcf013d, }, 20 }, - { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xaac2ae55, 0x3e7a25f, 0xaac2ae55, 0xcab10a3f, 0xdd28f52b, 0xdd28f52b, 0x5f2b8179, 0x5f2b8179, 0x5f2b8179, 0x7e17789d, 0x7e17789d, 0x7e17789d, 0x64661b0c, 0x64661b0c, 0x64661b0c, 0xdd28f52b, 0xcab10a3f, 0xcab10a3f, 0xdd28f52b, }, 20 }, - { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x99e53699, 0x9b30b9b8, 0x99e53699, 0xda13fbde, 0x59c36f00, 0x59c36f00, 0xc6c80006, 0xc6c80006, 0xc6c80006, 0xb8486d60, 0xb8486d60, 0xb8486d60, 0x7b6a50ad, 0x7b6a50ad, 0x7b6a50ad, 0x59c36f00, 0xda13fbde, 0xda13fbde, 0x59c36f00, }, 20 }, - { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x5596d8c4, 0xe6c08467, 0x5596d8c4, 0x7b935dbb, 0xaa4593fe, 0xaa4593fe, 0xb2094db6, 0xb2094db6, 0xb2094db6, 0x14fc40d1, 0x14fc40d1, 0x14fc40d1, 0x965ba2ba, 0x965ba2ba, 0x965ba2ba, 0xaa4593fe, 0x7b935dbb, 0x7b935dbb, 0xaa4593fe, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x8b963803, 0x3a329278, 0x8b963803, 0xd6815587, 0xc9cbf769, 0xc9cbf769, 0x85733bd7, 0x85733bd7, 0x85733bd7, 0x7babfa1b, 0x7babfa1b, 0x7babfa1b, 0x93fd5517, 0x93fd5517, 0x93fd5517, 0xc9cbf769, 0xd6815587, 0xd6815587, 0xc9cbf769, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x27813091, 0xd32064ba, 0x27813091, 0x7799943f, 0x9813a416, 0x9813a416, 0x5cfa5159, 0x5cfa5159, 0x5cfa5159, 0xcd21d76a, 0xcd21d76a, 0xcd21d76a, 0x515422a8, 0x515422a8, 0x515422a8, 0x9813a416, 0x7799943f, 0x7799943f, 0x9813a416, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf107273d, 0xd1d8f23b, 0xf107273d, 0xcbcdf6c7, 0x5fcf013d, 0x5fcf013d, 0x164d5584, 0x164d5584, 0x164d5584, 0xc45d4df2, 0xc45d4df2, 0xc45d4df2, 0xdb76cc0f, 0xdb76cc0f, 0xdb76cc0f, 0x5fcf013d, 0xcbcdf6c7, 0xcbcdf6c7, 0x5fcf013d, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xa54fb200, 0x92d6596f, 0xa54fb200, 0xc53c166a, 0xdd28f52b, 0xdd28f52b, 0x97b266c9, 0x97b266c9, 0x97b266c9, 0xb68e9f2d, 0xb68e9f2d, 0xb68e9f2d, 0xacfffcbc, 0xacfffcbc, 0xacfffcbc, 0xdd28f52b, 0xc53c166a, 0xc53c166a, 0xdd28f52b, }, 20 }, - { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x6d1ede55, 0x4bb31527, 0x6d1ede55, 0x9358d338, 0x43d1f34, 0x43d1f34, 0xa3f91b32, 0xa3f91b32, 0xa3f91b32, 0xdcf3b29a, 0xdcf3b29a, 0xdcf3b29a, 0x34d38bb3, 0x34d38bb3, 0x34d38bb3, 0x43d1f34, 0x9358d338, 0x9358d338, 0x43d1f34, }, 20 }, - { "gfxterm_heb", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x99e53699, 0x9b30b9b8, 0x99e53699, 0xda13fbde, 0x59c36f00, 0x59c36f00, 0xc6c80006, 0xc6c80006, 0xc6c80006, 0xb8486d60, 0xb8486d60, 0xb8486d60, 0x7b6a50ad, 0x7b6a50ad, 0x7b6a50ad, 0x59c36f00, 0xda13fbde, 0xda13fbde, 0x59c36f00, }, 20 }, - { "gfxterm_heb", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x5596d8c4, 0xe6c08467, 0x5596d8c4, 0x7b935dbb, 0xaa4593fe, 0xaa4593fe, 0xb2094db6, 0xb2094db6, 0xb2094db6, 0x14fc40d1, 0x14fc40d1, 0x14fc40d1, 0x965ba2ba, 0x965ba2ba, 0x965ba2ba, 0xaa4593fe, 0x7b935dbb, 0x7b935dbb, 0xaa4593fe, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x8b963803, 0x3a329278, 0x8b963803, 0xd6815587, 0xc9cbf769, 0xc9cbf769, 0x85733bd7, 0x85733bd7, 0x85733bd7, 0x7babfa1b, 0x7babfa1b, 0x7babfa1b, 0x93fd5517, 0x93fd5517, 0x93fd5517, 0xc9cbf769, 0xd6815587, 0xd6815587, 0xc9cbf769, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeada5358, 0xa5081c9c, 0xeada5358, 0xaed1a9e4, 0x5387d57f, 0x5387d57f, 0xe7380617, 0xe7380617, 0xe7380617, 0x27616adb, 0x27616adb, 0x27616adb, 0xc0bfe84d, 0xc0bfe84d, 0xc0bfe84d, 0x5387d57f, 0xaed1a9e4, 0xaed1a9e4, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x167e9ac0, 0xc5a57b5f, 0x167e9ac0, 0xac16d75f, 0xf83ee7aa, 0xf83ee7aa, 0xb47ab0cb, 0xb47ab0cb, 0xb47ab0cb, 0x28036038, 0x28036038, 0x28036038, 0x10b0cb90, 0x10b0cb90, 0x10b0cb90, 0xf83ee7aa, 0xac16d75f, 0xac16d75f, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xfd0449a3, 0xb946b16a, 0xfd0449a3, 0xec71fcf6, 0x724366e5, 0x724366e5, 0xab4d15ce, 0xab4d15ce, 0xab4d15ce, 0xec745734, 0xec745734, 0xec745734, 0x815a707e, 0x815a707e, 0x815a707e, 0x724366e5, 0xec71fcf6, 0xec71fcf6, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x1eb746a, 0x74afe43, 0x1eb746a, 0xee7fc953, 0x5387d57f, 0x5387d57f, 0x704981d6, 0x704981d6, 0x704981d6, 0xae87ce0b, 0xae87ce0b, 0xae87ce0b, 0x3d045c15, 0x3d045c15, 0x3d045c15, 0x5387d57f, 0xee7fc953, 0xee7fc953, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb9fa44c, 0xff4e04c7, 0xb9fa44c, 0x7a559aa0, 0xf83ee7aa, 0xf83ee7aa, 0xfccbce43, 0xfccbce43, 0xfccbce43, 0x8e11dd73, 0x8e11dd73, 0x8e11dd73, 0xbf848cb5, 0xbf848cb5, 0xbf848cb5, 0xf83ee7aa, 0x7a559aa0, 0x7a559aa0, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xcc83dbb8, 0x7fa3d9db, 0xcc83dbb8, 0x3e5150c8, 0x724366e5, 0x724366e5, 0x3d838d1c, 0x3d838d1c, 0x3d838d1c, 0x64137e4c, 0x64137e4c, 0x64137e4c, 0xaca4100e, 0xaca4100e, 0xaca4100e, 0x724366e5, 0x3e5150c8, 0x3e5150c8, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x2a9a3393, 0xc249bea, 0x2a9a3393, 0x2afa8b35, 0x1c955882, 0x1c955882, 0x9c6441e2, 0x9c6441e2, 0x9c6441e2, 0x53930c75, 0x53930c75, 0x53930c75, 0xadfa0060, 0xadfa0060, 0xadfa0060, 0x1c955882, 0x2afa8b35, 0x2afa8b35, 0x1c955882, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xcf807eaa, 0x4af8ad98, 0xcf807eaa, 0xb92e7ae, 0x4d266f7a, 0x4d266f7a, 0x15d955c1, 0x15d955c1, 0x15d955c1, 0xf3ae4e7e, 0xf3ae4e7e, 0xf3ae4e7e, 0x6b971aee, 0x6b971aee, 0x6b971aee, 0x4d266f7a, 0xb92e7ae, 0xb92e7ae, 0x4d266f7a, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x98e40974, 0xf0ed7ac2, 0x98e40974, 0x4100893, 0x1ed9d731, 0x1ed9d731, 0x7d102c2f, 0x7d102c2f, 0x7d102c2f, 0xd37432ea, 0xd37432ea, 0xd37432ea, 0xf01d235c, 0xf01d235c, 0xf01d235c, 0x1ed9d731, 0x4100893, 0x4100893, 0x1ed9d731, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeada5358, 0xa5081c9c, 0xeada5358, 0xaed1a9e4, 0x5387d57f, 0x5387d57f, 0xe7380617, 0xe7380617, 0xe7380617, 0x27616adb, 0x27616adb, 0x27616adb, 0xc0bfe84d, 0xc0bfe84d, 0xc0bfe84d, 0x5387d57f, 0xaed1a9e4, 0xaed1a9e4, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x167e9ac0, 0xc5a57b5f, 0x167e9ac0, 0xac16d75f, 0xf83ee7aa, 0xf83ee7aa, 0xb47ab0cb, 0xb47ab0cb, 0xb47ab0cb, 0x28036038, 0x28036038, 0x28036038, 0x10b0cb90, 0x10b0cb90, 0x10b0cb90, 0xf83ee7aa, 0xac16d75f, 0xac16d75f, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xfd0449a3, 0xb946b16a, 0xfd0449a3, 0xec71fcf6, 0x724366e5, 0x724366e5, 0xab4d15ce, 0xab4d15ce, 0xab4d15ce, 0xec745734, 0xec745734, 0xec745734, 0x815a707e, 0x815a707e, 0x815a707e, 0x724366e5, 0xec71fcf6, 0xec71fcf6, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x1eb746a, 0x74afe43, 0x1eb746a, 0xee7fc953, 0x5387d57f, 0x5387d57f, 0x704981d6, 0x704981d6, 0x704981d6, 0xae87ce0b, 0xae87ce0b, 0xae87ce0b, 0x3d045c15, 0x3d045c15, 0x3d045c15, 0x5387d57f, 0xee7fc953, 0xee7fc953, 0x5387d57f, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xb9fa44c, 0xff4e04c7, 0xb9fa44c, 0x7a559aa0, 0xf83ee7aa, 0xf83ee7aa, 0xfccbce43, 0xfccbce43, 0xfccbce43, 0x8e11dd73, 0x8e11dd73, 0x8e11dd73, 0xbf848cb5, 0xbf848cb5, 0xbf848cb5, 0xf83ee7aa, 0x7a559aa0, 0x7a559aa0, 0xf83ee7aa, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xcc83dbb8, 0x7fa3d9db, 0xcc83dbb8, 0x3e5150c8, 0x724366e5, 0x724366e5, 0x3d838d1c, 0x3d838d1c, 0x3d838d1c, 0x64137e4c, 0x64137e4c, 0x64137e4c, 0xaca4100e, 0xaca4100e, 0xaca4100e, 0x724366e5, 0x3e5150c8, 0x3e5150c8, 0x724366e5, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x2a9a3393, 0xc249bea, 0x2a9a3393, 0x2afa8b35, 0x1c955882, 0x1c955882, 0x9c6441e2, 0x9c6441e2, 0x9c6441e2, 0x53930c75, 0x53930c75, 0x53930c75, 0xadfa0060, 0xadfa0060, 0xadfa0060, 0x1c955882, 0x2afa8b35, 0x2afa8b35, 0x1c955882, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xcf807eaa, 0x4af8ad98, 0xcf807eaa, 0xb92e7ae, 0x4d266f7a, 0x4d266f7a, 0x15d955c1, 0x15d955c1, 0x15d955c1, 0xf3ae4e7e, 0xf3ae4e7e, 0xf3ae4e7e, 0x6b971aee, 0x6b971aee, 0x6b971aee, 0x4d266f7a, 0xb92e7ae, 0xb92e7ae, 0x4d266f7a, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x98e40974, 0xf0ed7ac2, 0x98e40974, 0x4100893, 0x1ed9d731, 0x1ed9d731, 0x7d102c2f, 0x7d102c2f, 0x7d102c2f, 0xd37432ea, 0xd37432ea, 0xd37432ea, 0xf01d235c, 0xf01d235c, 0xf01d235c, 0x1ed9d731, 0x4100893, 0x4100893, 0x1ed9d731, }, 20 }, - { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x27813091, 0xd32064ba, 0x27813091, 0x7799943f, 0x9813a416, 0x9813a416, 0x5cfa5159, 0x5cfa5159, 0x5cfa5159, 0xcd21d76a, 0xcd21d76a, 0xcd21d76a, 0x515422a8, 0x515422a8, 0x515422a8, 0x9813a416, 0x7799943f, 0x7799943f, 0x9813a416, }, 20 }, - { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf107273d, 0xd1d8f23b, 0xf107273d, 0xcbcdf6c7, 0x5fcf013d, 0x5fcf013d, 0x164d5584, 0x164d5584, 0x164d5584, 0xc45d4df2, 0xc45d4df2, 0xc45d4df2, 0xdb76cc0f, 0xdb76cc0f, 0xdb76cc0f, 0x5fcf013d, 0xcbcdf6c7, 0xcbcdf6c7, 0x5fcf013d, }, 20 }, - { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xa54fb200, 0x92d6596f, 0xa54fb200, 0xc53c166a, 0xdd28f52b, 0xdd28f52b, 0x97b266c9, 0x97b266c9, 0x97b266c9, 0xb68e9f2d, 0xb68e9f2d, 0xb68e9f2d, 0xacfffcbc, 0xacfffcbc, 0xacfffcbc, 0xdd28f52b, 0xc53c166a, 0xc53c166a, 0xdd28f52b, }, 20 }, - { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xfe511789, 0x421405b3, 0xfe511789, 0xbda7dace, 0x59c36f00, 0x59c36f00, 0x2a367884, 0x2a367884, 0x2a367884, 0x54b615e2, 0x54b615e2, 0x54b615e2, 0x9794282f, 0x9794282f, 0x9794282f, 0x59c36f00, 0xbda7dace, 0xbda7dace, 0x59c36f00, }, 20 }, - { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2616eaaf, 0xd0263182, 0x2616eaaf, 0x8136fd0, 0xaa4593fe, 0xaa4593fe, 0x5b85b7a8, 0x5b85b7a8, 0x5b85b7a8, 0xfd70bacf, 0xfd70bacf, 0xfd70bacf, 0x7fd758a4, 0x7fd758a4, 0x7fd758a4, 0xaa4593fe, 0x8136fd0, 0x8136fd0, 0xaa4593fe, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9214e205, 0x211e70db, 0x9214e205, 0xcf038f81, 0xc9cbf769, 0xc9cbf769, 0x5a304c, 0x5a304c, 0x5a304c, 0xfe82f180, 0xfe82f180, 0xfe82f180, 0x16d45e8c, 0x16d45e8c, 0x16d45e8c, 0xc9cbf769, 0xcf038f81, 0xcf038f81, 0xc9cbf769, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x8bbe1e38, 0xfef8974b, 0x8bbe1e38, 0xdba6ba96, 0x9813a416, 0x9813a416, 0xdf1a19a3, 0xdf1a19a3, 0xdf1a19a3, 0x4ec19f90, 0x4ec19f90, 0x4ec19f90, 0xd2b46a52, 0xd2b46a52, 0xd2b46a52, 0x9813a416, 0xdba6ba96, 0xdba6ba96, 0x9813a416, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xda045c37, 0xb8ae26e3, 0xda045c37, 0xe0ce8dcd, 0x5fcf013d, 0x5fcf013d, 0xee7a1c7, 0xee7a1c7, 0xee7a1c7, 0xdcf7b9b1, 0xdcf7b9b1, 0xdcf7b9b1, 0xc3dc384c, 0xc3dc384c, 0xc3dc384c, 0x5fcf013d, 0xe0ce8dcd, 0xe0ce8dcd, 0x5fcf013d, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2e35339d, 0x798918b, 0x2e35339d, 0x4e4697f7, 0xdd28f52b, 0xdd28f52b, 0x92c68d60, 0x92c68d60, 0x92c68d60, 0xb3fa7484, 0xb3fa7484, 0xb3fa7484, 0xa98b1715, 0xa98b1715, 0xa98b1715, 0xdd28f52b, 0x4e4697f7, 0x4e4697f7, 0xdd28f52b, }, 20 }, - { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xb5c5482e, 0xeec9616, 0xb5c5482e, 0x4b834543, 0x43d1f34, 0x43d1f34, 0xd4fadab2, 0xd4fadab2, 0xd4fadab2, 0xabf0731a, 0xabf0731a, 0xabf0731a, 0x43d04a33, 0x43d04a33, 0x43d04a33, 0x43d1f34, 0x4b834543, 0x4b834543, 0x43d1f34, }, 20 }, - { "gfxterm_gre", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xfe511789, 0x421405b3, 0xfe511789, 0xbda7dace, 0x59c36f00, 0x59c36f00, 0x2a367884, 0x2a367884, 0x2a367884, 0x54b615e2, 0x54b615e2, 0x54b615e2, 0x9794282f, 0x9794282f, 0x9794282f, 0x59c36f00, 0xbda7dace, 0xbda7dace, 0x59c36f00, }, 20 }, - { "gfxterm_gre", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x2616eaaf, 0xd0263182, 0x2616eaaf, 0x8136fd0, 0xaa4593fe, 0xaa4593fe, 0x5b85b7a8, 0x5b85b7a8, 0x5b85b7a8, 0xfd70bacf, 0xfd70bacf, 0xfd70bacf, 0x7fd758a4, 0x7fd758a4, 0x7fd758a4, 0xaa4593fe, 0x8136fd0, 0x8136fd0, 0xaa4593fe, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x9214e205, 0x211e70db, 0x9214e205, 0xcf038f81, 0xc9cbf769, 0xc9cbf769, 0x5a304c, 0x5a304c, 0x5a304c, 0xfe82f180, 0xfe82f180, 0xfe82f180, 0x16d45e8c, 0x16d45e8c, 0x16d45e8c, 0xc9cbf769, 0xcf038f81, 0xcf038f81, 0xc9cbf769, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xa841a245, 0x7c4a37aa, 0xa841a245, 0xec4a58f9, 0x5387d57f, 0x5387d57f, 0x8670fc38, 0x8670fc38, 0x8670fc38, 0x462990f4, 0x462990f4, 0x462990f4, 0xa1f71262, 0xa1f71262, 0xa1f71262, 0x5387d57f, 0xec4a58f9, 0xec4a58f9, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc589c63a, 0xda1b2d71, 0xc589c63a, 0x7fe18ba5, 0xf83ee7aa, 0xf83ee7aa, 0x74883fe5, 0x74883fe5, 0x74883fe5, 0xe8f1ef16, 0xe8f1ef16, 0xe8f1ef16, 0xd04244be, 0xd04244be, 0xd04244be, 0xf83ee7aa, 0x7fe18ba5, 0x7fe18ba5, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x5df86da, 0x97465d78, 0x5df86da, 0x14aa338f, 0x724366e5, 0x724366e5, 0x60829227, 0x60829227, 0x60829227, 0x27bbd0dd, 0x27bbd0dd, 0x27bbd0dd, 0x4a95f797, 0x4a95f797, 0x4a95f797, 0x724366e5, 0x14aa338f, 0x14aa338f, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xebf6bdc1, 0xaf2c370b, 0xebf6bdc1, 0x46200f8, 0x5387d57f, 0x5387d57f, 0x81cd0740, 0x81cd0740, 0x81cd0740, 0x5f03489d, 0x5f03489d, 0x5f03489d, 0xcc80da83, 0xcc80da83, 0xcc80da83, 0x5387d57f, 0x46200f8, 0x46200f8, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x5455b923, 0x93681ea, 0x5455b923, 0x259f87cf, 0xf83ee7aa, 0xf83ee7aa, 0xf5cd3d43, 0xf5cd3d43, 0xf5cd3d43, 0x87172e73, 0x87172e73, 0x87172e73, 0xb6827fb5, 0xb6827fb5, 0xb6827fb5, 0xf83ee7aa, 0x259f87cf, 0x259f87cf, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xec9a1f85, 0x74e0a22a, 0xec9a1f85, 0x1e4894f5, 0x724366e5, 0x724366e5, 0xa74db0e6, 0xa74db0e6, 0xa74db0e6, 0xfedd43b6, 0xfedd43b6, 0xfedd43b6, 0x366a2df4, 0x366a2df4, 0x366a2df4, 0x724366e5, 0x1e4894f5, 0x1e4894f5, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x8cac1ee1, 0x7824cfba, 0x8cac1ee1, 0x8ccca647, 0x1c955882, 0x1c955882, 0xec40c88e, 0xec40c88e, 0xec40c88e, 0x23b78519, 0x23b78519, 0x23b78519, 0xddde890c, 0xddde890c, 0xddde890c, 0x1c955882, 0x8ccca647, 0x8ccca647, 0x1c955882, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xccb8f998, 0x89af656f, 0xccb8f998, 0x8aa609c, 0x4d266f7a, 0x4d266f7a, 0x863eb372, 0x863eb372, 0x863eb372, 0x6049a8cd, 0x6049a8cd, 0x6049a8cd, 0xf870fc5d, 0xf870fc5d, 0xf870fc5d, 0x4d266f7a, 0x8aa609c, 0x8aa609c, 0x4d266f7a, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xa3bd882a, 0x5adc164, 0xa3bd882a, 0x3f4989cd, 0x1ed9d731, 0x1ed9d731, 0x46a1472c, 0x46a1472c, 0x46a1472c, 0xe8c559e9, 0xe8c559e9, 0xe8c559e9, 0xcbac485f, 0xcbac485f, 0xcbac485f, 0x1ed9d731, 0x3f4989cd, 0x3f4989cd, 0x1ed9d731, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xa841a245, 0x7c4a37aa, 0xa841a245, 0xec4a58f9, 0x5387d57f, 0x5387d57f, 0x8670fc38, 0x8670fc38, 0x8670fc38, 0x462990f4, 0x462990f4, 0x462990f4, 0xa1f71262, 0xa1f71262, 0xa1f71262, 0x5387d57f, 0xec4a58f9, 0xec4a58f9, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc589c63a, 0xda1b2d71, 0xc589c63a, 0x7fe18ba5, 0xf83ee7aa, 0xf83ee7aa, 0x74883fe5, 0x74883fe5, 0x74883fe5, 0xe8f1ef16, 0xe8f1ef16, 0xe8f1ef16, 0xd04244be, 0xd04244be, 0xd04244be, 0xf83ee7aa, 0x7fe18ba5, 0x7fe18ba5, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x5df86da, 0x97465d78, 0x5df86da, 0x14aa338f, 0x724366e5, 0x724366e5, 0x60829227, 0x60829227, 0x60829227, 0x27bbd0dd, 0x27bbd0dd, 0x27bbd0dd, 0x4a95f797, 0x4a95f797, 0x4a95f797, 0x724366e5, 0x14aa338f, 0x14aa338f, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xebf6bdc1, 0xaf2c370b, 0xebf6bdc1, 0x46200f8, 0x5387d57f, 0x5387d57f, 0x81cd0740, 0x81cd0740, 0x81cd0740, 0x5f03489d, 0x5f03489d, 0x5f03489d, 0xcc80da83, 0xcc80da83, 0xcc80da83, 0x5387d57f, 0x46200f8, 0x46200f8, 0x5387d57f, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x5455b923, 0x93681ea, 0x5455b923, 0x259f87cf, 0xf83ee7aa, 0xf83ee7aa, 0xf5cd3d43, 0xf5cd3d43, 0xf5cd3d43, 0x87172e73, 0x87172e73, 0x87172e73, 0xb6827fb5, 0xb6827fb5, 0xb6827fb5, 0xf83ee7aa, 0x259f87cf, 0x259f87cf, 0xf83ee7aa, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xec9a1f85, 0x74e0a22a, 0xec9a1f85, 0x1e4894f5, 0x724366e5, 0x724366e5, 0xa74db0e6, 0xa74db0e6, 0xa74db0e6, 0xfedd43b6, 0xfedd43b6, 0xfedd43b6, 0x366a2df4, 0x366a2df4, 0x366a2df4, 0x724366e5, 0x1e4894f5, 0x1e4894f5, 0x724366e5, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x8cac1ee1, 0x7824cfba, 0x8cac1ee1, 0x8ccca647, 0x1c955882, 0x1c955882, 0xec40c88e, 0xec40c88e, 0xec40c88e, 0x23b78519, 0x23b78519, 0x23b78519, 0xddde890c, 0xddde890c, 0xddde890c, 0x1c955882, 0x8ccca647, 0x8ccca647, 0x1c955882, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xccb8f998, 0x89af656f, 0xccb8f998, 0x8aa609c, 0x4d266f7a, 0x4d266f7a, 0x863eb372, 0x863eb372, 0x863eb372, 0x6049a8cd, 0x6049a8cd, 0x6049a8cd, 0xf870fc5d, 0xf870fc5d, 0xf870fc5d, 0x4d266f7a, 0x8aa609c, 0x8aa609c, 0x4d266f7a, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xa3bd882a, 0x5adc164, 0xa3bd882a, 0x3f4989cd, 0x1ed9d731, 0x1ed9d731, 0x46a1472c, 0x46a1472c, 0x46a1472c, 0xe8c559e9, 0xe8c559e9, 0xe8c559e9, 0xcbac485f, 0xcbac485f, 0xcbac485f, 0x1ed9d731, 0x3f4989cd, 0x3f4989cd, 0x1ed9d731, }, 20 }, - { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x8bbe1e38, 0xfef8974b, 0x8bbe1e38, 0xdba6ba96, 0x9813a416, 0x9813a416, 0xdf1a19a3, 0xdf1a19a3, 0xdf1a19a3, 0x4ec19f90, 0x4ec19f90, 0x4ec19f90, 0xd2b46a52, 0xd2b46a52, 0xd2b46a52, 0x9813a416, 0xdba6ba96, 0xdba6ba96, 0x9813a416, }, 20 }, - { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xda045c37, 0xb8ae26e3, 0xda045c37, 0xe0ce8dcd, 0x5fcf013d, 0x5fcf013d, 0xee7a1c7, 0xee7a1c7, 0xee7a1c7, 0xdcf7b9b1, 0xdcf7b9b1, 0xdcf7b9b1, 0xc3dc384c, 0xc3dc384c, 0xc3dc384c, 0x5fcf013d, 0xe0ce8dcd, 0xe0ce8dcd, 0x5fcf013d, }, 20 }, - { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2e35339d, 0x798918b, 0x2e35339d, 0x4e4697f7, 0xdd28f52b, 0xdd28f52b, 0x92c68d60, 0x92c68d60, 0x92c68d60, 0xb3fa7484, 0xb3fa7484, 0xb3fa7484, 0xa98b1715, 0xa98b1715, 0xa98b1715, 0xdd28f52b, 0x4e4697f7, 0x4e4697f7, 0xdd28f52b, }, 20 }, - { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xef4073b7, 0x7c0ec717, 0xef4073b7, 0xacb6bef0, 0x59c36f00, 0x59c36f00, 0x1b206d14, 0x1b206d14, 0x1b206d14, 0x65a00072, 0x65a00072, 0x65a00072, 0xa6823dbf, 0xa6823dbf, 0xa6823dbf, 0x59c36f00, 0xacb6bef0, 0xacb6bef0, 0x59c36f00, }, 20 }, - { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x439c3f9c, 0xb979a570, 0x439c3f9c, 0x6d99bae3, 0xaa4593fe, 0xaa4593fe, 0x7c7873ca, 0x7c7873ca, 0x7c7873ca, 0xda8d7ead, 0xda8d7ead, 0xda8d7ead, 0x582a9cc6, 0x582a9cc6, 0x582a9cc6, 0xaa4593fe, 0x6d99bae3, 0x6d99bae3, 0xaa4593fe, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ba2c945, 0x8734093, 0x5ba2c945, 0x6b5a4c1, 0xc9cbf769, 0xc9cbf769, 0xa3843a5a, 0xa3843a5a, 0xa3843a5a, 0x5d5cfb96, 0x5d5cfb96, 0x5d5cfb96, 0xb50a549a, 0xb50a549a, 0xb50a549a, 0xc9cbf769, 0x6b5a4c1, 0x6b5a4c1, 0xc9cbf769, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1d557c7b, 0x8d172abd, 0x1d557c7b, 0x4d4dd8d5, 0x9813a416, 0x9813a416, 0xae45df54, 0xae45df54, 0xae45df54, 0x3f9e5967, 0x3f9e5967, 0x3f9e5967, 0xa3ebaca5, 0xa3ebaca5, 0xa3ebaca5, 0x9813a416, 0x4d4dd8d5, 0x4d4dd8d5, 0x9813a416, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x75e8bbc6, 0x79f972a, 0x75e8bbc6, 0x4f226a3c, 0x5fcf013d, 0x5fcf013d, 0xe1849dd3, 0xe1849dd3, 0xe1849dd3, 0x339485a5, 0x339485a5, 0x339485a5, 0x2cbf0458, 0x2cbf0458, 0x2cbf0458, 0x5fcf013d, 0x4f226a3c, 0x4f226a3c, 0x5fcf013d, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7391ddfb, 0x7d352e1, 0x7391ddfb, 0x13e27991, 0xdd28f52b, 0xdd28f52b, 0x25591550, 0x25591550, 0x25591550, 0x465ecb4, 0x465ecb4, 0x465ecb4, 0x1e148f25, 0x1e148f25, 0x1e148f25, 0xdd28f52b, 0x13e27991, 0x13e27991, 0xdd28f52b, }, 20 }, - { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xc009461b, 0xbaf1821c, 0xc009461b, 0x3e4f4b76, 0x43d1f34, 0x43d1f34, 0x19165017, 0x19165017, 0x19165017, 0x661cf9bf, 0x661cf9bf, 0x661cf9bf, 0x8e3cc096, 0x8e3cc096, 0x8e3cc096, 0x43d1f34, 0x3e4f4b76, 0x3e4f4b76, 0x43d1f34, }, 20 }, - { "gfxterm_ru", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xef4073b7, 0x7c0ec717, 0xef4073b7, 0xacb6bef0, 0x59c36f00, 0x59c36f00, 0x1b206d14, 0x1b206d14, 0x1b206d14, 0x65a00072, 0x65a00072, 0x65a00072, 0xa6823dbf, 0xa6823dbf, 0xa6823dbf, 0x59c36f00, 0xacb6bef0, 0xacb6bef0, 0x59c36f00, }, 20 }, - { "gfxterm_ru", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x439c3f9c, 0xb979a570, 0x439c3f9c, 0x6d99bae3, 0xaa4593fe, 0xaa4593fe, 0x7c7873ca, 0x7c7873ca, 0x7c7873ca, 0xda8d7ead, 0xda8d7ead, 0xda8d7ead, 0x582a9cc6, 0x582a9cc6, 0x582a9cc6, 0xaa4593fe, 0x6d99bae3, 0x6d99bae3, 0xaa4593fe, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x5ba2c945, 0x8734093, 0x5ba2c945, 0x6b5a4c1, 0xc9cbf769, 0xc9cbf769, 0xa3843a5a, 0xa3843a5a, 0xa3843a5a, 0x5d5cfb96, 0x5d5cfb96, 0x5d5cfb96, 0xb50a549a, 0xb50a549a, 0xb50a549a, 0xc9cbf769, 0x6b5a4c1, 0x6b5a4c1, 0xc9cbf769, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xb36b0c97, 0x8089853c, 0xb36b0c97, 0xf760f62b, 0x5387d57f, 0x5387d57f, 0x26a49a0, 0x26a49a0, 0x26a49a0, 0xc233256c, 0xc233256c, 0xc233256c, 0x25eda7fa, 0x25eda7fa, 0x25eda7fa, 0x5387d57f, 0xf760f62b, 0xf760f62b, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x73036285, 0xc9508972, 0x73036285, 0xc96b2f1a, 0xf83ee7aa, 0xf83ee7aa, 0xd1a3be96, 0xd1a3be96, 0xd1a3be96, 0x4dda6e65, 0x4dda6e65, 0x4dda6e65, 0x7569c5cd, 0x7569c5cd, 0x7569c5cd, 0xf83ee7aa, 0xc96b2f1a, 0xc96b2f1a, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x2f903fa3, 0xb074c7d0, 0x2f903fa3, 0x3ee58af6, 0x724366e5, 0x724366e5, 0xd7d194f8, 0xd7d194f8, 0xd7d194f8, 0x90e8d602, 0x90e8d602, 0x90e8d602, 0xfdc6f148, 0xfdc6f148, 0xfdc6f148, 0x724366e5, 0x3ee58af6, 0x3ee58af6, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa54ffd19, 0xf7cc7ac2, 0xa54ffd19, 0x4adb4020, 0x5387d57f, 0x5387d57f, 0x5dbc1d5, 0x5dbc1d5, 0x5dbc1d5, 0xdb158e08, 0xdb158e08, 0xdb158e08, 0x48961c16, 0x48961c16, 0x48961c16, 0x5387d57f, 0x4adb4020, 0x4adb4020, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc66fad35, 0x8aac8190, 0xc66fad35, 0xb7a593d9, 0xf83ee7aa, 0xf83ee7aa, 0xb36d8105, 0xb36d8105, 0xb36d8105, 0xc1b79235, 0xc1b79235, 0xc1b79235, 0xf022c3f3, 0xf022c3f3, 0xf022c3f3, 0xf83ee7aa, 0xb7a593d9, 0xb7a593d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x7f916214, 0x1c80967c, 0x7f916214, 0x8d43e964, 0x724366e5, 0x724366e5, 0xe456696, 0xe456696, 0xe456696, 0x57d595c6, 0x57d595c6, 0x57d595c6, 0x9f62fb84, 0x9f62fb84, 0x9f62fb84, 0x724366e5, 0x8d43e964, 0x8d43e964, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x4aeca683, 0xffbbb38e, 0x4aeca683, 0x4a8c1e25, 0x1c955882, 0x1c955882, 0xa0d2f3f6, 0xa0d2f3f6, 0xa0d2f3f6, 0x6f25be61, 0x6f25be61, 0x6f25be61, 0x914cb274, 0x914cb274, 0x914cb274, 0x1c955882, 0x4a8c1e25, 0x4a8c1e25, 0x1c955882, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb44532a7, 0x73b09a92, 0xb44532a7, 0x7057aba3, 0x4d266f7a, 0x4d266f7a, 0x83606d88, 0x83606d88, 0x83606d88, 0x65177637, 0x65177637, 0x65177637, 0xfd2e22a7, 0xfd2e22a7, 0xfd2e22a7, 0x4d266f7a, 0x7057aba3, 0x7057aba3, 0x4d266f7a, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x62257381, 0xd5d910, 0x62257381, 0xfed17266, 0x1ed9d731, 0x1ed9d731, 0x12670373, 0x12670373, 0x12670373, 0xbc031db6, 0xbc031db6, 0xbc031db6, 0x9f6a0c00, 0x9f6a0c00, 0x9f6a0c00, 0x1ed9d731, 0xfed17266, 0xfed17266, 0x1ed9d731, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xb36b0c97, 0x8089853c, 0xb36b0c97, 0xf760f62b, 0x5387d57f, 0x5387d57f, 0x26a49a0, 0x26a49a0, 0x26a49a0, 0xc233256c, 0xc233256c, 0xc233256c, 0x25eda7fa, 0x25eda7fa, 0x25eda7fa, 0x5387d57f, 0xf760f62b, 0xf760f62b, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x73036285, 0xc9508972, 0x73036285, 0xc96b2f1a, 0xf83ee7aa, 0xf83ee7aa, 0xd1a3be96, 0xd1a3be96, 0xd1a3be96, 0x4dda6e65, 0x4dda6e65, 0x4dda6e65, 0x7569c5cd, 0x7569c5cd, 0x7569c5cd, 0xf83ee7aa, 0xc96b2f1a, 0xc96b2f1a, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x2f903fa3, 0xb074c7d0, 0x2f903fa3, 0x3ee58af6, 0x724366e5, 0x724366e5, 0xd7d194f8, 0xd7d194f8, 0xd7d194f8, 0x90e8d602, 0x90e8d602, 0x90e8d602, 0xfdc6f148, 0xfdc6f148, 0xfdc6f148, 0x724366e5, 0x3ee58af6, 0x3ee58af6, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xa54ffd19, 0xf7cc7ac2, 0xa54ffd19, 0x4adb4020, 0x5387d57f, 0x5387d57f, 0x5dbc1d5, 0x5dbc1d5, 0x5dbc1d5, 0xdb158e08, 0xdb158e08, 0xdb158e08, 0x48961c16, 0x48961c16, 0x48961c16, 0x5387d57f, 0x4adb4020, 0x4adb4020, 0x5387d57f, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc66fad35, 0x8aac8190, 0xc66fad35, 0xb7a593d9, 0xf83ee7aa, 0xf83ee7aa, 0xb36d8105, 0xb36d8105, 0xb36d8105, 0xc1b79235, 0xc1b79235, 0xc1b79235, 0xf022c3f3, 0xf022c3f3, 0xf022c3f3, 0xf83ee7aa, 0xb7a593d9, 0xb7a593d9, 0xf83ee7aa, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x7f916214, 0x1c80967c, 0x7f916214, 0x8d43e964, 0x724366e5, 0x724366e5, 0xe456696, 0xe456696, 0xe456696, 0x57d595c6, 0x57d595c6, 0x57d595c6, 0x9f62fb84, 0x9f62fb84, 0x9f62fb84, 0x724366e5, 0x8d43e964, 0x8d43e964, 0x724366e5, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x4aeca683, 0xffbbb38e, 0x4aeca683, 0x4a8c1e25, 0x1c955882, 0x1c955882, 0xa0d2f3f6, 0xa0d2f3f6, 0xa0d2f3f6, 0x6f25be61, 0x6f25be61, 0x6f25be61, 0x914cb274, 0x914cb274, 0x914cb274, 0x1c955882, 0x4a8c1e25, 0x4a8c1e25, 0x1c955882, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb44532a7, 0x73b09a92, 0xb44532a7, 0x7057aba3, 0x4d266f7a, 0x4d266f7a, 0x83606d88, 0x83606d88, 0x83606d88, 0x65177637, 0x65177637, 0x65177637, 0xfd2e22a7, 0xfd2e22a7, 0xfd2e22a7, 0x4d266f7a, 0x7057aba3, 0x7057aba3, 0x4d266f7a, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x62257381, 0xd5d910, 0x62257381, 0xfed17266, 0x1ed9d731, 0x1ed9d731, 0x12670373, 0x12670373, 0x12670373, 0xbc031db6, 0xbc031db6, 0xbc031db6, 0x9f6a0c00, 0x9f6a0c00, 0x9f6a0c00, 0x1ed9d731, 0xfed17266, 0xfed17266, 0x1ed9d731, }, 20 }, - { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x1d557c7b, 0x8d172abd, 0x1d557c7b, 0x4d4dd8d5, 0x9813a416, 0x9813a416, 0xae45df54, 0xae45df54, 0xae45df54, 0x3f9e5967, 0x3f9e5967, 0x3f9e5967, 0xa3ebaca5, 0xa3ebaca5, 0xa3ebaca5, 0x9813a416, 0x4d4dd8d5, 0x4d4dd8d5, 0x9813a416, }, 20 }, - { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x75e8bbc6, 0x79f972a, 0x75e8bbc6, 0x4f226a3c, 0x5fcf013d, 0x5fcf013d, 0xe1849dd3, 0xe1849dd3, 0xe1849dd3, 0x339485a5, 0x339485a5, 0x339485a5, 0x2cbf0458, 0x2cbf0458, 0x2cbf0458, 0x5fcf013d, 0x4f226a3c, 0x4f226a3c, 0x5fcf013d, }, 20 }, - { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7391ddfb, 0x7d352e1, 0x7391ddfb, 0x13e27991, 0xdd28f52b, 0xdd28f52b, 0x25591550, 0x25591550, 0x25591550, 0x465ecb4, 0x465ecb4, 0x465ecb4, 0x1e148f25, 0x1e148f25, 0x1e148f25, 0xdd28f52b, 0x13e27991, 0x13e27991, 0xdd28f52b, }, 20 }, - { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x371337c9, 0x8aa416bc, 0x371337c9, 0x74e5fa8e, 0x59c36f00, 0x59c36f00, 0xb169e11b, 0xb169e11b, 0xb169e11b, 0xcfe98c7d, 0xcfe98c7d, 0xcfe98c7d, 0xccbb1b0, 0xccbb1b0, 0xccbb1b0, 0x59c36f00, 0x74e5fa8e, 0x74e5fa8e, 0x59c36f00, }, 20 }, - { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x38692869, 0xefb9c2f4, 0x38692869, 0x166cad16, 0xaa4593fe, 0xaa4593fe, 0xe4f03f82, 0xe4f03f82, 0xe4f03f82, 0x420532e5, 0x420532e5, 0x420532e5, 0xc0a2d08e, 0xc0a2d08e, 0xc0a2d08e, 0xaa4593fe, 0x166cad16, 0x166cad16, 0xaa4593fe, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x7eb7ddfd, 0x19db9bb1, 0x7eb7ddfd, 0x23a0b079, 0xc9cbf769, 0xc9cbf769, 0x4500ac91, 0x4500ac91, 0x4500ac91, 0xbbd86d5d, 0xbbd86d5d, 0xbbd86d5d, 0x538ec251, 0x538ec251, 0x538ec251, 0xc9cbf769, 0x23a0b079, 0x23a0b079, 0xc9cbf769, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x35512c6d, 0xe29deaf0, 0x35512c6d, 0x654988c3, 0x9813a416, 0x9813a416, 0xc6920c94, 0xc6920c94, 0xc6920c94, 0x57498aa7, 0x57498aa7, 0x57498aa7, 0xcb3c7f65, 0xcb3c7f65, 0xcb3c7f65, 0x9813a416, 0x654988c3, 0x654988c3, 0x9813a416, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x73ff9071, 0x72b83f24, 0x73ff9071, 0x4935418b, 0x5fcf013d, 0x5fcf013d, 0x9963ff63, 0x9963ff63, 0x9963ff63, 0x4b73e715, 0x4b73e715, 0x4b73e715, 0x545866e8, 0x545866e8, 0x545866e8, 0x5fcf013d, 0x4935418b, 0x4935418b, 0x5fcf013d, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x46811b4e, 0xa463f7aa, 0x46811b4e, 0x26f2bf24, 0xdd28f52b, 0xdd28f52b, 0x452cf740, 0x452cf740, 0x452cf740, 0x64100ea4, 0x64100ea4, 0x64100ea4, 0x7e616d35, 0x7e616d35, 0x7e616d35, 0xdd28f52b, 0x26f2bf24, 0x26f2bf24, 0xdd28f52b, }, 20 }, - { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xd89b7256, 0xe60a4e85, 0xd89b7256, 0x26dd7f3b, 0x43d1f34, 0x43d1f34, 0x55b946c0, 0x55b946c0, 0x55b946c0, 0x2ab3ef68, 0x2ab3ef68, 0x2ab3ef68, 0xc293d641, 0xc293d641, 0xc293d641, 0x43d1f34, 0x26dd7f3b, 0x26dd7f3b, 0x43d1f34, }, 20 }, - { "gfxterm_fr", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x371337c9, 0x8aa416bc, 0x371337c9, 0x74e5fa8e, 0x59c36f00, 0x59c36f00, 0xb169e11b, 0xb169e11b, 0xb169e11b, 0xcfe98c7d, 0xcfe98c7d, 0xcfe98c7d, 0xccbb1b0, 0xccbb1b0, 0xccbb1b0, 0x59c36f00, 0x74e5fa8e, 0x74e5fa8e, 0x59c36f00, }, 20 }, - { "gfxterm_fr", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x38692869, 0xefb9c2f4, 0x38692869, 0x166cad16, 0xaa4593fe, 0xaa4593fe, 0xe4f03f82, 0xe4f03f82, 0xe4f03f82, 0x420532e5, 0x420532e5, 0x420532e5, 0xc0a2d08e, 0xc0a2d08e, 0xc0a2d08e, 0xaa4593fe, 0x166cad16, 0x166cad16, 0xaa4593fe, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x7eb7ddfd, 0x19db9bb1, 0x7eb7ddfd, 0x23a0b079, 0xc9cbf769, 0xc9cbf769, 0x4500ac91, 0x4500ac91, 0x4500ac91, 0xbbd86d5d, 0xbbd86d5d, 0xbbd86d5d, 0x538ec251, 0x538ec251, 0x538ec251, 0xc9cbf769, 0x23a0b079, 0x23a0b079, 0xc9cbf769, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0x60f63dde, 0xcb069f7a, 0x60f63dde, 0x24fdc762, 0x5387d57f, 0x5387d57f, 0xf5998b00, 0xf5998b00, 0xf5998b00, 0x35c0e7cc, 0x35c0e7cc, 0x35c0e7cc, 0xd21e655a, 0xd21e655a, 0xd21e655a, 0x5387d57f, 0x24fdc762, 0x24fdc762, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8fa5f86d, 0xed066d2c, 0x8fa5f86d, 0x35cdb5f2, 0xf83ee7aa, 0xf83ee7aa, 0x26e9dc45, 0x26e9dc45, 0x26e9dc45, 0xba900cb6, 0xba900cb6, 0xba900cb6, 0x8223a71e, 0x8223a71e, 0x8223a71e, 0xf83ee7aa, 0x35cdb5f2, 0x35cdb5f2, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xf3ebce27, 0x64821e83, 0xf3ebce27, 0xe29e7b72, 0x724366e5, 0x724366e5, 0xf2920fc5, 0xf2920fc5, 0xf2920fc5, 0xb5ab4d3f, 0xb5ab4d3f, 0xb5ab4d3f, 0xd8856a75, 0xd8856a75, 0xd8856a75, 0x724366e5, 0xe29e7b72, 0xe29e7b72, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xda2165d2, 0x5f811c6d, 0xda2165d2, 0x35b5d8eb, 0x5387d57f, 0x5387d57f, 0xe5a2fdfd, 0xe5a2fdfd, 0xe5a2fdfd, 0x3b6cb220, 0x3b6cb220, 0x3b6cb220, 0xa8ef203e, 0xa8ef203e, 0xa8ef203e, 0x5387d57f, 0x35b5d8eb, 0x35b5d8eb, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf52ba155, 0x4866b5cd, 0xf52ba155, 0x84e19fb9, 0xf83ee7aa, 0xf83ee7aa, 0xc1a44e99, 0xc1a44e99, 0xc1a44e99, 0xb37e5da9, 0xb37e5da9, 0xb37e5da9, 0x82eb0c6f, 0x82eb0c6f, 0x82eb0c6f, 0xf83ee7aa, 0x84e19fb9, 0x84e19fb9, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x16d37834, 0x72eb8d00, 0x16d37834, 0xe401f344, 0x724366e5, 0x724366e5, 0xc80f0332, 0xc80f0332, 0xc80f0332, 0x919ff062, 0x919ff062, 0x919ff062, 0x59289e20, 0x59289e20, 0x59289e20, 0x724366e5, 0xe401f344, 0xe401f344, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x501ed137, 0x3eb913d3, 0x501ed137, 0x507e6991, 0x1c955882, 0x1c955882, 0xc988465d, 0xc988465d, 0xc988465d, 0x67f0bca, 0x67f0bca, 0x67f0bca, 0xf81607df, 0xf81607df, 0xf81607df, 0x1c955882, 0x507e6991, 0x507e6991, 0x1c955882, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xdbf45ff0, 0x4b12f903, 0xdbf45ff0, 0x1fe6c6f4, 0x4d266f7a, 0x4d266f7a, 0xee77b36d, 0xee77b36d, 0xee77b36d, 0x800a8d2, 0x800a8d2, 0x800a8d2, 0x9039fc42, 0x9039fc42, 0x9039fc42, 0x4d266f7a, 0x1fe6c6f4, 0x1fe6c6f4, 0x4d266f7a, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x6c3a9814, 0xaa19882a, 0x6c3a9814, 0xf0ce99f3, 0x1ed9d731, 0x1ed9d731, 0x5819ad52, 0x5819ad52, 0x5819ad52, 0xf67db397, 0xf67db397, 0xf67db397, 0xd514a221, 0xd514a221, 0xd514a221, 0x1ed9d731, 0xf0ce99f3, 0xf0ce99f3, 0x1ed9d731, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x60f63dde, 0xcb069f7a, 0x60f63dde, 0x24fdc762, 0x5387d57f, 0x5387d57f, 0xf5998b00, 0xf5998b00, 0xf5998b00, 0x35c0e7cc, 0x35c0e7cc, 0x35c0e7cc, 0xd21e655a, 0xd21e655a, 0xd21e655a, 0x5387d57f, 0x24fdc762, 0x24fdc762, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8fa5f86d, 0xed066d2c, 0x8fa5f86d, 0x35cdb5f2, 0xf83ee7aa, 0xf83ee7aa, 0x26e9dc45, 0x26e9dc45, 0x26e9dc45, 0xba900cb6, 0xba900cb6, 0xba900cb6, 0x8223a71e, 0x8223a71e, 0x8223a71e, 0xf83ee7aa, 0x35cdb5f2, 0x35cdb5f2, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xf3ebce27, 0x64821e83, 0xf3ebce27, 0xe29e7b72, 0x724366e5, 0x724366e5, 0xf2920fc5, 0xf2920fc5, 0xf2920fc5, 0xb5ab4d3f, 0xb5ab4d3f, 0xb5ab4d3f, 0xd8856a75, 0xd8856a75, 0xd8856a75, 0x724366e5, 0xe29e7b72, 0xe29e7b72, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xda2165d2, 0x5f811c6d, 0xda2165d2, 0x35b5d8eb, 0x5387d57f, 0x5387d57f, 0xe5a2fdfd, 0xe5a2fdfd, 0xe5a2fdfd, 0x3b6cb220, 0x3b6cb220, 0x3b6cb220, 0xa8ef203e, 0xa8ef203e, 0xa8ef203e, 0x5387d57f, 0x35b5d8eb, 0x35b5d8eb, 0x5387d57f, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf52ba155, 0x4866b5cd, 0xf52ba155, 0x84e19fb9, 0xf83ee7aa, 0xf83ee7aa, 0xc1a44e99, 0xc1a44e99, 0xc1a44e99, 0xb37e5da9, 0xb37e5da9, 0xb37e5da9, 0x82eb0c6f, 0x82eb0c6f, 0x82eb0c6f, 0xf83ee7aa, 0x84e19fb9, 0x84e19fb9, 0xf83ee7aa, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x16d37834, 0x72eb8d00, 0x16d37834, 0xe401f344, 0x724366e5, 0x724366e5, 0xc80f0332, 0xc80f0332, 0xc80f0332, 0x919ff062, 0x919ff062, 0x919ff062, 0x59289e20, 0x59289e20, 0x59289e20, 0x724366e5, 0xe401f344, 0xe401f344, 0x724366e5, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x501ed137, 0x3eb913d3, 0x501ed137, 0x507e6991, 0x1c955882, 0x1c955882, 0xc988465d, 0xc988465d, 0xc988465d, 0x67f0bca, 0x67f0bca, 0x67f0bca, 0xf81607df, 0xf81607df, 0xf81607df, 0x1c955882, 0x507e6991, 0x507e6991, 0x1c955882, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xdbf45ff0, 0x4b12f903, 0xdbf45ff0, 0x1fe6c6f4, 0x4d266f7a, 0x4d266f7a, 0xee77b36d, 0xee77b36d, 0xee77b36d, 0x800a8d2, 0x800a8d2, 0x800a8d2, 0x9039fc42, 0x9039fc42, 0x9039fc42, 0x4d266f7a, 0x1fe6c6f4, 0x1fe6c6f4, 0x4d266f7a, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x6c3a9814, 0xaa19882a, 0x6c3a9814, 0xf0ce99f3, 0x1ed9d731, 0x1ed9d731, 0x5819ad52, 0x5819ad52, 0x5819ad52, 0xf67db397, 0xf67db397, 0xf67db397, 0xd514a221, 0xd514a221, 0xd514a221, 0x1ed9d731, 0xf0ce99f3, 0xf0ce99f3, 0x1ed9d731, }, 20 }, - { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x35512c6d, 0xe29deaf0, 0x35512c6d, 0x654988c3, 0x9813a416, 0x9813a416, 0xc6920c94, 0xc6920c94, 0xc6920c94, 0x57498aa7, 0x57498aa7, 0x57498aa7, 0xcb3c7f65, 0xcb3c7f65, 0xcb3c7f65, 0x9813a416, 0x654988c3, 0x654988c3, 0x9813a416, }, 20 }, - { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x73ff9071, 0x72b83f24, 0x73ff9071, 0x4935418b, 0x5fcf013d, 0x5fcf013d, 0x9963ff63, 0x9963ff63, 0x9963ff63, 0x4b73e715, 0x4b73e715, 0x4b73e715, 0x545866e8, 0x545866e8, 0x545866e8, 0x5fcf013d, 0x4935418b, 0x4935418b, 0x5fcf013d, }, 20 }, - { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x46811b4e, 0xa463f7aa, 0x46811b4e, 0x26f2bf24, 0xdd28f52b, 0xdd28f52b, 0x452cf740, 0x452cf740, 0x452cf740, 0x64100ea4, 0x64100ea4, 0x64100ea4, 0x7e616d35, 0x7e616d35, 0x7e616d35, 0xdd28f52b, 0x26f2bf24, 0x26f2bf24, 0xdd28f52b, }, 20 }, - { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x791b97c6, 0xd80a4dd5, 0x791b97c6, 0x3aed5a81, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x3aed5a81, 0x3aed5a81, 0x59c36f00, }, 20 }, - { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x6c6b27f2, 0x9ad8591c, 0x6c6b27f2, 0x426ea28d, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0x426ea28d, 0x426ea28d, 0xaa4593fe, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb553210b, 0xf9eb9fa4, 0xb553210b, 0xe8444c8f, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0xe8444c8f, 0xe8444c8f, 0xc9cbf769, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x979d71de, 0x73e38996, 0x979d71de, 0xc785d570, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0xc785d570, 0xc785d570, 0x9813a416, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x78d87f9d, 0x345e385f, 0x78d87f9d, 0x4212ae67, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x4212ae67, 0x4212ae67, 0x5fcf013d, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x750f8146, 0x2148bdae, 0x750f8146, 0x157c252c, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x157c252c, 0x157c252c, 0xdd28f52b, }, 20 }, - { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x58828a1e, 0x11d1547e, 0x58828a1e, 0xa6c48773, 0x43d1f34, 0x43d1f34, 0xd204ac75, 0xd204ac75, 0xd204ac75, 0xad0e05dd, 0xad0e05dd, 0xad0e05dd, 0x452e3cf4, 0x452e3cf4, 0x452e3cf4, 0x43d1f34, 0xa6c48773, 0xa6c48773, 0x43d1f34, }, 20 }, - { "gfxterm_quot", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x791b97c6, 0xd80a4dd5, 0x791b97c6, 0x3aed5a81, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x3aed5a81, 0x3aed5a81, 0x59c36f00, }, 20 }, - { "gfxterm_quot", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x6c6b27f2, 0x9ad8591c, 0x6c6b27f2, 0x426ea28d, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0x426ea28d, 0x426ea28d, 0xaa4593fe, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xb553210b, 0xf9eb9fa4, 0xb553210b, 0xe8444c8f, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0xe8444c8f, 0xe8444c8f, 0xc9cbf769, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe0300e88, 0x76ba1dd0, 0xe0300e88, 0xa43bf434, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xa43bf434, 0xa43bf434, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa26081d9, 0xef5b1078, 0xa26081d9, 0x1808cc46, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x1808cc46, 0x1808cc46, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x6f16d50f, 0x2fc71082, 0x6f16d50f, 0x7e63605a, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x7e63605a, 0x7e63605a, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xc959920b, 0x3548d7d5, 0xc959920b, 0x26cd2f32, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0x26cd2f32, 0x26cd2f32, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x93c26040, 0x70ae777c, 0x93c26040, 0xe2085eac, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xe2085eac, 0xe2085eac, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x73b37a76, 0x352c8931, 0x73b37a76, 0x8161f106, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0x8161f106, 0x8161f106, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xe12eaf27, 0xe7b5009a, 0xe12eaf27, 0xe14e1781, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0xe14e1781, 0xe14e1781, 0x1c955882, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x5a376c04, 0xd27c4646, 0x5a376c04, 0x9e25f500, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x9e25f500, 0x9e25f500, 0x4d266f7a, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x3f02033b, 0xd99eaa7, 0x3f02033b, 0xa3f602dc, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xa3f602dc, 0xa3f602dc, 0x1ed9d731, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xe0300e88, 0x76ba1dd0, 0xe0300e88, 0xa43bf434, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0xa43bf434, 0xa43bf434, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa26081d9, 0xef5b1078, 0xa26081d9, 0x1808cc46, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x1808cc46, 0x1808cc46, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x6f16d50f, 0x2fc71082, 0x6f16d50f, 0x7e63605a, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x7e63605a, 0x7e63605a, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xc959920b, 0x3548d7d5, 0xc959920b, 0x26cd2f32, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0x26cd2f32, 0x26cd2f32, 0x5387d57f, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x93c26040, 0x70ae777c, 0x93c26040, 0xe2085eac, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xe2085eac, 0xe2085eac, 0xf83ee7aa, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x73b37a76, 0x352c8931, 0x73b37a76, 0x8161f106, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0x8161f106, 0x8161f106, 0x724366e5, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xe12eaf27, 0xe7b5009a, 0xe12eaf27, 0xe14e1781, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0xe14e1781, 0xe14e1781, 0x1c955882, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x5a376c04, 0xd27c4646, 0x5a376c04, 0x9e25f500, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x9e25f500, 0x9e25f500, 0x4d266f7a, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x3f02033b, 0xd99eaa7, 0x3f02033b, 0xa3f602dc, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0xa3f602dc, 0xa3f602dc, 0x1ed9d731, }, 20 }, - { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x979d71de, 0x73e38996, 0x979d71de, 0xc785d570, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0xc785d570, 0xc785d570, 0x9813a416, }, 20 }, - { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x78d87f9d, 0x345e385f, 0x78d87f9d, 0x4212ae67, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x4212ae67, 0x4212ae67, 0x5fcf013d, }, 20 }, - { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x750f8146, 0x2148bdae, 0x750f8146, 0x157c252c, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x157c252c, 0x157c252c, 0xdd28f52b, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xaabbbcdc, 0x5f5dabb0, 0xaabbbcdc, 0xe94d719b, 0x59c36f00, 0x59c36f00, 0x18f47430, 0x18f47430, 0x18f47430, 0x66741956, 0x66741956, 0x66741956, 0xa556249b, 0xa556249b, 0xa556249b, 0x59c36f00, 0xe94d719b, 0xe94d719b, 0x59c36f00, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xb6fa31f0, 0xc274fbe9, 0xb6fa31f0, 0x98ffb48f, 0xaa4593fe, 0xaa4593fe, 0x4fb2120a, 0x4fb2120a, 0x4fb2120a, 0xe9471f6d, 0xe9471f6d, 0xe9471f6d, 0x6be0fd06, 0x6be0fd06, 0x6be0fd06, 0xaa4593fe, 0x98ffb48f, 0x98ffb48f, 0xaa4593fe, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9c83aa67, 0x67876bdc, 0x9c83aa67, 0xc194c7e3, 0xc9cbf769, 0xc9cbf769, 0xd6fd9f4a, 0xd6fd9f4a, 0xd6fd9f4a, 0x28255e86, 0x28255e86, 0x28255e86, 0xc073f18a, 0xc073f18a, 0xc073f18a, 0xc9cbf769, 0xc194c7e3, 0xc194c7e3, 0xc9cbf769, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4878468, 0x58d7f660, 0x4878468, 0x549f20c6, 0x9813a416, 0x9813a416, 0x7c4d228e, 0x7c4d228e, 0x7c4d228e, 0xed96a4bd, 0xed96a4bd, 0xed96a4bd, 0x71e3517f, 0x71e3517f, 0x71e3517f, 0x9813a416, 0x549f20c6, 0x549f20c6, 0x9813a416, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc24f3617, 0xe92e5f60, 0xc24f3617, 0xf885e7ed, 0x5fcf013d, 0x5fcf013d, 0x9a58adbf, 0x9a58adbf, 0x9a58adbf, 0x4848b5c9, 0x4848b5c9, 0x4848b5c9, 0x57633434, 0x57633434, 0x57633434, 0x5fcf013d, 0xf885e7ed, 0xf885e7ed, 0x5fcf013d, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe0056f23, 0xe723a6de, 0xe0056f23, 0x8076cb49, 0xdd28f52b, 0xdd28f52b, 0x7cf3620d, 0x7cf3620d, 0x7cf3620d, 0x5dcf9be9, 0x5dcf9be9, 0x5dcf9be9, 0x47bef878, 0x47bef878, 0x47bef878, 0xdd28f52b, 0x8076cb49, 0x8076cb49, 0xdd28f52b, }, 20 }, - { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x74a1734e, 0x3152f141, 0x74a1734e, 0x8ae77e23, 0x43d1f34, 0x43d1f34, 0x83c19830, 0x83c19830, 0x83c19830, 0xfccb3198, 0xfccb3198, 0xfccb3198, 0x14eb08b1, 0x14eb08b1, 0x14eb08b1, 0x43d1f34, 0x8ae77e23, 0x8ae77e23, 0x43d1f34, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xaabbbcdc, 0x5f5dabb0, 0xaabbbcdc, 0xe94d719b, 0x59c36f00, 0x59c36f00, 0x18f47430, 0x18f47430, 0x18f47430, 0x66741956, 0x66741956, 0x66741956, 0xa556249b, 0xa556249b, 0xa556249b, 0x59c36f00, 0xe94d719b, 0xe94d719b, 0x59c36f00, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0xb6fa31f0, 0xc274fbe9, 0xb6fa31f0, 0x98ffb48f, 0xaa4593fe, 0xaa4593fe, 0x4fb2120a, 0x4fb2120a, 0x4fb2120a, 0xe9471f6d, 0xe9471f6d, 0xe9471f6d, 0x6be0fd06, 0x6be0fd06, 0x6be0fd06, 0xaa4593fe, 0x98ffb48f, 0x98ffb48f, 0xaa4593fe, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x9c83aa67, 0x67876bdc, 0x9c83aa67, 0xc194c7e3, 0xc9cbf769, 0xc9cbf769, 0xd6fd9f4a, 0xd6fd9f4a, 0xd6fd9f4a, 0x28255e86, 0x28255e86, 0x28255e86, 0xc073f18a, 0xc073f18a, 0xc073f18a, 0xc9cbf769, 0xc194c7e3, 0xc194c7e3, 0xc9cbf769, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd63f83a3, 0x3dc5a0b4, 0xd63f83a3, 0x9234791f, 0x5387d57f, 0x5387d57f, 0x4cb03e4e, 0x4cb03e4e, 0x4cb03e4e, 0x8ce95282, 0x8ce95282, 0x8ce95282, 0x6b37d014, 0x6b37d014, 0x6b37d014, 0x5387d57f, 0x9234791f, 0x9234791f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x89626ffa, 0xb4d6175c, 0x89626ffa, 0x330a2265, 0xf83ee7aa, 0xf83ee7aa, 0xbbfb89b5, 0xbbfb89b5, 0xbbfb89b5, 0x27825946, 0x27825946, 0x27825946, 0x1f31f2ee, 0x1f31f2ee, 0x1f31f2ee, 0xf83ee7aa, 0x330a2265, 0x330a2265, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x3df87fc2, 0x8c55d02c, 0x3df87fc2, 0x2c8dca97, 0x724366e5, 0x724366e5, 0x3f06ba55, 0x3f06ba55, 0x3f06ba55, 0x783ff8af, 0x783ff8af, 0x783ff8af, 0x1511dfe5, 0x1511dfe5, 0x1511dfe5, 0x724366e5, 0x2c8dca97, 0x2c8dca97, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0xe39cde76, 0x443930df, 0xe39cde76, 0xc08634f, 0x5387d57f, 0x5387d57f, 0x44754e5f, 0x44754e5f, 0x44754e5f, 0x9abb0182, 0x9abb0182, 0x9abb0182, 0x938939c, 0x938939c, 0x938939c, 0x5387d57f, 0xc08634f, 0xc08634f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa0b7c23d, 0x8cd3be29, 0xa0b7c23d, 0xd17dfcd1, 0xf83ee7aa, 0xf83ee7aa, 0x5feda75, 0x5feda75, 0x5feda75, 0x7724c945, 0x7724c945, 0x7724c945, 0x46b19883, 0x46b19883, 0x46b19883, 0xf83ee7aa, 0xd17dfcd1, 0xd17dfcd1, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0xa994524d, 0xc1900d08, 0xa994524d, 0x5b46d93d, 0x724366e5, 0x724366e5, 0x6d0a4799, 0x6d0a4799, 0x6d0a4799, 0x349ab4c9, 0x349ab4c9, 0x349ab4c9, 0xfc2dda8b, 0xfc2dda8b, 0xfc2dda8b, 0x724366e5, 0x5b46d93d, 0x5b46d93d, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x41755bc6, 0xf207b232, 0x41755bc6, 0x4115e360, 0x1c955882, 0x1c955882, 0x428d20f6, 0x428d20f6, 0x428d20f6, 0x8d7a6d61, 0x8d7a6d61, 0x8d7a6d61, 0x73136174, 0x73136174, 0x73136174, 0x1c955882, 0x4115e360, 0x4115e360, 0x1c955882, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xe47ded44, 0x862f2131, 0xe47ded44, 0x206f7440, 0x4d266f7a, 0x4d266f7a, 0x95d7f079, 0x95d7f079, 0x95d7f079, 0x73a0ebc6, 0x73a0ebc6, 0x73a0ebc6, 0xeb99bf56, 0xeb99bf56, 0xeb99bf56, 0x4d266f7a, 0x206f7440, 0x206f7440, 0x4d266f7a, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x946b2f62, 0x30dad54, 0x946b2f62, 0x89f2e85, 0x1ed9d731, 0x1ed9d731, 0xf20ee132, 0xf20ee132, 0xf20ee132, 0x5c6afff7, 0x5c6afff7, 0x5c6afff7, 0x7f03ee41, 0x7f03ee41, 0x7f03ee41, 0x1ed9d731, 0x89f2e85, 0x89f2e85, 0x1ed9d731, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xd63f83a3, 0x3dc5a0b4, 0xd63f83a3, 0x9234791f, 0x5387d57f, 0x5387d57f, 0x4cb03e4e, 0x4cb03e4e, 0x4cb03e4e, 0x8ce95282, 0x8ce95282, 0x8ce95282, 0x6b37d014, 0x6b37d014, 0x6b37d014, 0x5387d57f, 0x9234791f, 0x9234791f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x89626ffa, 0xb4d6175c, 0x89626ffa, 0x330a2265, 0xf83ee7aa, 0xf83ee7aa, 0xbbfb89b5, 0xbbfb89b5, 0xbbfb89b5, 0x27825946, 0x27825946, 0x27825946, 0x1f31f2ee, 0x1f31f2ee, 0x1f31f2ee, 0xf83ee7aa, 0x330a2265, 0x330a2265, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x3df87fc2, 0x8c55d02c, 0x3df87fc2, 0x2c8dca97, 0x724366e5, 0x724366e5, 0x3f06ba55, 0x3f06ba55, 0x3f06ba55, 0x783ff8af, 0x783ff8af, 0x783ff8af, 0x1511dfe5, 0x1511dfe5, 0x1511dfe5, 0x724366e5, 0x2c8dca97, 0x2c8dca97, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0xe39cde76, 0x443930df, 0xe39cde76, 0xc08634f, 0x5387d57f, 0x5387d57f, 0x44754e5f, 0x44754e5f, 0x44754e5f, 0x9abb0182, 0x9abb0182, 0x9abb0182, 0x938939c, 0x938939c, 0x938939c, 0x5387d57f, 0xc08634f, 0xc08634f, 0x5387d57f, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xa0b7c23d, 0x8cd3be29, 0xa0b7c23d, 0xd17dfcd1, 0xf83ee7aa, 0xf83ee7aa, 0x5feda75, 0x5feda75, 0x5feda75, 0x7724c945, 0x7724c945, 0x7724c945, 0x46b19883, 0x46b19883, 0x46b19883, 0xf83ee7aa, 0xd17dfcd1, 0xd17dfcd1, 0xf83ee7aa, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0xa994524d, 0xc1900d08, 0xa994524d, 0x5b46d93d, 0x724366e5, 0x724366e5, 0x6d0a4799, 0x6d0a4799, 0x6d0a4799, 0x349ab4c9, 0x349ab4c9, 0x349ab4c9, 0xfc2dda8b, 0xfc2dda8b, 0xfc2dda8b, 0x724366e5, 0x5b46d93d, 0x5b46d93d, 0x724366e5, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x41755bc6, 0xf207b232, 0x41755bc6, 0x4115e360, 0x1c955882, 0x1c955882, 0x428d20f6, 0x428d20f6, 0x428d20f6, 0x8d7a6d61, 0x8d7a6d61, 0x8d7a6d61, 0x73136174, 0x73136174, 0x73136174, 0x1c955882, 0x4115e360, 0x4115e360, 0x1c955882, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xe47ded44, 0x862f2131, 0xe47ded44, 0x206f7440, 0x4d266f7a, 0x4d266f7a, 0x95d7f079, 0x95d7f079, 0x95d7f079, 0x73a0ebc6, 0x73a0ebc6, 0x73a0ebc6, 0xeb99bf56, 0xeb99bf56, 0xeb99bf56, 0x4d266f7a, 0x206f7440, 0x206f7440, 0x4d266f7a, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x946b2f62, 0x30dad54, 0x946b2f62, 0x89f2e85, 0x1ed9d731, 0x1ed9d731, 0xf20ee132, 0xf20ee132, 0xf20ee132, 0x5c6afff7, 0x5c6afff7, 0x5c6afff7, 0x7f03ee41, 0x7f03ee41, 0x7f03ee41, 0x1ed9d731, 0x89f2e85, 0x89f2e85, 0x1ed9d731, }, 20 }, - { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x4878468, 0x58d7f660, 0x4878468, 0x549f20c6, 0x9813a416, 0x9813a416, 0x7c4d228e, 0x7c4d228e, 0x7c4d228e, 0xed96a4bd, 0xed96a4bd, 0xed96a4bd, 0x71e3517f, 0x71e3517f, 0x71e3517f, 0x9813a416, 0x549f20c6, 0x549f20c6, 0x9813a416, }, 20 }, - { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xc24f3617, 0xe92e5f60, 0xc24f3617, 0xf885e7ed, 0x5fcf013d, 0x5fcf013d, 0x9a58adbf, 0x9a58adbf, 0x9a58adbf, 0x4848b5c9, 0x4848b5c9, 0x4848b5c9, 0x57633434, 0x57633434, 0x57633434, 0x5fcf013d, 0xf885e7ed, 0xf885e7ed, 0x5fcf013d, }, 20 }, - { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xe0056f23, 0xe723a6de, 0xe0056f23, 0x8076cb49, 0xdd28f52b, 0xdd28f52b, 0x7cf3620d, 0x7cf3620d, 0x7cf3620d, 0x5dcf9be9, 0x5dcf9be9, 0x5dcf9be9, 0x47bef878, 0x47bef878, 0x47bef878, 0xdd28f52b, 0x8076cb49, 0x8076cb49, 0xdd28f52b, }, 20 }, - { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x5ee30ef2, 0xcb34e9e1, 0x5ee30ef2, 0x1d15c3b5, 0x59c36f00, 0x59c36f00, 0x201d9661, 0x201d9661, 0x201d9661, 0x5e9dfb07, 0x5e9dfb07, 0x5e9dfb07, 0x9dbfc6ca, 0x9dbfc6ca, 0x9dbfc6ca, 0x59c36f00, 0x1d15c3b5, 0x1d15c3b5, 0x59c36f00, }, 20 }, - { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x8f30caea, 0xabe72645, 0x8f30caea, 0xa1354f95, 0xaa4593fe, 0xaa4593fe, 0xe17bf494, 0xe17bf494, 0xe17bf494, 0x478ef9f3, 0x478ef9f3, 0x478ef9f3, 0xc5291b98, 0xc5291b98, 0xc5291b98, 0xaa4593fe, 0xa1354f95, 0xa1354f95, 0xaa4593fe, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x3a734c3, 0x18bd52c, 0x3a734c3, 0x5eb05947, 0xc9cbf769, 0xc9cbf769, 0x128d62c1, 0x128d62c1, 0x128d62c1, 0xec55a30d, 0xec55a30d, 0xec55a30d, 0x4030c01, 0x4030c01, 0x4030c01, 0xc9cbf769, 0x5eb05947, 0x5eb05947, 0xc9cbf769, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x34a86f24, 0xfae0384, 0x34a86f24, 0x64b0cb8a, 0x9813a416, 0x9813a416, 0x13b7fe00, 0x13b7fe00, 0x13b7fe00, 0x826c7833, 0x826c7833, 0x826c7833, 0x1e198df1, 0x1e198df1, 0x1e198df1, 0x9813a416, 0x64b0cb8a, 0x64b0cb8a, 0x9813a416, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7cf1a92b, 0x413f2fa3, 0x7cf1a92b, 0x463b78d1, 0x5fcf013d, 0x5fcf013d, 0x4f98bcd5, 0x4f98bcd5, 0x4f98bcd5, 0x9d88a4a3, 0x9d88a4a3, 0x9d88a4a3, 0x82a3255e, 0x82a3255e, 0x82a3255e, 0x5fcf013d, 0x463b78d1, 0x463b78d1, 0x5fcf013d, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7d24f50c, 0x85834892, 0x7d24f50c, 0x1d575166, 0xdd28f52b, 0xdd28f52b, 0x167fd4de, 0x167fd4de, 0x167fd4de, 0x37432d3a, 0x37432d3a, 0x37432d3a, 0x2d324eab, 0x2d324eab, 0x2d324eab, 0xdd28f52b, 0x1d575166, 0x1d575166, 0xdd28f52b, }, 20 }, - { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x505523f2, 0x24d00e51, 0x505523f2, 0xae132e9f, 0x43d1f34, 0x43d1f34, 0xcaaadc5e, 0xcaaadc5e, 0xcaaadc5e, 0xb5a075f6, 0xb5a075f6, 0xb5a075f6, 0x5d804cdf, 0x5d804cdf, 0x5d804cdf, 0x43d1f34, 0xae132e9f, 0xae132e9f, 0x43d1f34, }, 20 }, - { "gfxterm_ch", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0x5ee30ef2, 0xcb34e9e1, 0x5ee30ef2, 0x1d15c3b5, 0x59c36f00, 0x59c36f00, 0x201d9661, 0x201d9661, 0x201d9661, 0x5e9dfb07, 0x5e9dfb07, 0x5e9dfb07, 0x9dbfc6ca, 0x9dbfc6ca, 0x9dbfc6ca, 0x59c36f00, 0x1d15c3b5, 0x1d15c3b5, 0x59c36f00, }, 20 }, - { "gfxterm_ch", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x8f30caea, 0xabe72645, 0x8f30caea, 0xa1354f95, 0xaa4593fe, 0xaa4593fe, 0xe17bf494, 0xe17bf494, 0xe17bf494, 0x478ef9f3, 0x478ef9f3, 0x478ef9f3, 0xc5291b98, 0xc5291b98, 0xc5291b98, 0xaa4593fe, 0xa1354f95, 0xa1354f95, 0xaa4593fe, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x3a734c3, 0x18bd52c, 0x3a734c3, 0x5eb05947, 0xc9cbf769, 0xc9cbf769, 0x128d62c1, 0x128d62c1, 0x128d62c1, 0xec55a30d, 0xec55a30d, 0xec55a30d, 0x4030c01, 0x4030c01, 0x4030c01, 0xc9cbf769, 0x5eb05947, 0x5eb05947, 0xc9cbf769, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeba6cfbb, 0xcfb5c41c, 0xeba6cfbb, 0xafad3507, 0x5387d57f, 0x5387d57f, 0x71f3f018, 0x71f3f018, 0x71f3f018, 0xb1aa9cd4, 0xb1aa9cd4, 0xb1aa9cd4, 0x56741e42, 0x56741e42, 0x56741e42, 0x5387d57f, 0xafad3507, 0xafad3507, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x9003ad29, 0xb92d2c38, 0x9003ad29, 0x2a6be0b6, 0xf83ee7aa, 0xf83ee7aa, 0x49d26800, 0x49d26800, 0x49d26800, 0xd5abb8f3, 0xd5abb8f3, 0xd5abb8f3, 0xed18135b, 0xed18135b, 0xed18135b, 0xf83ee7aa, 0x2a6be0b6, 0x2a6be0b6, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x238c7b12, 0x2eefc892, 0x238c7b12, 0x32f9ce47, 0x724366e5, 0x724366e5, 0x3d1942f9, 0x3d1942f9, 0x3d1942f9, 0x7a200003, 0x7a200003, 0x7a200003, 0x170e2749, 0x170e2749, 0x170e2749, 0x724366e5, 0x32f9ce47, 0x32f9ce47, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9e1c123, 0xa92b0ab6, 0x9e1c123, 0xe6757c1a, 0x5387d57f, 0x5387d57f, 0xa443a74a, 0xa443a74a, 0xa443a74a, 0x7a8de897, 0x7a8de897, 0x7a8de897, 0xe90e7a89, 0xe90e7a89, 0xe90e7a89, 0x5387d57f, 0xe6757c1a, 0xe6757c1a, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xabb151dd, 0xfa21aa13, 0xabb151dd, 0xda7b6f31, 0xf83ee7aa, 0xf83ee7aa, 0x9d6ae4fd, 0x9d6ae4fd, 0x9d6ae4fd, 0xefb0f7cd, 0xefb0f7cd, 0xefb0f7cd, 0xde25a60b, 0xde25a60b, 0xde25a60b, 0xf83ee7aa, 0xda7b6f31, 0xda7b6f31, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x6dd9406d, 0xde872977, 0x6dd9406d, 0x9f0bcb1d, 0x724366e5, 0x724366e5, 0x8b3051ad, 0x8b3051ad, 0x8b3051ad, 0xd2a0a2fd, 0xd2a0a2fd, 0xd2a0a2fd, 0x1a17ccbf, 0x1a17ccbf, 0x1a17ccbf, 0x724366e5, 0x9f0bcb1d, 0x9f0bcb1d, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x397d3da2, 0xeb896cf, 0x397d3da2, 0x391d8504, 0x1c955882, 0x1c955882, 0x16aa0778, 0x16aa0778, 0x16aa0778, 0xd95d4aef, 0xd95d4aef, 0xd95d4aef, 0x273446fa, 0x273446fa, 0x273446fa, 0x1c955882, 0x391d8504, 0x391d8504, 0x1c955882, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb4b2e2fa, 0x74314de8, 0xb4b2e2fa, 0x70a07bfe, 0x4d266f7a, 0x4d266f7a, 0xe69c42f4, 0xe69c42f4, 0xe69c42f4, 0xeb594b, 0xeb594b, 0xeb594b, 0x98d20ddb, 0x98d20ddb, 0x98d20ddb, 0x4d266f7a, 0x70a07bfe, 0x70a07bfe, 0x4d266f7a, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xd2db665c, 0xcb12d20c, 0xd2db665c, 0x4e2f67bb, 0x1ed9d731, 0x1ed9d731, 0x1952ab15, 0x1952ab15, 0x1952ab15, 0xb736b5d0, 0xb736b5d0, 0xb736b5d0, 0x945fa466, 0x945fa466, 0x945fa466, 0x1ed9d731, 0x4e2f67bb, 0x4e2f67bb, 0x1ed9d731, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xeba6cfbb, 0xcfb5c41c, 0xeba6cfbb, 0xafad3507, 0x5387d57f, 0x5387d57f, 0x71f3f018, 0x71f3f018, 0x71f3f018, 0xb1aa9cd4, 0xb1aa9cd4, 0xb1aa9cd4, 0x56741e42, 0x56741e42, 0x56741e42, 0x5387d57f, 0xafad3507, 0xafad3507, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x9003ad29, 0xb92d2c38, 0x9003ad29, 0x2a6be0b6, 0xf83ee7aa, 0xf83ee7aa, 0x49d26800, 0x49d26800, 0x49d26800, 0xd5abb8f3, 0xd5abb8f3, 0xd5abb8f3, 0xed18135b, 0xed18135b, 0xed18135b, 0xf83ee7aa, 0x2a6be0b6, 0x2a6be0b6, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x238c7b12, 0x2eefc892, 0x238c7b12, 0x32f9ce47, 0x724366e5, 0x724366e5, 0x3d1942f9, 0x3d1942f9, 0x3d1942f9, 0x7a200003, 0x7a200003, 0x7a200003, 0x170e2749, 0x170e2749, 0x170e2749, 0x724366e5, 0x32f9ce47, 0x32f9ce47, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x9e1c123, 0xa92b0ab6, 0x9e1c123, 0xe6757c1a, 0x5387d57f, 0x5387d57f, 0xa443a74a, 0xa443a74a, 0xa443a74a, 0x7a8de897, 0x7a8de897, 0x7a8de897, 0xe90e7a89, 0xe90e7a89, 0xe90e7a89, 0x5387d57f, 0xe6757c1a, 0xe6757c1a, 0x5387d57f, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xabb151dd, 0xfa21aa13, 0xabb151dd, 0xda7b6f31, 0xf83ee7aa, 0xf83ee7aa, 0x9d6ae4fd, 0x9d6ae4fd, 0x9d6ae4fd, 0xefb0f7cd, 0xefb0f7cd, 0xefb0f7cd, 0xde25a60b, 0xde25a60b, 0xde25a60b, 0xf83ee7aa, 0xda7b6f31, 0xda7b6f31, 0xf83ee7aa, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x6dd9406d, 0xde872977, 0x6dd9406d, 0x9f0bcb1d, 0x724366e5, 0x724366e5, 0x8b3051ad, 0x8b3051ad, 0x8b3051ad, 0xd2a0a2fd, 0xd2a0a2fd, 0xd2a0a2fd, 0x1a17ccbf, 0x1a17ccbf, 0x1a17ccbf, 0x724366e5, 0x9f0bcb1d, 0x9f0bcb1d, 0x724366e5, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0x397d3da2, 0xeb896cf, 0x397d3da2, 0x391d8504, 0x1c955882, 0x1c955882, 0x16aa0778, 0x16aa0778, 0x16aa0778, 0xd95d4aef, 0xd95d4aef, 0xd95d4aef, 0x273446fa, 0x273446fa, 0x273446fa, 0x1c955882, 0x391d8504, 0x391d8504, 0x1c955882, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb4b2e2fa, 0x74314de8, 0xb4b2e2fa, 0x70a07bfe, 0x4d266f7a, 0x4d266f7a, 0xe69c42f4, 0xe69c42f4, 0xe69c42f4, 0xeb594b, 0xeb594b, 0xeb594b, 0x98d20ddb, 0x98d20ddb, 0x98d20ddb, 0x4d266f7a, 0x70a07bfe, 0x70a07bfe, 0x4d266f7a, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xd2db665c, 0xcb12d20c, 0xd2db665c, 0x4e2f67bb, 0x1ed9d731, 0x1ed9d731, 0x1952ab15, 0x1952ab15, 0x1952ab15, 0xb736b5d0, 0xb736b5d0, 0xb736b5d0, 0x945fa466, 0x945fa466, 0x945fa466, 0x1ed9d731, 0x4e2f67bb, 0x4e2f67bb, 0x1ed9d731, }, 20 }, - { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0x34a86f24, 0xfae0384, 0x34a86f24, 0x64b0cb8a, 0x9813a416, 0x9813a416, 0x13b7fe00, 0x13b7fe00, 0x13b7fe00, 0x826c7833, 0x826c7833, 0x826c7833, 0x1e198df1, 0x1e198df1, 0x1e198df1, 0x9813a416, 0x64b0cb8a, 0x64b0cb8a, 0x9813a416, }, 20 }, - { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7cf1a92b, 0x413f2fa3, 0x7cf1a92b, 0x463b78d1, 0x5fcf013d, 0x5fcf013d, 0x4f98bcd5, 0x4f98bcd5, 0x4f98bcd5, 0x9d88a4a3, 0x9d88a4a3, 0x9d88a4a3, 0x82a3255e, 0x82a3255e, 0x82a3255e, 0x5fcf013d, 0x463b78d1, 0x463b78d1, 0x5fcf013d, }, 20 }, - { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7d24f50c, 0x85834892, 0x7d24f50c, 0x1d575166, 0xdd28f52b, 0xdd28f52b, 0x167fd4de, 0x167fd4de, 0x167fd4de, 0x37432d3a, 0x37432d3a, 0x37432d3a, 0x2d324eab, 0x2d324eab, 0x2d324eab, 0xdd28f52b, 0x1d575166, 0x1d575166, 0xdd28f52b, }, 20 }, - { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa64abc46, 0x75b6655, 0xa64abc46, 0x8ab5be58, 0x59c36f00, 0x59c36f00, 0xa119c4f4, 0xa119c4f4, 0xa119c4f4, 0xdf99a992, 0xdf99a992, 0xdf99a992, 0x1cbb945f, 0x1cbb945f, 0x1cbb945f, 0x59c36f00, 0x8ab5be58, 0x8ab5be58, 0x59c36f00, }, 20 }, - { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x58be41e7, 0xae0d3f09, 0x58be41e7, 0xda7a6cbf, 0xaa4593fe, 0xaa4593fe, 0x794b67, 0x794b67, 0x794b67, 0xa68c4600, 0xa68c4600, 0xa68c4600, 0x242ba46b, 0x242ba46b, 0x242ba46b, 0xaa4593fe, 0xda7a6cbf, 0xda7a6cbf, 0xaa4593fe, }, 20 }, - { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xaaa4d3ad, 0xe61c6d02, 0xaaa4d3ad, 0xff557024, 0xc9cbf769, 0xc9cbf769, 0x780542e8, 0x780542e8, 0x780542e8, 0x86dd8324, 0x86dd8324, 0x86dd8324, 0x6e8b2c28, 0x6e8b2c28, 0x6e8b2c28, 0xc9cbf769, 0xff557024, 0xff557024, 0xc9cbf769, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf168f0ba, 0x151608f2, 0xf168f0ba, 0x1f8e266b, 0x9813a416, 0x9813a416, 0x358d1fb0, 0x358d1fb0, 0x358d1fb0, 0xa4569983, 0xa4569983, 0xa4569983, 0x38236c41, 0x38236c41, 0x38236c41, 0x9813a416, 0x1f8e266b, 0x1f8e266b, 0x9813a416, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x927c4cf9, 0xdefa0b3b, 0x927c4cf9, 0x64636a93, 0x5fcf013d, 0x5fcf013d, 0xae2ee3eb, 0xae2ee3eb, 0xae2ee3eb, 0x7c3efb9d, 0x7c3efb9d, 0x7c3efb9d, 0x63157a60, 0x63157a60, 0x63157a60, 0x5fcf013d, 0x64636a93, 0x64636a93, 0x5fcf013d, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x2d254926, 0x796275ce, 0x2d254926, 0x17c0c9cb, 0xdd28f52b, 0xdd28f52b, 0x79439443, 0x79439443, 0x79439443, 0x587f6da7, 0x587f6da7, 0x587f6da7, 0x420e0e36, 0x420e0e36, 0x420e0e36, 0xdd28f52b, 0x17c0c9cb, 0x17c0c9cb, 0xdd28f52b, }, 20 }, - { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x755377f, 0x4e06e91f, 0x755377f, 0xe42f3a5, 0x43d1f34, 0x43d1f34, 0x3ac2d7b5, 0x3ac2d7b5, 0x3ac2d7b5, 0x45c87e1d, 0x45c87e1d, 0x45c87e1d, 0xade84734, 0xade84734, 0xade84734, 0x43d1f34, 0xe42f3a5, 0xe42f3a5, 0x43d1f34, }, 20 }, - { "gfxterm_red", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xa64abc46, 0x75b6655, 0xa64abc46, 0x8ab5be58, 0x59c36f00, 0x59c36f00, 0xa119c4f4, 0xa119c4f4, 0xa119c4f4, 0xdf99a992, 0xdf99a992, 0xdf99a992, 0x1cbb945f, 0x1cbb945f, 0x1cbb945f, 0x59c36f00, 0x8ab5be58, 0x8ab5be58, 0x59c36f00, }, 20 }, - { "gfxterm_red", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x58be41e7, 0xae0d3f09, 0x58be41e7, 0xda7a6cbf, 0xaa4593fe, 0xaa4593fe, 0x794b67, 0x794b67, 0x794b67, 0xa68c4600, 0xa68c4600, 0xa68c4600, 0x242ba46b, 0x242ba46b, 0x242ba46b, 0xaa4593fe, 0xda7a6cbf, 0xda7a6cbf, 0xaa4593fe, }, 20 }, - { "gfxterm_red", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0xaaa4d3ad, 0xe61c6d02, 0xaaa4d3ad, 0xff557024, 0xc9cbf769, 0xc9cbf769, 0x780542e8, 0x780542e8, 0x780542e8, 0x86dd8324, 0x86dd8324, 0x86dd8324, 0x6e8b2c28, 0x6e8b2c28, 0x6e8b2c28, 0xc9cbf769, 0xff557024, 0xff557024, 0xc9cbf769, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xcffd463e, 0x59775566, 0xcffd463e, 0xb4e87140, 0x5387d57f, 0x5387d57f, 0xc2a27e06, 0xc2a27e06, 0xc2a27e06, 0x2fb12ca, 0x2fb12ca, 0x2fb12ca, 0xe525905c, 0xe525905c, 0xe525905c, 0x5387d57f, 0xb4e87140, 0xb4e87140, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x91d12daf, 0xdceabc0e, 0x91d12daf, 0xf372b81f, 0xf83ee7aa, 0xf83ee7aa, 0x85a69692, 0x85a69692, 0x85a69692, 0x19df4661, 0x19df4661, 0x19df4661, 0x216cedc9, 0x216cedc9, 0x216cedc9, 0xf83ee7aa, 0xf372b81f, 0xf372b81f, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0x5f5953b3, 0x1f88963e, 0x5f5953b3, 0x6aeb9112, 0x724366e5, 0x724366e5, 0xc5da2432, 0xc5da2432, 0xc5da2432, 0x82e366c8, 0x82e366c8, 0x82e366c8, 0xefcd4182, 0xefcd4182, 0xefcd4182, 0x724366e5, 0x6aeb9112, 0x6aeb9112, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x1227533e, 0xee3616e0, 0x1227533e, 0xc32db32e, 0x5387d57f, 0x5387d57f, 0xa347c834, 0xa347c834, 0xa347c834, 0x7d8987e9, 0x7d8987e9, 0x7d8987e9, 0xee0a15f7, 0xee0a15f7, 0xee0a15f7, 0x5387d57f, 0xc32db32e, 0xc32db32e, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0xc548a908, 0x2624be34, 0xc548a908, 0x1745599, 0xf83ee7aa, 0xf83ee7aa, 0xaaaf7e14, 0xaaaf7e14, 0xaaaf7e14, 0xd8756d24, 0xd8756d24, 0xd8756d24, 0xe9e03ce2, 0xe9e03ce2, 0xe9e03ce2, 0xf83ee7aa, 0x1745599, 0x1745599, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x30506e44, 0x76cf9d03, 0x30506e44, 0x33485d71, 0x724366e5, 0x724366e5, 0xd12bc953, 0xd12bc953, 0xd12bc953, 0x88bb3a03, 0x88bb3a03, 0x88bb3a03, 0x400c5441, 0x400c5441, 0x400c5441, 0x724366e5, 0x33485d71, 0x33485d71, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0xa3238023, 0xa5b82f9e, 0xa3238023, 0x93f8a252, 0x1c955882, 0x1c955882, 0x205b041f, 0x205b041f, 0x205b041f, 0xefac4988, 0xefac4988, 0xefac4988, 0x11c5459d, 0x11c5459d, 0x11c5459d, 0x1c955882, 0x93f8a252, 0x93f8a252, 0x1c955882, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xf651c995, 0x7e1ae3d7, 0xf651c995, 0xdab860af, 0x4d266f7a, 0x4d266f7a, 0x6272be10, 0x6272be10, 0x6272be10, 0x8405a5af, 0x8405a5af, 0x8405a5af, 0x1c3cf13f, 0x1c3cf13f, 0x1c3cf13f, 0x4d266f7a, 0xdab860af, 0xdab860af, 0x4d266f7a, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x2fa6119, 0x30618885, 0x2fa6119, 0xbfbe1b6a, 0x1ed9d731, 0x1ed9d731, 0x11353cf5, 0x11353cf5, 0x11353cf5, 0xbf512230, 0xbf512230, 0xbf512230, 0x9c383386, 0x9c383386, 0x9c383386, 0x1ed9d731, 0xbfbe1b6a, 0xbfbe1b6a, 0x1ed9d731, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0x4caf1997, 0xda250acf, 0x4caf1997, 0x2183903f, 0x5387d57f, 0x5387d57f, 0x6be656ff, 0x6be656ff, 0x6be656ff, 0xabbf3a33, 0xabbf3a33, 0xabbf3a33, 0x4c61b8a5, 0x4c61b8a5, 0x4c61b8a5, 0x5387d57f, 0x2183903f, 0x2183903f, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x7b29cc8e, 0x36125d2f, 0x7b29cc8e, 0x1277092, 0xf83ee7aa, 0xf83ee7aa, 0x4830d5b5, 0x4830d5b5, 0x4830d5b5, 0xd4490546, 0xd4490546, 0xd4490546, 0xecfaaeee, 0xecfaaeee, 0xecfaaeee, 0xf83ee7aa, 0x1277092, 0x1277092, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0x2e644de2, 0x6eb5886f, 0x2e644de2, 0x3d66c6af, 0x724366e5, 0x724366e5, 0x5d800f18, 0x5d800f18, 0x5d800f18, 0x1ab94de2, 0x1ab94de2, 0x1ab94de2, 0x77976aa8, 0x77976aa8, 0x77976aa8, 0x724366e5, 0x3d66c6af, 0x3d66c6af, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x5f11f8eb, 0xa300bd35, 0x5f11f8eb, 0xe2cba3fa, 0x5387d57f, 0x5387d57f, 0xfa2cee75, 0xfa2cee75, 0xfa2cee75, 0x24e2a1a8, 0x24e2a1a8, 0x24e2a1a8, 0xb76133b6, 0xb76133b6, 0xb76133b6, 0x5387d57f, 0xe2cba3fa, 0xe2cba3fa, 0x5387d57f, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x179340b2, 0xf4ff578e, 0x179340b2, 0xe378eba9, 0xf83ee7aa, 0xf83ee7aa, 0xf787fcc2, 0xf787fcc2, 0xf787fcc2, 0x855deff2, 0x855deff2, 0x855deff2, 0xb4c8be34, 0xb4c8be34, 0xb4c8be34, 0xf83ee7aa, 0xe378eba9, 0xe378eba9, 0xf83ee7aa, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x5703fa5a, 0x119c091d, 0x5703fa5a, 0xa13f0d1a, 0x724366e5, 0x724366e5, 0xd989a04d, 0xd989a04d, 0xd989a04d, 0x8019531d, 0x8019531d, 0x8019531d, 0x48ae3d5f, 0x48ae3d5f, 0x48ae3d5f, 0x724366e5, 0xa13f0d1a, 0xa13f0d1a, 0x724366e5, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xf38c2b36, 0xf517848b, 0xf38c2b36, 0xa2621779, 0x1c955882, 0x1c955882, 0x153777fa, 0x153777fa, 0x153777fa, 0xdac03a6d, 0xdac03a6d, 0xdac03a6d, 0x24a93678, 0x24a93678, 0x24a93678, 0x1c955882, 0xa2621779, 0xa2621779, 0x1c955882, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0xb8253868, 0x306e122a, 0xb8253868, 0x83b58e9b, 0x4d266f7a, 0x4d266f7a, 0x98183444, 0x98183444, 0x98183444, 0x7e6f2ffb, 0x7e6f2ffb, 0x7e6f2ffb, 0xe6567b6b, 0xe6567b6b, 0xe6567b6b, 0x4d266f7a, 0x83b58e9b, 0x83b58e9b, 0x4d266f7a, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x40c62f40, 0x725dc6dc, 0x40c62f40, 0x50dfba34, 0x1ed9d731, 0x1ed9d731, 0x32e89a68, 0x32e89a68, 0x32e89a68, 0x9c8c84ad, 0x9c8c84ad, 0x9c8c84ad, 0xbfe5951b, 0xbfe5951b, 0xbfe5951b, 0x1ed9d731, 0x50dfba34, 0x50dfba34, 0x1ed9d731, }, 20 }, - { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xfaeb56f1, 0x1e95aeb9, 0xfaeb56f1, 0xe4ddf18b, 0x9813a416, 0x9813a416, 0x5da5926f, 0x5da5926f, 0x5da5926f, 0xcc7e145c, 0xcc7e145c, 0xcc7e145c, 0x500be19e, 0x500be19e, 0x500be19e, 0x9813a416, 0xe4ddf18b, 0xe4ddf18b, 0x9813a416, }, 20 }, - { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa11f0307, 0xed9944c5, 0xa11f0307, 0x93a8828e, 0x5fcf013d, 0x5fcf013d, 0xeabf61dc, 0xeabf61dc, 0xeabf61dc, 0x38af79aa, 0x38af79aa, 0x38af79aa, 0x2784f857, 0x2784f857, 0x2784f857, 0x5fcf013d, 0x93a8828e, 0x93a8828e, 0x5fcf013d, }, 20 }, - { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xeedd0ec5, 0xba9a322d, 0xeedd0ec5, 0x32205338, 0xdd28f52b, 0xdd28f52b, 0x14854a2b, 0x14854a2b, 0x14854a2b, 0x35b9b3cf, 0x35b9b3cf, 0x35b9b3cf, 0x2fc8d05e, 0x2fc8d05e, 0x2fc8d05e, 0xdd28f52b, 0x32205338, 0x32205338, 0xdd28f52b, }, 20 }, - { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xe7baf88f, 0x46ab229c, 0xe7baf88f, 0x2422eb85, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x2422eb85, 0x2422eb85, 0x59c36f00, }, 20 }, - { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x86184b5, 0xfed2fa5b, 0x86184b5, 0xf984bb34, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xf984bb34, 0xf984bb34, 0xaa4593fe, }, 20 }, - { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x2dda8793, 0x6162393c, 0x2dda8793, 0x2a6bc689, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x2a6bc689, 0x2a6bc689, 0xc9cbf769, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xf2b1715, 0xeb55ef5d, 0xf2b1715, 0x61e172d4, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x61e172d4, 0x61e172d4, 0x9813a416, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x2a517b4, 0x4e235076, 0x2a517b4, 0x85b73555, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0x85b73555, 0x85b73555, 0x5fcf013d, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x53e34b0f, 0x7a477e7, 0x53e34b0f, 0x7b92ba0b, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0x7b92ba0b, 0x7b92ba0b, 0xdd28f52b, }, 20 }, - { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xcccbb8c0, 0x859866a0, 0xcccbb8c0, 0x2bf5b2f8, 0x43d1f34, 0x43d1f34, 0xd204ac75, 0xd204ac75, 0xd204ac75, 0xad0e05dd, 0xad0e05dd, 0xad0e05dd, 0x452e3cf4, 0x452e3cf4, 0x452e3cf4, 0x43d1f34, 0x2bf5b2f8, 0x2bf5b2f8, 0x43d1f34, }, 20 }, - { "gfxterm_high", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x59c36f00, 0xe7baf88f, 0x46ab229c, 0xe7baf88f, 0x2422eb85, 0x59c36f00, 0x59c36f00, 0xc8b88a82, 0xc8b88a82, 0xc8b88a82, 0xb638e7e4, 0xb638e7e4, 0xb638e7e4, 0x751ada29, 0x751ada29, 0x751ada29, 0x59c36f00, 0x2422eb85, 0x2422eb85, 0x59c36f00, }, 20 }, - { "gfxterm_high", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xaa4593fe, 0x86184b5, 0xfed2fa5b, 0x86184b5, 0xf984bb34, 0xaa4593fe, 0xaa4593fe, 0x8b63f19d, 0x8b63f19d, 0x8b63f19d, 0x2d96fcfa, 0x2d96fcfa, 0x2d96fcfa, 0xaf311e91, 0xaf311e91, 0xaf311e91, 0xaa4593fe, 0xf984bb34, 0xf984bb34, 0xaa4593fe, }, 20 }, - { "gfxterm_high", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xc9cbf769, 0x2dda8793, 0x6162393c, 0x2dda8793, 0x2a6bc689, 0xc9cbf769, 0xc9cbf769, 0xec23555f, 0xec23555f, 0xec23555f, 0x12fb9493, 0x12fb9493, 0x12fb9493, 0xfaad3b9f, 0xfaad3b9f, 0xfaad3b9f, 0xc9cbf769, 0x2a6bc689, 0x2a6bc689, 0xc9cbf769, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x5387d57f, 0xc2dae336, 0x5450f06e, 0xc2dae336, 0x2fd25c3, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0x2fd25c3, 0x2fd25c3, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0xf910eb1d, 0xb42b7abc, 0xf910eb1d, 0x6d5e8f22, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0x6d5e8f22, 0x6d5e8f22, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0x724366e5, 0xa038bbb4, 0xe0e97e39, 0xa038bbb4, 0x4211aeac, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x4211aeac, 0x4211aeac, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4a2dd1b7, 0xb63c9469, 0x4a2dd1b7, 0xe8aea440, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0xe8aea440, 0xe8aea440, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x8597e648, 0x66fbf174, 0x8597e648, 0xa99c8f36, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0xa99c8f36, 0xa99c8f36, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x724366e5, 0x7c1b6088, 0x3a8493cf, 0x7c1b6088, 0xd5d88a3e, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd5d88a3e, 0xd5d88a3e, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x1c955882, 0x9f45f149, 0x99de5ef4, 0x9f45f149, 0x84437bc3, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x84437bc3, 0x84437bc3, 0x1c955882, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x60f3276d, 0xe8b80d2f, 0x60f3276d, 0x1d7bae65, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x1d7bae65, 0x1d7bae65, 0x4d266f7a, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0x1ed9d731, 0x66a98ee6, 0x5432677a, 0x66a98ee6, 0x691b88fb, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0x691b88fb, 0x691b88fb, 0x1ed9d731, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x5387d57f, 0xc26d8183, 0x54e792db, 0xc26d8183, 0x1473f9a0, 0x5387d57f, 0x5387d57f, 0x71381c6, 0x71381c6, 0x71381c6, 0xc74aed0a, 0xc74aed0a, 0xc74aed0a, 0x20946f9c, 0x20946f9c, 0x20946f9c, 0x5387d57f, 0x1473f9a0, 0x1473f9a0, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0xf83ee7aa, 0x3ed65cd5, 0x73edcd74, 0x3ed65cd5, 0xb2351146, 0xf83ee7aa, 0xf83ee7aa, 0x610deea9, 0x610deea9, 0x610deea9, 0xfd743e5a, 0xfd743e5a, 0xfd743e5a, 0xc5c795f2, 0xc5c795f2, 0xc5c795f2, 0xf83ee7aa, 0xb2351146, 0xb2351146, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0x724366e5, 0xc576da57, 0x85a71fda, 0xc576da57, 0x1ef86a3, 0x724366e5, 0x724366e5, 0xdbb2f05a, 0xdbb2f05a, 0xdbb2f05a, 0x9c8bb2a0, 0x9c8bb2a0, 0x9c8bb2a0, 0xf1a595ea, 0xf1a595ea, 0xf1a595ea, 0x724366e5, 0x1ef86a3, 0x1ef86a3, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0x5387d57f, 0x4778be32, 0xbb69fbec, 0x4778be32, 0x892b70c4, 0x5387d57f, 0x5387d57f, 0x23c74007, 0x23c74007, 0x23c74007, 0xfd090fda, 0xfd090fda, 0xfd090fda, 0x6e8a9dc4, 0x6e8a9dc4, 0x6e8a9dc4, 0x5387d57f, 0x892b70c4, 0x892b70c4, 0x5387d57f, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0xf83ee7aa, 0x9c6c6004, 0x7f007738, 0x9c6c6004, 0x80b05ef0, 0xf83ee7aa, 0xf83ee7aa, 0xa5fd8afa, 0xa5fd8afa, 0xa5fd8afa, 0xd72799ca, 0xd72799ca, 0xd72799ca, 0xe6b2c80c, 0xe6b2c80c, 0xe6b2c80c, 0xf83ee7aa, 0x80b05ef0, 0x80b05ef0, 0xf83ee7aa, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x724366e5, 0x84caa3c1, 0xc2555086, 0x84caa3c1, 0xd82d8d02, 0x724366e5, 0x724366e5, 0xd0002838, 0xd0002838, 0xd0002838, 0x8990db68, 0x8990db68, 0x8990db68, 0x4127b52a, 0x4127b52a, 0x4127b52a, 0x724366e5, 0xd82d8d02, 0xd82d8d02, 0x724366e5, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x1c955882, 0xe4dec6e6, 0xe245695b, 0xe4dec6e6, 0x9eed5252, 0x1c955882, 0x1c955882, 0x727420bf, 0x727420bf, 0x727420bf, 0xbd836d28, 0xbd836d28, 0xbd836d28, 0x43ea613d, 0x43ea613d, 0x43ea613d, 0x1c955882, 0x9eed5252, 0x9eed5252, 0x1c955882, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x4d266f7a, 0x19a935eb, 0x91e21fa9, 0x19a935eb, 0x7358a32a, 0x4d266f7a, 0x4d266f7a, 0xc23ec599, 0xc23ec599, 0xc23ec599, 0x2449de26, 0x2449de26, 0x2449de26, 0xbc708ab6, 0xbc708ab6, 0xbc708ab6, 0x4d266f7a, 0x7358a32a, 0x7358a32a, 0x4d266f7a, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x1ed9d731, 0xb2b10aa1, 0x802ae33d, 0xb2b10aa1, 0x105ee3bb, 0x1ed9d731, 0x1ed9d731, 0x6ea8026e, 0x6ea8026e, 0x6ea8026e, 0xc0cc1cab, 0xc0cc1cab, 0xc0cc1cab, 0xe3a50d1d, 0xe3a50d1d, 0xe3a50d1d, 0x1ed9d731, 0x105ee3bb, 0x105ee3bb, 0x1ed9d731, }, 20 }, - { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x9813a416, 0xeedf19a8, 0xaa1e1e0, 0xeedf19a8, 0x70c50dc2, 0x9813a416, 0x9813a416, 0xc10419e0, 0xc10419e0, 0xc10419e0, 0x50df9fd3, 0x50df9fd3, 0x50df9fd3, 0xccaa6a11, 0xccaa6a11, 0xccaa6a11, 0x9813a416, 0x70c50dc2, 0x70c50dc2, 0x9813a416, }, 20 }, - { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xa474246a, 0xe8f263a8, 0xa474246a, 0xe7cea168, 0x5fcf013d, 0x5fcf013d, 0x77ba65ab, 0x77ba65ab, 0x77ba65ab, 0xa5aa7ddd, 0xa5aa7ddd, 0xa5aa7ddd, 0xba81fc20, 0xba81fc20, 0xba81fc20, 0x5fcf013d, 0xe7cea168, 0xe7cea168, 0x5fcf013d, }, 20 }, - { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x653aabb4, 0x317d975c, 0x653aabb4, 0xab5387a0, 0xdd28f52b, 0xdd28f52b, 0xbc36f156, 0xbc36f156, 0xbc36f156, 0x9d0a08b2, 0x9d0a08b2, 0x9d0a08b2, 0x877b6b23, 0x877b6b23, 0x877b6b23, 0xdd28f52b, 0xab5387a0, 0xab5387a0, 0xdd28f52b, }, 20 }, - { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, 0x7f1853ba, }, 5 }, - { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xff1957f0, 0xff1957f0, 0xff1957f0, 0xff1957f0, 0xff1957f0, }, 5 }, - { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, 0xcb45d8c5, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x2b154617, 0x692e98df, 0xaf62fb87, 0xed59254f, 0x26164bc6, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x3b0fbc56, 0xd9d57c0e, 0xfb564a17, 0x198c8a4f, 0xbe502625, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0x6e6c9b36, 0x4ae9f137, 0x27664f34, 0x3e32535, 0xfc793332, }, 5 }, - { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x91692eef, 0x89773091, 0xa1551213, 0xb94b0c6d, 0xf1115717, }, 5 }, - { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, 0x2d1b122b, }, 5 }, - { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0x327d1082, 0x327d1082, 0x327d1082, 0x327d1082, 0x327d1082, }, 5 }, - { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0xadd0f186, 0xadd0f186, 0xadd0f186, 0xadd0f186, 0xadd0f186, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, 0x2c97569c, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, 0x9bd7a3ac, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, 0xedbceb9c, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, 0x3c2a42f1, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, 0xb25ce62a, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, 0x66cee14c, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x61db45b7, 0x1d867efe, 0x99613325, 0xe53c086c, 0x9543de62, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xa46eb37f, 0xd2a59656, 0x49f8f92d, 0x3f33dc04, 0x7aae512a, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xb864a496, 0x6c22313b, 0x1505f93d, 0xc1436c90, 0xe74a6931, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, 0x9056f776, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, 0x2bde3c67, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, 0xb04615f3, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, 0xba8df8dd, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, 0x84ac1329, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, 0x145ad698, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x4af6b480, 0x923db79c, 0xfe8cc449, 0x2647c755, 0x27ee23e3, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0x121d5e29, 0xf66c0aed, 0xdf138150, 0x3b62d594, 0x8dec962a, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0xae86a12c, 0x4dabbe89, 0x6d30e897, 0x8e1df732, 0x2c0644ab, }, 5 }, - { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0x2605d280, 0xc06e3172, 0xef3e6395, 0x9558067, 0xb19ec65b, }, 5 }, - { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x9404ef3b, 0xa4fdf18, 0xad7ef98c, 0x3335c9af, 0xe6f0c255, }, 5 }, - { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0xa008b770, 0xb98eb0d8, 0x9304b820, 0x8a82bf88, 0xc610a9d0, }, 5 }, + { "cmdline_cat", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24285504, 0x24285504, 0x3cc7ae1, 0x3cc7ae1, 0x20e2971b, 0x20e2971b, 0xc295b4fc, 0xc295b4fc, 0x1fbe0d4, 0x1fbe0d4, 0x82930744, 0x82930744, 0xf4b66805, 0xf4b66805, 0x3e16a8c5, 0x3e16a8c5, 0x1165d7dc, 0x1165d7dc, 0xfa78cf7f, 0xfa78cf7f, 0xc105a544, 0xc105a544, 0x430cee22, 0x430cee22, 0xbcf938a0, 0xbcf938a0, 0x7b800045, 0x7b800045, 0x2cc85143, 0x2cc85143, 0x80e0a4b4, 0x80e0a4b4, 0x212e8415, 0x212e8415, 0x151d5163, 0x151d5163, 0x24dcfa9e, 0x24dcfa9e, 0xb1df21b2, 0xb1df21b2, 0x2990a5cf, 0x8c1740a5, 0xd29f2d17, 0xd29f2d17, }, 45 }, + { "cmdline_cat", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2b224886, 0x2b224886, 0x4fa52ab9, 0x4fa52ab9, 0xad8716fa, 0xad8716fa, 0x97a64f1, 0x97a64f1, 0x5fa72700, 0x5fa72700, 0x41913bce, 0x41913bce, 0xe3e6af02, 0xe3e6af02, 0x978a4f3c, 0x978a4f3c, 0xfdedd645, 0xfdedd645, 0x4700a76, 0x4700a76, 0x28761dd2, 0x28761dd2, 0x255a96e8, 0x255a96e8, 0x6eb066fa, 0x6eb066fa, 0x5948e6c4, 0x5948e6c4, 0xc2d83034, 0xc2d83034, 0xe9cc8934, 0xe9cc8934, 0x406490d, 0x406490d, 0x2287423f, 0x2287423f, 0x565ef88b, 0x565ef88b, 0x31af9b10, 0x31af9b10, 0xfbd17ce0, 0xdb686c61, 0xd2731a72, 0xd2731a72, }, 45 }, + { "cmdline_cat", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x999febcd, 0x999febcd, 0x4be4a5e6, 0x4be4a5e6, 0xaa36e979, 0xaa36e979, 0x27ebab0f, 0x27ebab0f, 0x6fa8606c, 0x6fa8606c, 0xd3f60410, 0xd3f60410, 0xa3aea110, 0xa3aea110, 0x5b352e4b, 0x5b352e4b, 0xad22636f, 0xad22636f, 0x54333936, 0x54333936, 0x73d67c9f, 0x73d67c9f, 0xb4462f4a, 0xb4462f4a, 0x1dffdbca, 0x1dffdbca, 0x7095a788, 0x7095a788, 0xc71aa28, 0xc71aa28, 0x215e8dfc, 0x215e8dfc, 0x388d3494, 0x388d3494, 0x5804733d, 0x5804733d, 0x98ef7a83, 0x98ef7a83, 0xc986bddb, 0xc986bddb, 0x183599ab, 0xf4204ada, 0x6562dd40, 0x6562dd40, }, 45 }, + { "cmdline_cat", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xea25e7f1, 0xea25e7f1, 0xf959b605, 0xf959b605, 0x5650ee99, 0x5650ee99, 0xbf3bec3c, 0xbf3bec3c, 0x8d04d782, 0x8d04d782, 0xddbcf5be, 0xddbcf5be, 0x7ee1adaf, 0x7ee1adaf, 0x2fbaff58, 0x2fbaff58, 0x42b24add, 0x42b24add, 0x47483eb4, 0x47483eb4, 0x78962528, 0x78962528, 0x847ee9b7, 0x847ee9b7, 0xc826c0f, 0xc826c0f, 0x82b1bf51, 0x82b1bf51, 0x13ccc821, 0x13ccc821, 0x7d783b1e, 0x7d783b1e, 0xdd2c0bbc, 0xdd2c0bbc, 0x7b71ebd7, 0x7b71ebd7, 0x7381f4c5, 0x7381f4c5, 0xfe20bc9c, 0xfe20bc9c, 0x85dee923, 0x85611b00, 0x723c0ec4, 0x723c0ec4, }, 45 }, + { "cmdline_cat", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xbc52dc5f, 0xbc52dc5f, 0x4c895989, 0x4c895989, 0x59d180a4, 0x59d180a4, 0x50eb81b9, 0x50eb81b9, 0xae85d6c6, 0xae85d6c6, 0xf8354df6, 0xf8354df6, 0x83562153, 0x83562153, 0xd4caece2, 0xd4caece2, 0xb0b5612d, 0xb0b5612d, 0x123d360a, 0x123d360a, 0x70f62e8e, 0x70f62e8e, 0x6a82788f, 0x6a82788f, 0xb0a3ee68, 0xb0a3ee68, 0x604dd5b0, 0x604dd5b0, 0x20f7ea1, 0x20f7ea1, 0x3f6db6bf, 0x3f6db6bf, 0x4a762b9d, 0x4a762b9d, 0xea026ad4, 0xea026ad4, 0x8ba3d148, 0x8ba3d148, 0x434f2359, 0x434f2359, 0x4db299a1, 0x73536949, 0xf022eb4b, 0xf022eb4b, }, 45 }, + { "cmdline_cat", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x7cfd676, 0x7cfd676, 0xaf7bcdc6, 0xaf7bcdc6, 0x7dc1f958, 0x7dc1f958, 0xc902ad3e, 0xc902ad3e, 0x5529ad04, 0x5529ad04, 0xa0a133b1, 0xa0a133b1, 0x72f927da, 0x72f927da, 0x28de6d8e, 0x28de6d8e, 0xa5eb10fc, 0xa5eb10fc, 0x2d7ba4f5, 0x2d7ba4f5, 0xd832b228, 0xd832b228, 0x56f0351, 0x56f0351, 0xc6556c2e, 0xc6556c2e, 0x2ceecfa4, 0x2ceecfa4, 0x3d765fbd, 0x3d765fbd, 0x8da7887e, 0x8da7887e, 0xfc8209ea, 0xfc8209ea, 0x6e822767, 0x6e822767, 0xba5c0adf, 0xba5c0adf, 0x8e2af81a, 0x8e2af81a, 0x62c25eb4, 0x2ba315e0, 0x349b7b7d, 0x349b7b7d, }, 45 }, + { "cmdline_cat", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x361fdea5, 0x361fdea5, 0x89a3b488, 0x89a3b488, 0x37302fbe, 0x37302fbe, 0x4b9f20b8, 0x4b9f20b8, 0xc60cf5fe, 0xc60cf5fe, 0xf7b755aa, 0xf7b755aa, 0xcaba5d52, 0xcaba5d52, 0x4f793adf, 0x4f793adf, 0x4cd60722, 0x4cd60722, 0x13adbeec, 0x13adbeec, 0xdc2c109f, 0xdc2c109f, 0x444e465a, 0x444e465a, 0x7baac5fa, 0x7baac5fa, 0x8e746e7f, 0x8e746e7f, 0x7fea6e68, 0x7fea6e68, 0x1f6edf48, 0x1f6edf48, 0x23322506, 0x23322506, 0xbccd38ef, 0xbccd38ef, 0x1b1f1dd3, 0x1b1f1dd3, 0x9c901775, 0x9c901775, 0x78b8e355, 0x95034aa2, 0x4f00ee83, 0x4f00ee83, }, 45 }, + { "gfxterm_menu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xdf032925, 0xb9ccc5a6, 0xdf032925, 0x9cf5e462, 0x59c36f00, 0x59c36f00, 0xd3a0a4df, 0xd3a0a4df, 0xd3a0a4df, 0xad20c9b9, 0xad20c9b9, 0xad20c9b9, 0xcfd6dc6b, 0xcfd6dc6b, 0xcfd6dc6b, 0x59c36f00, 0x9cf5e462, 0x9cf5e462, 0x59c36f00, }, 20 }, + { "gfxterm_menu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xa24e444d, 0x664c3f5, 0xa24e444d, 0x8c4bc132, 0xaa4593fe, 0xaa4593fe, 0x86e14b09, 0x86e14b09, 0x86e14b09, 0x2014466e, 0x2014466e, 0x2014466e, 0xd2ced16, 0xd2ced16, 0xd2ced16, 0xaa4593fe, 0x8c4bc132, 0x8c4bc132, 0xaa4593fe, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6fa41086, 0xd5284f5e, 0x6fa41086, 0x32b37d02, 0xc9cbf769, 0xc9cbf769, 0xf2a2bdc8, 0xf2a2bdc8, 0xf2a2bdc8, 0xc7a7c04, 0xc7a7c04, 0xc7a7c04, 0xe530c30c, 0xe530c30c, 0xe530c30c, 0xc9cbf769, 0x32b37d02, 0x32b37d02, 0xc9cbf769, }, 20 }, + { "gfxterm_menu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xd084e37c, 0x6324ea4b, 0xd084e37c, 0x7ed2aaa4, 0x9813a416, 0x9813a416, 0xbd3bd80c, 0xbd3bd80c, 0xbd3bd80c, 0x2ce05e3f, 0x2ce05e3f, 0x2ce05e3f, 0x355a63ef, 0x355a63ef, 0x355a63ef, 0x9813a416, 0x7ed2aaa4, 0x7ed2aaa4, 0x9813a416, }, 20 }, + { "gfxterm_menu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x451273fe, 0x55e4689f, 0x451273fe, 0x33b4464d, 0x5fcf013d, 0x5fcf013d, 0xbe43bf51, 0xbe43bf51, 0xbe43bf51, 0x6c53a727, 0x6c53a727, 0x6c53a727, 0x7a2098b8, 0x7a2098b8, 0x7a2098b8, 0x5fcf013d, 0x33b4464d, 0x33b4464d, 0x5fcf013d, }, 20 }, + { "gfxterm_menu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x93132338, 0xc76b87e6, 0x93132338, 0x8816f93f, 0xdd28f52b, 0xdd28f52b, 0xcdf3c404, 0xcdf3c404, 0xcdf3c404, 0xeccf3de0, 0xeccf3de0, 0xeccf3de0, 0x9177f66c, 0x9177f66c, 0x9177f66c, 0xdd28f52b, 0x8816f93f, 0x8816f93f, 0xdd28f52b, }, 20 }, + { "gfxterm_menu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xae6a4ef5, 0x5fb9948, 0xae6a4ef5, 0x51d55575, 0x43d1f34, 0x43d1f34, 0x252c3625, 0x252c3625, 0x252c3625, 0x5a269f8d, 0x5a269f8d, 0x5a269f8d, 0xc3779a0b, 0xc3779a0b, 0xc3779a0b, 0x43d1f34, 0x51d55575, 0x51d55575, 0x43d1f34, }, 20 }, + { "gfxmenu", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x60e56714, 0x14275a99, 0x60e56714, 0x35080c92, 0x9a2e0d26, 0xc53fe194, 0xc53fe194, 0xc53fe194, 0x99e71754, 0x99e71754, 0x99e71754, 0xb07fd9c6, 0xb07fd9c6, 0xb07fd9c6, 0x59c36f00, 0x35080c92, 0x35080c92, }, 18 }, + { "gfxmenu", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x33d94a8c, 0x7b789e53, 0x33d94a8c, 0xe8b9b6bf, 0xa9d58ccd, 0x8cf0d333, 0x8cf0d333, 0x8cf0d333, 0xd9af7939, 0xd9af7939, 0xd9af7939, 0xb09cb170, 0xb09cb170, 0xb09cb170, 0xaa4593fe, 0xe8b9b6bf, 0xe8b9b6bf, }, 18 }, + { "gfxmenu", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xe4669404, 0x9afa8e99, 0xe4669404, 0xdd25167e, 0x5411be8b, 0x3589841c, 0x3589841c, 0x3589841c, 0x4a372288, 0x4a372288, 0x4a372288, 0x84342f0, 0x84342f0, 0x84342f0, 0xc9cbf769, 0xdd25167e, 0xdd25167e, }, 18 }, + { "gfxmenu", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x1c3742c9, 0x37ed1568, 0x12f55eef, 0x37ed1568, 0x8aa8ad16, 0x740d78cf, 0x1a9dc2bc, 0x1a9dc2bc, 0x1a9dc2bc, 0xf13828c0, 0xf13828c0, 0xf13828c0, 0xf7732830, 0xf7732830, 0xf7732830, 0x1c3742c9, 0x8aa8ad16, 0x8aa8ad16, }, 18 }, + { "gfxmenu", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0xcc5a7bed, 0xc5315ac9, 0x7dece9d3, 0xc5315ac9, 0xc84ef08b, 0xbcda144c, 0x321e548b, 0x321e548b, 0x321e548b, 0x5d57889a, 0x5d57889a, 0x5d57889a, 0x50a11699, 0x50a11699, 0x50a11699, 0xcc5a7bed, 0xc84ef08b, 0xc84ef08b, }, 18 }, + { "gfxmenu", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xef4a3312, 0x40a72ecd, 0x2304571f, 0x40a72ecd, 0xd2de6d81, 0x5d55a141, 0x8ccafa03, 0x8ccafa03, 0x8ccafa03, 0x4a78be1d, 0x4a78be1d, 0x4a78be1d, 0x5e1d6ea2, 0x5e1d6ea2, 0x5e1d6ea2, 0xef4a3312, 0xd2de6d81, 0xd2de6d81, }, 18 }, + { "gfxmenu", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x54e48d80, 0xe6143ead, 0x19816f75, 0xe6143ead, 0xe2db78c2, 0xa992f629, 0x5fefa0d1, 0x5fefa0d1, 0x5fefa0d1, 0xde1c5600, 0xde1c5600, 0xde1c5600, 0x48b8ef6f, 0x48b8ef6f, 0x48b8ef6f, 0x54e48d80, 0xe2db78c2, 0xe2db78c2, }, 18 }, + { "gfxterm_ar", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x25ba43d4, 0x43fe620d, 0x25ba43d4, 0x664c8e93, 0x59c36f00, 0x59c36f00, 0xb2921a37, 0xb2921a37, 0xb2921a37, 0xcc127751, 0xcc127751, 0xcc127751, 0xaee46283, 0xaee46283, 0xaee46283, 0x59c36f00, 0x664c8e93, 0x664c8e93, 0x59c36f00, }, 20 }, + { "gfxterm_ar", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x2aa2a72b, 0x6d6df6e1, 0x2aa2a72b, 0x4a72254, 0xaa4593fe, 0xaa4593fe, 0xa3be9127, 0xa3be9127, 0xa3be9127, 0x54b9c40, 0x54b9c40, 0x54b9c40, 0x28733738, 0x28733738, 0x28733738, 0xaa4593fe, 0x4a72254, 0x4a72254, 0xaa4593fe, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x9e799f98, 0xe21ad041, 0x9e799f98, 0xc36ef21c, 0xc9cbf769, 0xc9cbf769, 0x93d6c07d, 0x93d6c07d, 0x93d6c07d, 0x6d0e01b1, 0x6d0e01b1, 0x6d0e01b1, 0x8444beb9, 0x8444beb9, 0x8444beb9, 0xc9cbf769, 0xc36ef21c, 0xc36ef21c, 0xc9cbf769, }, 20 }, + { "gfxterm_ar", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x7ffc43fd, 0x64505961, 0x7ffc43fd, 0xd1aa0a25, 0x9813a416, 0x9813a416, 0x5b5f9bd5, 0x5b5f9bd5, 0x5b5f9bd5, 0xca841de6, 0xca841de6, 0xca841de6, 0xd33e2036, 0xd33e2036, 0xd33e2036, 0x9813a416, 0xd1aa0a25, 0xd1aa0a25, 0x9813a416, }, 20 }, + { "gfxterm_ar", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x570ca3fc, 0x4f1cee0f, 0x570ca3fc, 0x21aa964f, 0x5fcf013d, 0x5fcf013d, 0xf2bc017e, 0xf2bc017e, 0xf2bc017e, 0x20ac1908, 0x20ac1908, 0x20ac1908, 0x36df2697, 0x36df2697, 0x36df2697, 0x5fcf013d, 0x21aa964f, 0x21aa964f, 0x5fcf013d, }, 20 }, + { "gfxterm_ar", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xcf9798d3, 0x5d39a7fa, 0xcf9798d3, 0xd49242d4, 0xdd28f52b, 0xdd28f52b, 0xe15747f0, 0xe15747f0, 0xe15747f0, 0xc06bbe14, 0xc06bbe14, 0xc06bbe14, 0xbdd37598, 0xbdd37598, 0xbdd37598, 0xdd28f52b, 0xd49242d4, 0xd49242d4, 0xdd28f52b, }, 20 }, + { "gfxterm_ar", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xae6154e8, 0x59e627f7, 0xae6154e8, 0x51de4f68, 0x43d1f34, 0x43d1f34, 0x59a8eb9f, 0x59a8eb9f, 0x59a8eb9f, 0x26a24237, 0x26a24237, 0x26a24237, 0xbff347b1, 0xbff347b1, 0xbff347b1, 0x43d1f34, 0x51de4f68, 0x51de4f68, 0x43d1f34, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xb2b04aa3, 0xca81b845, 0xb2b04aa3, 0xf14687e4, 0x59c36f00, 0x59c36f00, 0xc01ee8bb, 0xc01ee8bb, 0xc01ee8bb, 0xbe9e85dd, 0xbe9e85dd, 0xbe9e85dd, 0xdc68900f, 0xdc68900f, 0xdc68900f, 0x59c36f00, 0xf14687e4, 0xf14687e4, 0x59c36f00, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x19a66482, 0xba12148e, 0x19a66482, 0x37a3e1fd, 0xaa4593fe, 0xaa4593fe, 0xfa4f54c9, 0xfa4f54c9, 0xfa4f54c9, 0x5cba59ae, 0x5cba59ae, 0x5cba59ae, 0x7182f2d6, 0x7182f2d6, 0x7182f2d6, 0xaa4593fe, 0x37a3e1fd, 0x37a3e1fd, 0xaa4593fe, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x6a5ddfe7, 0xc898195a, 0x6a5ddfe7, 0x374ab263, 0xc9cbf769, 0xc9cbf769, 0x7a6a0afe, 0x7a6a0afe, 0x7a6a0afe, 0x84b2cb32, 0x84b2cb32, 0x84b2cb32, 0x6df8743a, 0x6df8743a, 0x6df8743a, 0xc9cbf769, 0x374ab263, 0x374ab263, 0xc9cbf769, }, 20 }, + { "gfxterm_cyr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0xb6ca222a, 0x98e6c241, 0xb6ca222a, 0x189c6bf2, 0x9813a416, 0x9813a416, 0x7fad8eb7, 0x7fad8eb7, 0x7fad8eb7, 0xee760884, 0xee760884, 0xee760884, 0xf7cc3554, 0xf7cc3554, 0xf7cc3554, 0x9813a416, 0x189c6bf2, 0x189c6bf2, 0x9813a416, }, 20 }, + { "gfxterm_cyr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x726d82d0, 0xe9c535bd, 0x726d82d0, 0x4cbb763, 0x5fcf013d, 0x5fcf013d, 0xf99de8d5, 0xf99de8d5, 0xf99de8d5, 0x2b8df0a3, 0x2b8df0a3, 0x2b8df0a3, 0x3dfecf3c, 0x3dfecf3c, 0x3dfecf3c, 0x5fcf013d, 0x4cbb763, 0x4cbb763, 0x5fcf013d, }, 20 }, + { "gfxterm_cyr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xfe26fef7, 0x6031c462, 0xfe26fef7, 0xe52324f0, 0xdd28f52b, 0xdd28f52b, 0x84ff6e38, 0x84ff6e38, 0x84ff6e38, 0xa5c397dc, 0xa5c397dc, 0xa5c397dc, 0xd87b5c50, 0xd87b5c50, 0xd87b5c50, 0xdd28f52b, 0xe52324f0, 0xe52324f0, 0xdd28f52b, }, 20 }, + { "gfxterm_cyr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x25e34f8a, 0x67935e5e, 0x25e34f8a, 0xda5c540a, 0x43d1f34, 0x43d1f34, 0x7ebdd748, 0x7ebdd748, 0x7ebdd748, 0x1b77ee0, 0x1b77ee0, 0x1b77ee0, 0x98e67b66, 0x98e67b66, 0x98e67b66, 0x43d1f34, 0xda5c540a, 0xda5c540a, 0x43d1f34, }, 20 }, + { "gfxterm_heb", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x67038f5e, 0x65d6007f, 0x67038f5e, 0x24f54219, 0x59c36f00, 0x59c36f00, 0xac294ffd, 0xac294ffd, 0xac294ffd, 0xd2a9229b, 0xd2a9229b, 0xd2a9229b, 0xb05f3749, 0xb05f3749, 0xb05f3749, 0x59c36f00, 0x24f54219, 0x24f54219, 0x59c36f00, }, 20 }, + { "gfxterm_heb", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x944464c7, 0x27123864, 0x944464c7, 0xba41e1b8, 0xaa4593fe, 0xaa4593fe, 0xa521274, 0xa521274, 0xa521274, 0xaca71f13, 0xaca71f13, 0xaca71f13, 0x819fb46b, 0x819fb46b, 0x819fb46b, 0xaa4593fe, 0xba41e1b8, 0xba41e1b8, 0xaa4593fe, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xfe97adaf, 0x4f3307d4, 0xfe97adaf, 0xa380c02b, 0xc9cbf769, 0xc9cbf769, 0xd202ced6, 0xd202ced6, 0xd202ced6, 0x2cda0f1a, 0x2cda0f1a, 0x2cda0f1a, 0xc590b012, 0xc590b012, 0xc590b012, 0xc9cbf769, 0xa380c02b, 0xa380c02b, 0xc9cbf769, }, 20 }, + { "gfxterm_heb", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x5b32a9ba, 0xaf93fd91, 0x5b32a9ba, 0xf564e062, 0x9813a416, 0x9813a416, 0xcfdbc809, 0xcfdbc809, 0xcfdbc809, 0x5e004e3a, 0x5e004e3a, 0x5e004e3a, 0x47ba73ea, 0x47ba73ea, 0x47ba73ea, 0x9813a416, 0xf564e062, 0xf564e062, 0x9813a416, }, 20 }, + { "gfxterm_heb", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x5e0e1ce8, 0x7ed1c9ee, 0x5e0e1ce8, 0x28a8295b, 0x5fcf013d, 0x5fcf013d, 0x615f5762, 0x615f5762, 0x615f5762, 0xb34f4f14, 0xb34f4f14, 0xb34f4f14, 0xa53c708b, 0xa53c708b, 0xa53c708b, 0x5fcf013d, 0x28a8295b, 0x28a8295b, 0x5fcf013d, }, 20 }, + { "gfxterm_heb", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xa473184a, 0x93eaf325, 0xa473184a, 0xbf76c24d, 0xdd28f52b, 0xdd28f52b, 0x714dd1f7, 0x714dd1f7, 0x714dd1f7, 0x50712813, 0x50712813, 0x50712813, 0x2dc9e39f, 0x2dc9e39f, 0x2dc9e39f, 0xdd28f52b, 0xbf76c24d, 0xbf76c24d, 0xdd28f52b, }, 20 }, + { "gfxterm_heb", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xa725578b, 0x81889cf9, 0xa725578b, 0x589a4c0b, 0x43d1f34, 0x43d1f34, 0xf25ab3a8, 0xf25ab3a8, 0xf25ab3a8, 0x8d501a00, 0x8d501a00, 0x8d501a00, 0x14011f86, 0x14011f86, 0x14011f86, 0x43d1f34, 0x589a4c0b, 0x589a4c0b, 0x43d1f34, }, 20 }, + { "gfxterm_gre", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xd69cdcbf, 0x6ad9ce85, 0xd69cdcbf, 0x956a11f8, 0x59c36f00, 0x59c36f00, 0xc4c10e6a, 0xc4c10e6a, 0xc4c10e6a, 0xba41630c, 0xba41630c, 0xba41630c, 0xd8b776de, 0xd8b776de, 0xd8b776de, 0x59c36f00, 0x956a11f8, 0x956a11f8, 0x59c36f00, }, 20 }, + { "gfxterm_gre", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x1acffa1b, 0xecff2136, 0x1acffa1b, 0x34ca7f64, 0xaa4593fe, 0xaa4593fe, 0xb57c29cc, 0xb57c29cc, 0xb57c29cc, 0x138924ab, 0x138924ab, 0x138924ab, 0x3eb18fd3, 0x3eb18fd3, 0x3eb18fd3, 0xaa4593fe, 0x34ca7f64, 0x34ca7f64, 0xaa4593fe, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x1cf8992, 0xb2c51b4c, 0x1cf8992, 0x5cd8e416, 0xc9cbf769, 0xc9cbf769, 0xba7b2d22, 0xba7b2d22, 0xba7b2d22, 0x44a3ecee, 0x44a3ecee, 0x44a3ecee, 0xade953e6, 0xade953e6, 0xade953e6, 0xc9cbf769, 0x5cd8e416, 0x5cd8e416, 0xc9cbf769, }, 20 }, + { "gfxterm_gre", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1f39da0b, 0x6a7f5378, 0x1f39da0b, 0xb16f93d3, 0x9813a416, 0x9813a416, 0x8e8a2ed7, 0x8e8a2ed7, 0x8e8a2ed7, 0x1f51a8e4, 0x1f51a8e4, 0x1f51a8e4, 0x6eb9534, 0x6eb9534, 0x6eb9534, 0x9813a416, 0xb16f93d3, 0xb16f93d3, 0x9813a416, }, 20 }, + { "gfxterm_gre", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x27394d6b, 0x459337bf, 0x27394d6b, 0x519f78d8, 0x5fcf013d, 0x5fcf013d, 0x66ed4571, 0x66ed4571, 0x66ed4571, 0xb4fd5d07, 0xb4fd5d07, 0xb4fd5d07, 0xa28e6298, 0xa28e6298, 0xa28e6298, 0x5fcf013d, 0x519f78d8, 0x519f78d8, 0x5fcf013d, }, 20 }, + { "gfxterm_gre", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x624e1f92, 0x4be3bd84, 0x624e1f92, 0x794bc595, 0xdd28f52b, 0xdd28f52b, 0xd33767c, 0xd33767c, 0xd33767c, 0x2c0f8f98, 0x2c0f8f98, 0x2c0f8f98, 0x51b74414, 0x51b74414, 0x51b74414, 0xdd28f52b, 0x794bc595, 0x794bc595, 0xdd28f52b, }, 20 }, + { "gfxterm_gre", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xbf5dab2e, 0x4747516, 0xbf5dab2e, 0x40e2b0ae, 0x43d1f34, 0x43d1f34, 0x3cc1d2dd, 0x3cc1d2dd, 0x3cc1d2dd, 0x43cb7b75, 0x43cb7b75, 0x43cb7b75, 0xda9a7ef3, 0xda9a7ef3, 0xda9a7ef3, 0x43d1f34, 0x40e2b0ae, 0x40e2b0ae, 0x43d1f34, }, 20 }, + { "gfxterm_ru", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x2e284303, 0x169e4b98, 0x2e284303, 0x6dde8e44, 0x59c36f00, 0x59c36f00, 0xd2e0cf68, 0xd2e0cf68, 0xd2e0cf68, 0xac60a20e, 0xac60a20e, 0xac60a20e, 0xce96b7dc, 0xce96b7dc, 0xce96b7dc, 0x59c36f00, 0x6dde8e44, 0x6dde8e44, 0x59c36f00, }, 20 }, + { "gfxterm_ru", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3a911f8f, 0xe5d171c6, 0x3a911f8f, 0x14949af0, 0xaa4593fe, 0xaa4593fe, 0xe7c628ac, 0xe7c628ac, 0xe7c628ac, 0x413325cb, 0x413325cb, 0x413325cb, 0x6c0b8eb3, 0x6c0b8eb3, 0x6c0b8eb3, 0xaa4593fe, 0x14949af0, 0x14949af0, 0xaa4593fe, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xa4645fb3, 0x8af97df0, 0xa4645fb3, 0xf9733237, 0xc9cbf769, 0xc9cbf769, 0xef376611, 0xef376611, 0xef376611, 0x11efa7dd, 0x11efa7dd, 0x11efa7dd, 0xf8a518d5, 0xf8a518d5, 0xf8a518d5, 0xc9cbf769, 0xf9733237, 0xf9733237, 0xc9cbf769, }, 20 }, + { "gfxterm_ru", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x7c3a337b, 0xed3f1a6, 0x7c3a337b, 0xd26c7aa3, 0x9813a416, 0x9813a416, 0x86aa8146, 0x86aa8146, 0x86aa8146, 0x17710775, 0x17710775, 0x17710775, 0xecb3aa5, 0xecb3aa5, 0xecb3aa5, 0x9813a416, 0xd26c7aa3, 0xd26c7aa3, 0x9813a416, }, 20 }, + { "gfxterm_ru", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x9f31781b, 0xb6d3e547, 0x9f31781b, 0xe9974da8, 0x5fcf013d, 0x5fcf013d, 0x3781245e, 0x3781245e, 0x3781245e, 0xe5913c28, 0xe5913c28, 0xe5913c28, 0xf3e203b7, 0xf3e203b7, 0xf3e203b7, 0x5fcf013d, 0xe9974da8, 0xe9974da8, 0x5fcf013d, }, 20 }, + { "gfxterm_ru", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xfc18d24f, 0x70ed44c6, 0xfc18d24f, 0xe71d0848, 0xdd28f52b, 0xdd28f52b, 0xc847f61f, 0xc847f61f, 0xc847f61f, 0xe97b0ffb, 0xe97b0ffb, 0xe97b0ffb, 0x94c3c477, 0x94c3c477, 0x94c3c477, 0xdd28f52b, 0xe71d0848, 0xe71d0848, 0xdd28f52b, }, 20 }, + { "gfxterm_ru", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x7bb91866, 0xc4777a1f, 0x7bb91866, 0x840603e6, 0x43d1f34, 0x43d1f34, 0x2a49c131, 0x2a49c131, 0x2a49c131, 0x55436899, 0x55436899, 0x55436899, 0xcc126d1f, 0xcc126d1f, 0xcc126d1f, 0x43d1f34, 0x840603e6, 0x840603e6, 0x43d1f34, }, 20 }, + { "gfxterm_fr", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xa0d0faff, 0x8b37dfcd, 0xa0d0faff, 0xe32637b8, 0x59c36f00, 0x59c36f00, 0x94e6a8c7, 0x94e6a8c7, 0x94e6a8c7, 0xea66c5a1, 0xea66c5a1, 0xea66c5a1, 0x8890d073, 0x8890d073, 0x8890d073, 0x59c36f00, 0xe32637b8, 0xe32637b8, 0x59c36f00, }, 20 }, + { "gfxterm_fr", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x4436bcdb, 0xb3a12b62, 0x4436bcdb, 0x6a3339a4, 0xaa4593fe, 0xaa4593fe, 0x53ef9b82, 0x53ef9b82, 0x53ef9b82, 0xf51a96e5, 0xf51a96e5, 0xf51a96e5, 0xd8223d9d, 0xd8223d9d, 0xd8223d9d, 0xaa4593fe, 0x6a3339a4, 0x6a3339a4, 0xaa4593fe, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xb8e59140, 0x2463e41f, 0xb8e59140, 0xe5f2fcc4, 0xc9cbf769, 0xc9cbf769, 0xc31681f4, 0xc31681f4, 0xc31681f4, 0x3dce4038, 0x3dce4038, 0x3dce4038, 0xd484ff30, 0xd484ff30, 0xd484ff30, 0xc9cbf769, 0xe5f2fcc4, 0xe5f2fcc4, 0xc9cbf769, }, 20 }, + { "gfxterm_fr", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x438b3fcc, 0x7ebfbfd, 0x438b3fcc, 0xeddd7614, 0x9813a416, 0x9813a416, 0x8ac4ae20, 0x8ac4ae20, 0x8ac4ae20, 0x1b1f2813, 0x1b1f2813, 0x1b1f2813, 0x2a515c3, 0x2a515c3, 0x2a515c3, 0x9813a416, 0xeddd7614, 0xeddd7614, 0x9813a416, }, 20 }, + { "gfxterm_fr", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xf9eea896, 0x25a51233, 0xf9eea896, 0x8f489d25, 0x5fcf013d, 0x5fcf013d, 0x62e37cf8, 0x62e37cf8, 0x62e37cf8, 0xb0f3648e, 0xb0f3648e, 0xb0f3648e, 0xa6805b11, 0xa6805b11, 0xa6805b11, 0x5fcf013d, 0x8f489d25, 0x8f489d25, 0x5fcf013d, }, 20 }, + { "gfxterm_fr", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x9b617752, 0xb06817b5, 0x9b617752, 0x8064ad55, 0xdd28f52b, 0xdd28f52b, 0x38159b7a, 0x38159b7a, 0x38159b7a, 0x1929629e, 0x1929629e, 0x1929629e, 0x6491a912, 0x6491a912, 0x6491a912, 0xdd28f52b, 0x8064ad55, 0x8064ad55, 0xdd28f52b, }, 20 }, + { "gfxterm_fr", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x595e29e, 0xc043d961, 0x595e29e, 0xfa2af91e, 0x43d1f34, 0x43d1f34, 0x6d6b2915, 0x6d6b2915, 0x6d6b2915, 0x126180bd, 0x126180bd, 0x126180bd, 0x8b30853b, 0x8b30853b, 0x8b30853b, 0x43d1f34, 0xfa2af91e, 0xfa2af91e, 0x43d1f34, }, 20 }, + { "gfxterm_quot", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x63e24d8a, 0x52da109, 0x63e24d8a, 0x201480cd, 0x59c36f00, 0x59c36f00, 0xd3a0a4df, 0xd3a0a4df, 0xd3a0a4df, 0xad20c9b9, 0xad20c9b9, 0xad20c9b9, 0xcfd6dc6b, 0xcfd6dc6b, 0xcfd6dc6b, 0x59c36f00, 0x201480cd, 0x201480cd, 0x59c36f00, }, 20 }, + { "gfxterm_quot", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x1b2e61c9, 0xbf04e671, 0x1b2e61c9, 0x352be4b6, 0xaa4593fe, 0xaa4593fe, 0x86e14b09, 0x86e14b09, 0x86e14b09, 0x2014466e, 0x2014466e, 0x2014466e, 0xd2ced16, 0xd2ced16, 0xd2ced16, 0xaa4593fe, 0x352be4b6, 0x352be4b6, 0xaa4593fe, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xefcce0d0, 0x5540bf08, 0xefcce0d0, 0xb2db8d54, 0xc9cbf769, 0xc9cbf769, 0xf2a2bdc8, 0xf2a2bdc8, 0xf2a2bdc8, 0xc7a7c04, 0xc7a7c04, 0xc7a7c04, 0xe530c30c, 0xe530c30c, 0xe530c30c, 0xc9cbf769, 0xb2db8d54, 0xb2db8d54, 0xc9cbf769, }, 20 }, + { "gfxterm_quot", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x65a5505e, 0xd6055969, 0x65a5505e, 0xcbf31986, 0x9813a416, 0x9813a416, 0xbd3bd80c, 0xbd3bd80c, 0xbd3bd80c, 0x2ce05e3f, 0x2ce05e3f, 0x2ce05e3f, 0x355a63ef, 0x355a63ef, 0x355a63ef, 0x9813a416, 0xcbf31986, 0xcbf31986, 0x9813a416, }, 20 }, + { "gfxterm_quot", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x7319d06, 0x17c78667, 0x7319d06, 0x7197a8b5, 0x5fcf013d, 0x5fcf013d, 0xbe43bf51, 0xbe43bf51, 0xbe43bf51, 0x6c53a727, 0x6c53a727, 0x6c53a727, 0x7a2098b8, 0x7a2098b8, 0x7a2098b8, 0x5fcf013d, 0x7197a8b5, 0x7197a8b5, 0x5fcf013d, }, 20 }, + { "gfxterm_quot", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x723a247, 0x535b0699, 0x723a247, 0x1c267840, 0xdd28f52b, 0xdd28f52b, 0xcdf3c404, 0xcdf3c404, 0xcdf3c404, 0xeccf3de0, 0xeccf3de0, 0xeccf3de0, 0x9177f66c, 0x9177f66c, 0x9177f66c, 0xdd28f52b, 0x1c267840, 0x1c267840, 0xdd28f52b, }, 20 }, + { "gfxterm_quot", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xe3a20cf8, 0x4833db45, 0xe3a20cf8, 0x1c1d1778, 0x43d1f34, 0x43d1f34, 0x252c3625, 0x252c3625, 0x252c3625, 0x5a269f8d, 0x5a269f8d, 0x5a269f8d, 0xc3779a0b, 0xc3779a0b, 0xc3779a0b, 0x43d1f34, 0x1c1d1778, 0x1c1d1778, 0x43d1f34, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x24b38cd5, 0x6b033831, 0x24b38cd5, 0x67454192, 0x59c36f00, 0x59c36f00, 0xc12f3297, 0xc12f3297, 0xc12f3297, 0xbfaf5ff1, 0xbfaf5ff1, 0xbfaf5ff1, 0xdd594a23, 0xdd594a23, 0xdd594a23, 0x59c36f00, 0x67454192, 0x67454192, 0x59c36f00, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x54f09885, 0x5d94ace6, 0x54f09885, 0x7af51dfa, 0xaa4593fe, 0xaa4593fe, 0xe3a05427, 0xe3a05427, 0xe3a05427, 0x45555940, 0x45555940, 0x45555940, 0x686df238, 0x686df238, 0x686df238, 0xaa4593fe, 0x7af51dfa, 0x7af51dfa, 0xaa4593fe, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x53c2ee74, 0x92931869, 0x53c2ee74, 0xed583f0, 0xc9cbf769, 0xc9cbf769, 0x76afdc1b, 0x76afdc1b, 0x76afdc1b, 0x88771dd7, 0x88771dd7, 0x88771dd7, 0x613da2df, 0x613da2df, 0x613da2df, 0xc9cbf769, 0xed583f0, 0xed583f0, 0xc9cbf769, }, 20 }, + { "gfxterm_piglatin", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x4e5ded6f, 0x12bf47c3, 0x4e5ded6f, 0xe00ba4b7, 0x9813a416, 0x9813a416, 0x72c4cb9c, 0x72c4cb9c, 0x72c4cb9c, 0xe31f4daf, 0xe31f4daf, 0xe31f4daf, 0xfaa5707f, 0xfaa5707f, 0xfaa5707f, 0x9813a416, 0xe00ba4b7, 0xe00ba4b7, 0x9813a416, }, 20 }, + { "gfxterm_piglatin", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x3566adf6, 0x4c7649cf, 0x3566adf6, 0x43c09845, 0x5fcf013d, 0x5fcf013d, 0xc2b479f, 0xc2b479f, 0xc2b479f, 0xde3b5fe9, 0xde3b5fe9, 0xde3b5fe9, 0xc8486076, 0xc8486076, 0xc8486076, 0x5fcf013d, 0x43c09845, 0x43c09845, 0x5fcf013d, }, 20 }, + { "gfxterm_piglatin", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xec1bda0d, 0x86636a33, 0xec1bda0d, 0xf71e000a, 0xdd28f52b, 0xdd28f52b, 0xda5ce270, 0xda5ce270, 0xda5ce270, 0xfb601b94, 0xfb601b94, 0xfb601b94, 0x86d8d018, 0x86d8d018, 0x86d8d018, 0xdd28f52b, 0xf71e000a, 0xf71e000a, 0xdd28f52b, }, 20 }, + { "gfxterm_piglatin", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x619415be, 0x92024b97, 0x619415be, 0x9e2b0e3e, 0x43d1f34, 0x43d1f34, 0xfa2f329, 0xfa2f329, 0xfa2f329, 0x70a85a81, 0x70a85a81, 0x70a85a81, 0xe9f95f07, 0xe9f95f07, 0xe9f95f07, 0x43d1f34, 0x9e2b0e3e, 0x9e2b0e3e, 0x43d1f34, }, 20 }, + { "gfxterm_ch", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x200688e1, 0x1274a595, 0x200688e1, 0x63f045a6, 0x59c36f00, 0x59c36f00, 0x2312e40c, 0x2312e40c, 0x2312e40c, 0x5d92896a, 0x5d92896a, 0x5d92896a, 0x3f649cb8, 0x3f649cb8, 0x3f649cb8, 0x59c36f00, 0x63f045a6, 0x63f045a6, 0x59c36f00, }, 20 }, + { "gfxterm_ch", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xa943b821, 0x8aa682a4, 0xa943b821, 0x87463d5e, 0xaa4593fe, 0xaa4593fe, 0xff049fb7, 0xff049fb7, 0xff049fb7, 0x59f192d0, 0x59f192d0, 0x59f192d0, 0x74c939a8, 0x74c939a8, 0x74c939a8, 0xaa4593fe, 0x87463d5e, 0x87463d5e, 0xaa4593fe, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0x11b6367b, 0x27bbcfb4, 0x11b6367b, 0x4ca15bff, 0xc9cbf769, 0xc9cbf769, 0x51f424d6, 0x51f424d6, 0x51f424d6, 0xaf2ce51a, 0xaf2ce51a, 0xaf2ce51a, 0x46665a12, 0x46665a12, 0x46665a12, 0xc9cbf769, 0x4ca15bff, 0x4ca15bff, 0xc9cbf769, }, 20 }, + { "gfxterm_ch", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x7c16ec93, 0xe9d7d93f, 0x7c16ec93, 0xd240a54b, 0x9813a416, 0x9813a416, 0x9e5c75d9, 0x9e5c75d9, 0x9e5c75d9, 0xf87f3ea, 0xf87f3ea, 0xf87f3ea, 0x163dce3a, 0x163dce3a, 0x163dce3a, 0x9813a416, 0xd240a54b, 0xd240a54b, 0x9813a416, }, 20 }, + { "gfxterm_ch", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0xe28608ec, 0x3575a25f, 0xe28608ec, 0x94203d5f, 0x5fcf013d, 0x5fcf013d, 0x7c6f7c86, 0x7c6f7c86, 0x7c6f7c86, 0xae7f64f0, 0xae7f64f0, 0xae7f64f0, 0xb80c5b6f, 0xb80c5b6f, 0xb80c5b6f, 0x5fcf013d, 0x94203d5f, 0x94203d5f, 0x5fcf013d, }, 20 }, + { "gfxterm_ch", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xb510e48, 0x9406b857, 0xb510e48, 0x1054d44f, 0xdd28f52b, 0xdd28f52b, 0x13c76182, 0x13c76182, 0x13c76182, 0x32fb9866, 0x32fb9866, 0x32fb9866, 0x4f4353ea, 0x4f4353ea, 0x4f4353ea, 0xdd28f52b, 0x1054d44f, 0x1054d44f, 0xdd28f52b, }, 20 }, + { "gfxterm_ch", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf256eb36, 0xaed7d845, 0xf256eb36, 0xde9f0b6, 0x43d1f34, 0x43d1f34, 0xbe644e0c, 0xbe644e0c, 0xbe644e0c, 0xc16ee7a4, 0xc16ee7a4, 0xc16ee7a4, 0x583fe222, 0x583fe222, 0x583fe222, 0x43d1f34, 0xde9f0b6, 0xde9f0b6, 0x43d1f34, }, 20 }, + { "gfxterm_red", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0xe382dd9, 0x68f7c15a, 0xe382dd9, 0x59159307, 0x59c36f00, 0x59c36f00, 0xba01eaa9, 0xba01eaa9, 0xba01eaa9, 0xc48187cf, 0xc48187cf, 0xc48187cf, 0xa677921d, 0xa677921d, 0xa677921d, 0x59c36f00, 0x59159307, 0x59159307, 0x59c36f00, }, 20 }, + { "gfxterm_red", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0x3c908c, 0xa4161734, 0x3c908c, 0xb09b4ada, 0xaa4593fe, 0xaa4593fe, 0xdfbf1f3, 0xdfbf1f3, 0xdfbf1f3, 0xab0efc94, 0xab0efc94, 0xab0efc94, 0x863657ec, 0x863657ec, 0x863657ec, 0xaa4593fe, 0xb09b4ada, 0xb09b4ada, 0xaa4593fe, }, 20 }, + { "gfxterm_red", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xd2e9527, 0xb7a2caff, 0xd2e9527, 0x1d0b8b89, 0xc9cbf769, 0xc9cbf769, 0x6684aa7f, 0x6684aa7f, 0x6684aa7f, 0x985c6bb3, 0x985c6bb3, 0x985c6bb3, 0x7116d4bb, 0x7116d4bb, 0x7116d4bb, 0xc9cbf769, 0x1d0b8b89, 0x1d0b8b89, 0xc9cbf769, }, 20 }, + { "gfxterm_red", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x1639705d, 0xa599796a, 0x1639705d, 0x26488c72, 0x9813a416, 0x9813a416, 0x49b2de5c, 0x49b2de5c, 0x49b2de5c, 0xd869586f, 0xd869586f, 0xd869586f, 0xc1d365bf, 0xc1d365bf, 0xc1d365bf, 0x9813a416, 0x26488c72, 0x26488c72, 0x9813a416, }, 20 }, + { "gfxterm_red", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x10d0c422, 0x26df43, 0x10d0c422, 0xbed72bd7, 0x5fcf013d, 0x5fcf013d, 0x67d73911, 0x67d73911, 0x67d73911, 0xb5c72167, 0xb5c72167, 0xb5c72167, 0xa3b41ef8, 0xa3b41ef8, 0xa3b41ef8, 0x5fcf013d, 0xbed72bd7, 0xbed72bd7, 0x5fcf013d, }, 20 }, + { "gfxterm_red", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0xdd34e67a, 0x894c42a4, 0xdd34e67a, 0x53502da0, 0xdd28f52b, 0xdd28f52b, 0x886a111, 0x886a111, 0x886a111, 0x29ba58f5, 0x29ba58f5, 0x29ba58f5, 0x54029379, 0x54029379, 0x54029379, 0xdd28f52b, 0x53502da0, 0x53502da0, 0xdd28f52b, }, 20 }, + { "gfxterm_red", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0x410b50fc, 0xea9a8741, 0x410b50fc, 0xd653d65c, 0x43d1f34, 0x43d1f34, 0xcdea4de5, 0xcdea4de5, 0xcdea4de5, 0xb2e0e44d, 0xb2e0e44d, 0xb2e0e44d, 0x2bb1e1cb, 0x2bb1e1cb, 0x2bb1e1cb, 0x43d1f34, 0xd653d65c, 0xd653d65c, 0x43d1f34, }, 20 }, + { "gfxterm_high", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x59c36f00, 0x4c09d761, 0x2ac63be2, 0x4c09d761, 0xf44378ab, 0x59c36f00, 0x59c36f00, 0xd3a0a4df, 0xd3a0a4df, 0xd3a0a4df, 0xad20c9b9, 0xad20c9b9, 0xad20c9b9, 0xcfd6dc6b, 0xcfd6dc6b, 0xcfd6dc6b, 0x59c36f00, 0xf44378ab, 0xf44378ab, 0x59c36f00, }, 20 }, + { "gfxterm_high", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0xaa4593fe, 0xd3c0fce6, 0x77ea7b5e, 0xd3c0fce6, 0x10463469, 0xaa4593fe, 0xaa4593fe, 0x86e14b09, 0x86e14b09, 0x86e14b09, 0x2014466e, 0x2014466e, 0x2014466e, 0xd2ced16, 0xd2ced16, 0xd2ced16, 0xaa4593fe, 0x10463469, 0x10463469, 0xaa4593fe, }, 20 }, + { "gfxterm_high", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xc9cbf769, 0xabafd82f, 0x112387f7, 0xabafd82f, 0xe9ca2412, 0xc9cbf769, 0xc9cbf769, 0xf2a2bdc8, 0xf2a2bdc8, 0xf2a2bdc8, 0xc7a7c04, 0xc7a7c04, 0xc7a7c04, 0xe530c30c, 0xe530c30c, 0xe530c30c, 0xc9cbf769, 0xe9ca2412, 0xe9ca2412, 0xc9cbf769, }, 20 }, + { "gfxterm_high", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x9813a416, 0x2b138245, 0x98b38b72, 0x2b138245, 0x6500200c, 0x9813a416, 0x9813a416, 0xbd3bd80c, 0xbd3bd80c, 0xbd3bd80c, 0x2ce05e3f, 0x2ce05e3f, 0x2ce05e3f, 0x355a63ef, 0x355a63ef, 0x355a63ef, 0x9813a416, 0x6500200c, 0x6500200c, 0x9813a416, }, 20 }, + { "gfxterm_high", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x5fcf013d, 0x87f97368, 0x970f6809, 0x87f97368, 0x149f7c5f, 0x5fcf013d, 0x5fcf013d, 0xbe43bf51, 0xbe43bf51, 0xbe43bf51, 0x6c53a727, 0x6c53a727, 0x6c53a727, 0x7a2098b8, 0x7a2098b8, 0x7a2098b8, 0x5fcf013d, 0x149f7c5f, 0x149f7c5f, 0x5fcf013d, }, 20 }, + { "gfxterm_high", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xdd28f52b, 0x12986e14, 0x46e0caca, 0x12986e14, 0xf51eaa4a, 0xdd28f52b, 0xdd28f52b, 0xcdf3c404, 0xcdf3c404, 0xcdf3c404, 0xeccf3de0, 0xeccf3de0, 0xeccf3de0, 0x9177f66c, 0x9177f66c, 0x9177f66c, 0xdd28f52b, 0xf51eaa4a, 0xf51eaa4a, 0xdd28f52b, }, 20 }, + { "gfxterm_high", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x43d1f34, 0xf6aab2f6, 0x5d3b654b, 0xf6aab2f6, 0x8e22ec59, 0x43d1f34, 0x43d1f34, 0x252c3625, 0x252c3625, 0x252c3625, 0x5a269f8d, 0x5a269f8d, 0x5a269f8d, 0xc3779a0b, 0xc3779a0b, 0xc3779a0b, 0x43d1f34, 0x8e22ec59, 0x8e22ec59, 0x43d1f34, }, 20 }, + { "videotest", 640, 480, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi16 */, (grub_uint32_t []) { 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, 0x1368a483, }, 5 }, + { "videotest", 800, 600, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi16 */, (grub_uint32_t []) { 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, 0x7033079c, }, 5 }, + { "videotest", 1024, 768, 0x2, 16, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi16 */, (grub_uint32_t []) { 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, 0xff583fbf, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 640x480xrgba8888 */, (grub_uint32_t []) { 0x4c2cef83, 0x1b215a88, 0xe2378595, 0xb53a309e, 0x15f64d5e, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 800x600xrgba8888 */, (grub_uint32_t []) { 0x758f388c, 0xd4442397, 0x33f5784b, 0x923e6350, 0xf97bb902, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 1024x768xrgba8888 */, (grub_uint32_t []) { 0xb9f6f52a, 0x4e24e8b7, 0x53beb8e1, 0xa46ca57c, 0x688a184d, }, 5 }, + { "videotest", 2560, 1440, 0x1, 256, 32, 4, 16, 8, 8, 8, 0, 8, 24, 8 /* 2560x1440xrgba8888 */, (grub_uint32_t []) { 0x5bd98ce3, 0x15df7962, 0xc7d467e1, 0x89d29260, 0x662e2c16, }, 5 }, + { "videotest", 640, 480, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 640x480xi256 */, (grub_uint32_t []) { 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, 0xf9847b65, }, 5 }, + { "videotest", 800, 600, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 800x600xi256 */, (grub_uint32_t []) { 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, 0xc421716d, }, 5 }, + { "videotest", 1024, 768, 0x2, 256, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0 /* 1024x768xi256 */, (grub_uint32_t []) { 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, 0x5d46f2a8, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 640x480xrgba5550 */, (grub_uint32_t []) { 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, 0x25690db2, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 800x600xrgba5550 */, (grub_uint32_t []) { 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, 0x7333f220, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 15, 2, 10, 5, 5, 5, 0, 5, 0, 0 /* 1024x768xrgba5550 */, (grub_uint32_t []) { 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, 0xac52d537, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 640x480xrgba5650 */, (grub_uint32_t []) { 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, 0xd4cbcd66, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 800x600xrgba5650 */, (grub_uint32_t []) { 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, 0x9d23f9d1, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 16, 2, 11, 5, 5, 6, 0, 5, 0, 0 /* 1024x768xrgba5650 */, (grub_uint32_t []) { 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, 0x89acbf88, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 640x480xrgba8880 */, (grub_uint32_t []) { 0x335fadcb, 0x1f517b5c, 0x6b4200e5, 0x474cd672, 0x8364f797, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 800x600xrgba8880 */, (grub_uint32_t []) { 0xcf9985f8, 0x1d92c7fc, 0x6e637701, 0xbc683505, 0x898016fb, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 24, 3, 16, 8, 8, 8, 0, 8, 0, 0 /* 1024x768xrgba8880 */, (grub_uint32_t []) { 0xdb824190, 0x378d05dc, 0x670bff9, 0xea7ffbb5, 0x658bcbb3, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 640x480xbgra5550 */, (grub_uint32_t []) { 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, 0x18ed532e, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 800x600xbgra5550 */, (grub_uint32_t []) { 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, 0x2b35b09f, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 15, 2, 0, 5, 5, 5, 10, 5, 0, 0 /* 1024x768xbgra5550 */, (grub_uint32_t []) { 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, 0xa24c4d98, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 640x480xbgra5650 */, (grub_uint32_t []) { 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, 0xc07dde33, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 800x600xbgra5650 */, (grub_uint32_t []) { 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, 0x7e6ed757, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 16, 2, 0, 5, 5, 6, 11, 5, 0, 0 /* 1024x768xbgra5650 */, (grub_uint32_t []) { 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, 0x700255dd, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 640x480xbgra8880 */, (grub_uint32_t []) { 0x157232bd, 0x5e6bdacd, 0x8341e25d, 0xc8580a2d, 0x3cf9e58c, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 800x600xbgra8880 */, (grub_uint32_t []) { 0xbfafd7cd, 0x51650951, 0x67d61c04, 0x891cc298, 0xab036ae, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 24, 3, 0, 8, 8, 8, 16, 8, 0, 0 /* 1024x768xbgra8880 */, (grub_uint32_t []) { 0x760580c9, 0xdc6d8205, 0x2739f3a0, 0x8d51f16c, 0xd47d661b, }, 5 }, + { "videotest", 640, 480, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 640x480xbgra8888 */, (grub_uint32_t []) { 0xada3b5f, 0x24cd61a6, 0x56f48ead, 0x78e3d454, 0xb28750bb, }, 5 }, + { "videotest", 800, 600, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 800x600xbgra8888 */, (grub_uint32_t []) { 0x827694e2, 0x9d97c3dd, 0xbdb43a9c, 0xa2556da3, 0xfdf3c81e, }, 5 }, + { "videotest", 1024, 768, 0x1, 256, 32, 4, 0, 8, 8, 8, 16, 8, 24, 8 /* 1024x768xbgra8888 */, (grub_uint32_t []) { 0x664534a5, 0xcd0979a0, 0x3531d85e, 0x9e7d955b, 0xc0aced53, }, 5 }, diff --git a/grub-core/tests/sleep_test.c b/grub-core/tests/sleep_test.c index 3dda30312..3d11c717c 100644 --- a/grub-core/tests/sleep_test.c +++ b/grub-core/tests/sleep_test.c @@ -33,12 +33,19 @@ sleep_test (void) { struct grub_datetime st, en; grub_int32_t stu = 0, enu = 0; + int is_delayok; grub_test_assert (!grub_get_datetime (&st), "Couldn't retrieve start time"); grub_millisleep (10000); grub_test_assert (!grub_get_datetime (&en), "Couldn't retrieve end time"); grub_test_assert (grub_datetime2unixtime (&st, &stu), "Invalid date"); grub_test_assert (grub_datetime2unixtime (&en, &enu), "Invalid date"); - grub_test_assert (enu - stu >= 9 && enu - stu <= 11, "Interval out of range: %d", enu-stu); + is_delayok = (enu - stu >= 9 && enu - stu <= 11); +#ifdef __arm__ + /* Ignore QEMU bug */ + if (enu - stu >= 15 && enu - stu <= 17) + is_delayok = 1; +#endif + grub_test_assert (is_delayok, "Interval out of range: %d", enu-stu); } diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 8a8110241..66148f684 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -22,6 +22,8 @@ #ifndef GRUB_DSDT_TEST #include #include +#else +#define GRUB_PACKED __attribute__ ((packed)) #endif #define GRUB_RSDP_SIGNATURE "RSD PTR " @@ -219,9 +221,10 @@ enum GRUB_ACPI_OPCODE_CONCATRES = 0x84, GRUB_ACPI_OPCODE_MOD = 0x85, GRUB_ACPI_OPCODE_INDEX = 0x88, - GRUB_ACPI_OPCODE_TOSTRING = 0x9c, + GRUB_ACPI_OPCODE_CREATE_DWORD_FIELD = 0x8a, GRUB_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b, GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c, + GRUB_ACPI_OPCODE_TOSTRING = 0x9c, GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff }; enum @@ -239,6 +242,6 @@ enum }; struct grub_acpi_fadt * -grub_acpi_find_fadt (void); +EXPORT_FUNC(grub_acpi_find_fadt) (void); #endif /* ! GRUB_ACPI_HEADER */ diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h index 059dbba42..a66caad13 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -40,11 +40,7 @@ # define LINUX_PHYS_OFFSET (0x00008000) # define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000) # define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000) -static inline grub_addr_t -grub_arm_firmware_get_boot_data (void) -{ - return 0; -} +# define grub_arm_firmware_get_boot_data (grub_addr_t)grub_efi_get_firmware_fdt static inline grub_uint32_t grub_arm_firmware_get_machine_type (void) { diff --git a/include/grub/arm/uboot/kernel.h b/include/grub/arm/uboot/kernel.h index 06e543324..ce0b149cc 100644 --- a/include/grub/arm/uboot/kernel.h +++ b/include/grub/arm/uboot/kernel.h @@ -26,7 +26,7 @@ #endif /* ! ASM_FILE */ -#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000 +#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE #define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (16 * 1024 * 1024) #endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/include/grub/arm64/reloc.h b/include/grub/arm64/reloc.h index 4aed3d715..452c14822 100644 --- a/include/grub/arm64/reloc.h +++ b/include/grub/arm64/reloc.h @@ -22,5 +22,13 @@ int grub_arm_64_check_xxxx26_offset (grub_int64_t offset); void grub_arm64_set_xxxx26_offset (grub_uint32_t *place, grub_int64_t offset); +int +grub_arm64_check_hi21_signed (grub_int64_t offset); +void +grub_arm64_set_hi21 (grub_uint32_t *place, grub_int64_t offset); +void +grub_arm64_set_abs_lo12 (grub_uint32_t *place, grub_int64_t target); +void +grub_arm64_set_abs_lo12_ldst64 (grub_uint32_t *place, grub_int64_t target); #endif diff --git a/include/grub/cache.h b/include/grub/cache.h index a9b3f529c..fc669dfd1 100644 --- a/include/grub/cache.h +++ b/include/grub/cache.h @@ -35,10 +35,11 @@ void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len); #ifndef GRUB_MACHINE_EMU #ifdef _mips -void EXPORT_FUNC(grub_arch_sync_dma_caches) (void *address, grub_size_t len); +void EXPORT_FUNC(grub_arch_sync_dma_caches) (volatile void *address, + grub_size_t len); #else static inline void -grub_arch_sync_dma_caches (void *address __attribute__ ((unused)), +grub_arch_sync_dma_caches (volatile void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) { } diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 22456327e..62a3d9726 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -85,6 +85,10 @@ extern void (*EXPORT_VAR(grub_efi_net_config)) (grub_efi_handle_t hnd, char **device, char **path); +#if defined(__arm__) || defined(__aarch64__) +void *EXPORT_FUNC(grub_efi_get_firmware_fdt)(void); +#endif + grub_addr_t grub_efi_modules_addr (void); void grub_efi_mm_init (void); diff --git a/include/grub/elf.h b/include/grub/elf.h index caa796390..db15acecf 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -2068,6 +2068,9 @@ typedef Elf32_Addr Elf32_Conflict; #define R_AARCH64_NONE 0 /* No relocation. */ #define R_AARCH64_ABS64 257 /* Direct 64 bit. */ #define R_AARCH64_ABS32 258 /* Direct 32 bit. */ +#define R_AARCH64_ADR_PREL_PG_HI21 275 +#define R_AARCH64_ADD_ABS_LO12_NC 277 +#define R_AARCH64_LDST64_ABS_LO12_NC 286 #define R_AARCH64_JUMP26 282 /* 26-bit relative. */ #define R_AARCH64_CALL26 283 /* 26-bit relative. */ #define R_AARCH64_COPY 1024 /* Copy symbol at runtime. */ diff --git a/include/grub/i386/memory.h b/include/grub/i386/memory.h index c9b13288f..8bb6e1cbb 100644 --- a/include/grub/i386/memory.h +++ b/include/grub/i386/memory.h @@ -20,6 +20,8 @@ #ifndef GRUB_MEMORY_CPU_HEADER #define GRUB_MEMORY_CPU_HEADER 1 +#define PAGE_SHIFT 12 + /* The flag for protected mode. */ #define GRUB_MEMORY_CPU_CR0_PE_ON 0x1 #define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000020 @@ -31,6 +33,11 @@ #define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ #define GRUB_MEMORY_MACHINE_LOWER_SIZE GRUB_MEMORY_MACHINE_UPPER_START +/* Some PTE definitions. */ +#define GRUB_PAGE_PRESENT 0x00000001 +#define GRUB_PAGE_RW 0x00000002 +#define GRUB_PAGE_USER 0x00000004 + #ifndef ASM_FILE #define GRUB_MMAP_MALLOC_LOW 1 diff --git a/include/grub/i386/multiboot.h b/include/grub/i386/multiboot.h index a1b94883d..807a1de27 100644 --- a/include/grub/i386/multiboot.h +++ b/include/grub/i386/multiboot.h @@ -30,6 +30,17 @@ #define MULTIBOOT_MBI_REGISTER ebx #define MULTIBOOT_ARCHITECTURE_CURRENT MULTIBOOT_ARCHITECTURE_I386 +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +#define MULTIBOOT_EFI_INITIAL_STATE { .rax = MULTIBOOT_BOOTLOADER_MAGIC, \ + .rcx = 0, \ + .rdx = 0, \ + } +#define MULTIBOOT_EFI_ENTRY_REGISTER rip +#define MULTIBOOT_EFI_MBI_REGISTER rbx +#endif +#endif + #define MULTIBOOT_ELF32_MACHINE EM_386 #define MULTIBOOT_ELF64_MACHINE EM_X86_64 diff --git a/include/grub/i386/pmtimer.h b/include/grub/i386/pmtimer.h new file mode 100644 index 000000000..ac091806a --- /dev/null +++ b/include/grub/i386/pmtimer.h @@ -0,0 +1,37 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * 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 . + */ + +#ifndef KERNEL_CPU_PMTIMER_HEADER +#define KERNEL_CPU_PMTIMER_HEADER 1 + +#include +#include + +/* + Preconditions: + * Caller has ensured that both pmtimer and tsc are supported + * 1 <= num_pm_ticks <= 3580 + Return: + * Number of TSC ticks elapsed + * 0 on failure. +*/ +grub_uint64_t +EXPORT_FUNC(grub_pmtimer_wait_count_tsc) (grub_port_t pmtimer, + grub_uint16_t num_pm_ticks); + +#endif diff --git a/include/grub/i386/relocator.h b/include/grub/i386/relocator.h index 5f89a7ec8..2a56c3b54 100644 --- a/include/grub/i386/relocator.h +++ b/include/grub/i386/relocator.h @@ -65,6 +65,20 @@ struct grub_relocator64_state grub_addr_t cr3; }; +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +struct grub_relocator64_efi_state +{ + grub_uint64_t rax; + grub_uint64_t rbx; + grub_uint64_t rcx; + grub_uint64_t rdx; + grub_uint64_t rip; + grub_uint64_t rsi; +}; +#endif +#endif + grub_err_t grub_relocator16_boot (struct grub_relocator *rel, struct grub_relocator16_state state); @@ -76,4 +90,11 @@ grub_err_t grub_relocator64_boot (struct grub_relocator *rel, struct grub_relocator64_state state, grub_addr_t min_addr, grub_addr_t max_addr); +#ifdef GRUB_MACHINE_EFI +#ifdef __x86_64__ +grub_err_t grub_relocator64_efi_boot (struct grub_relocator *rel, + struct grub_relocator64_efi_state state); +#endif +#endif + #endif /* ! GRUB_RELOCATOR_CPU_HEADER */ diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h index 71fa7ca2f..a0aa2c573 100644 --- a/include/grub/i386/tsc.h +++ b/include/grub/i386/tsc.h @@ -51,4 +51,20 @@ grub_get_tsc (void) return (((grub_uint64_t) hi) << 32) | lo; } +static __inline int +grub_cpu_is_tsc_supported (void) +{ +#ifndef GRUB_MACHINE_XEN + grub_uint32_t a,b,c,d; + if (! grub_cpu_is_cpuid_supported ()) + return 0; + + grub_cpuid(1,a,b,c,d); + + return (d & (1 << 4)) != 0; +#else + return 1; +#endif +} + #endif /* ! KERNEL_CPU_TSC_HEADER */ diff --git a/include/grub/i386/xnu.h b/include/grub/i386/xnu.h index a076b8a97..062a7ddbe 100644 --- a/include/grub/i386/xnu.h +++ b/include/grub/i386/xnu.h @@ -89,7 +89,8 @@ struct grub_xnu_boot_params_v2 grub_uint64_t efi_runtime_first_page_virtual; grub_uint32_t efi_system_table; - grub_uint32_t unused2[11]; + grub_uint32_t unused2[9]; + grub_uint64_t ram_size; grub_uint64_t fsbfreq; grub_uint32_t unused3[734]; } GRUB_PACKED; diff --git a/include/grub/module_verifier.h b/include/grub/module_verifier.h new file mode 100644 index 000000000..6cddff30f --- /dev/null +++ b/include/grub/module_verifier.h @@ -0,0 +1,20 @@ +#include +#include + +#include + +#define GRUB_MODULE_VERIFY_SUPPORTS_REL 1 +#define GRUB_MODULE_VERIFY_SUPPORTS_RELA 2 + +struct grub_module_verifier_arch { + const char *name; + int voidp_sizeof; + int bigendian; + int machine; + int flags; + const int *supported_relocations; + const int *short_relocations; +}; + +void grub_module_verify64(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); +void grub_module_verify32(void *module_img, size_t module_size, const struct grub_module_verifier_arch *arch); diff --git a/include/grub/multiboot.h b/include/grub/multiboot.h index e13c0843b..c96492bb5 100644 --- a/include/grub/multiboot.h +++ b/include/grub/multiboot.h @@ -91,10 +91,28 @@ grub_multiboot_set_console (int console_type, int accepted_consoles, int console_required); grub_err_t grub_multiboot_load (grub_file_t file, const char *filename); + +struct mbi_load_data +{ + grub_file_t file; + const char *filename; + void *buffer; + unsigned int mbi_ver; + int relocatable; + grub_uint32_t min_addr; + grub_uint32_t max_addr; + grub_size_t align; + grub_uint32_t preference; + grub_uint32_t link_base_addr; + grub_uint32_t load_base_addr; + int avoid_efi_boot_services; +}; +typedef struct mbi_load_data mbi_load_data_t; + /* Load ELF32 or ELF64. */ grub_err_t -grub_multiboot_load_elf (grub_file_t file, const char *filename, - void *buffer); +grub_multiboot_load_elf (mbi_load_data_t *mld); + extern grub_size_t grub_multiboot_pure_size; extern grub_size_t grub_multiboot_alloc_mbi; extern grub_uint32_t grub_multiboot_payload_eip; diff --git a/include/grub/net.h b/include/grub/net.h index bb5e9c7c9..c51750973 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -191,6 +191,18 @@ typedef struct grub_net_network_level_netaddress }; } grub_net_network_level_netaddress_t; +struct grub_net_route +{ + struct grub_net_route *next; + struct grub_net_route **prev; + grub_net_network_level_netaddress_t target; + char *name; + struct grub_net_network_level_protocol *prot; + int is_gateway; + struct grub_net_network_level_interface *interface; + grub_net_network_level_address_t gw; +}; + #define FOR_PACKETS(cont,var) for (var = (cont).first; var; var = var->next) static inline grub_err_t @@ -368,6 +380,16 @@ grub_net_card_unregister (struct grub_net_card *card); #define FOR_NET_CARDS_SAFE(var, next) for (var = grub_net_cards, next = (var ? var->next : 0); var; var = next, next = (var ? var->next : 0)) +extern struct grub_net_route *grub_net_routes; + +static inline void +grub_net_route_register (struct grub_net_route *route) +{ + grub_list_push (GRUB_AS_LIST_P (&grub_net_routes), + GRUB_AS_LIST (route)); +} + +#define FOR_NET_ROUTES(var) for (var = grub_net_routes; var; var = var->next) struct grub_net_session * grub_net_open_tcp (char *address, grub_uint16_t port); @@ -393,7 +415,8 @@ grub_net_add_route (const char *name, grub_err_t grub_net_add_route_gw (const char *name, grub_net_network_level_netaddress_t target, - grub_net_network_level_address_t gw); + grub_net_network_level_address_t gw, + struct grub_net_network_level_interface *inter); #define GRUB_NET_BOOTP_MAC_ADDR_LEN 16 diff --git a/include/grub/offsets.h b/include/grub/offsets.h index 85e7401ae..c88c86d4d 100644 --- a/include/grub/offsets.h +++ b/include/grub/offsets.h @@ -54,6 +54,7 @@ /* The offset of GRUB_TOTAL_MODULE_SIZE. */ #define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8 +#define GRUB_KERNEL_ARM_STACK_SIZE 0x40000 #define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12 @@ -120,7 +121,6 @@ #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8 #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4 -#define GRUB_KERNEL_ARM_UBOOT_LINK_ADDR 0x08000000 /* Minimal gap between _end and the start of the modules. It's a hack for PowerMac to prevent "CLAIM failed" error. The real fix is to diff --git a/include/grub/random.h b/include/grub/random.h new file mode 100644 index 000000000..4b75c0e2b --- /dev/null +++ b/include/grub/random.h @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2016 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 . + */ + +#ifndef GRUB_RANDOM_HEADER +#define GRUB_RANDOM_HEADER 1 + +#include +#include + +/* Not peer-reviewed. May not be any better than string of zeros. */ +grub_err_t +grub_crypto_get_random (void *buffer, grub_size_t sz); + +/* Do not use directly. Use grub_crypto_get_random instead. */ +int +grub_crypto_arch_get_random (void *buffer, grub_size_t sz); + +#endif diff --git a/include/grub/types.h b/include/grub/types.h index e732efb5c..b93e48201 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -254,55 +254,49 @@ static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t _x) #endif /* ! WORDS_BIGENDIAN */ -static inline grub_uint16_t grub_get_unaligned16 (const void *ptr) +struct grub_unaligned_uint16 { - struct grub_unaligned_uint16_t - { - grub_uint16_t d; - } GRUB_PACKED; - const struct grub_unaligned_uint16_t *dd - = (const struct grub_unaligned_uint16_t *) ptr; - return dd->d; -} - -static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val) + grub_uint16_t val; +} GRUB_PACKED; +struct grub_unaligned_uint32 { - struct grub_unaligned_uint16_t - { - grub_uint16_t d; - } GRUB_PACKED; - struct grub_unaligned_uint16_t *dd = (struct grub_unaligned_uint16_t *) ptr; - dd->d = val; -} - -static inline grub_uint32_t grub_get_unaligned32 (const void *ptr) -{ - struct grub_unaligned_uint32_t - { - grub_uint32_t d; - } GRUB_PACKED; - const struct grub_unaligned_uint32_t *dd - = (const struct grub_unaligned_uint32_t *) ptr; - return dd->d; -} - -static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val) -{ - struct grub_unaligned_uint32_t - { - grub_uint32_t d; - } GRUB_PACKED; - struct grub_unaligned_uint32_t *dd = (struct grub_unaligned_uint32_t *) ptr; - dd->d = val; -} - + grub_uint32_t val; +} GRUB_PACKED; struct grub_unaligned_uint64 { grub_uint64_t val; } GRUB_PACKED; +typedef struct grub_unaligned_uint16 grub_unaligned_uint16_t; +typedef struct grub_unaligned_uint32 grub_unaligned_uint32_t; typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t; +static inline grub_uint16_t grub_get_unaligned16 (const void *ptr) +{ + const struct grub_unaligned_uint16 *dd + = (const struct grub_unaligned_uint16 *) ptr; + return dd->val; +} + +static inline void grub_set_unaligned16 (void *ptr, grub_uint16_t val) +{ + struct grub_unaligned_uint16 *dd = (struct grub_unaligned_uint16 *) ptr; + dd->val = val; +} + +static inline grub_uint32_t grub_get_unaligned32 (const void *ptr) +{ + const struct grub_unaligned_uint32 *dd + = (const struct grub_unaligned_uint32 *) ptr; + return dd->val; +} + +static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val) +{ + struct grub_unaligned_uint32 *dd = (struct grub_unaligned_uint32 *) ptr; + dd->val = val; +} + static inline grub_uint64_t grub_get_unaligned64 (const void *ptr) { const struct grub_unaligned_uint64 *dd diff --git a/include/grub/util/mkimage.h b/include/grub/util/mkimage.h new file mode 100644 index 000000000..2a4894213 --- /dev/null +++ b/include/grub/util/mkimage.h @@ -0,0 +1,185 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2013 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 . + */ + +#ifndef GRUB_UTIL_MKIMAGE_HEADER +#define GRUB_UTIL_MKIMAGE_HEADER 1 + +struct grub_mkimage_layout +{ + size_t exec_size; + size_t kernel_size; + size_t bss_size; + grub_uint64_t start_address; + void *reloc_section; + size_t reloc_size; + size_t align; + grub_size_t ia64jmp_off; + grub_size_t tramp_off; + grub_size_t ia64_got_off; + grub_size_t got_size; + unsigned ia64jmpnum; + grub_uint32_t bss_start; + grub_uint32_t end; +}; + +/* Private header. Use only in mkimage-related sources. */ +char * +grub_mkimage_load_image32 (const char *kernel_path, + size_t total_module_size, + struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target); +char * +grub_mkimage_load_image64 (const char *kernel_path, + size_t total_module_size, + struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target); +void +grub_mkimage_generate_elf32 (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, + Elf32_Addr target_addr, grub_size_t align, + size_t kernel_size, size_t bss_size); +void +grub_mkimage_generate_elf64 (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, + Elf64_Addr target_addr, grub_size_t align, + size_t kernel_size, size_t bss_size); + +struct grub_install_image_target_desc +{ + const char *dirname; + const char *names[6]; + grub_size_t voidp_sizeof; + int bigendian; + enum { + IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT, + IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_SPARC64_CDCORE, + IMAGE_I386_IEEE1275, + IMAGE_LOONGSON_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH, + IMAGE_FULOONG2F_FLASH, IMAGE_I386_PC_PXE, IMAGE_MIPS_ARC, + IMAGE_QEMU_MIPS_FLASH, IMAGE_UBOOT, IMAGE_XEN, IMAGE_I386_PC_ELTORITO + } id; + enum + { + PLATFORM_FLAGS_NONE = 0, + PLATFORM_FLAGS_DECOMPRESSORS = 2, + PLATFORM_FLAGS_MODULES_BEFORE_KERNEL = 4, + } flags; + unsigned total_module_size; + unsigned decompressor_compressed_size; + unsigned decompressor_uncompressed_size; + unsigned decompressor_uncompressed_addr; + unsigned reloc_table_offset; + unsigned link_align; + grub_uint16_t elf_target; + unsigned section_align; + signed vaddr_offset; + grub_uint64_t link_addr; + unsigned mod_gap, mod_align; + grub_compression_t default_compression; + grub_uint16_t pe_target; +}; + +#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x))) +#define grub_host_to_target32(x) (grub_host_to_target32_real (image_target, (x))) +#define grub_target_to_host64(x) (grub_target_to_host64_real (image_target, (x))) +#define grub_host_to_target64(x) (grub_host_to_target64_real (image_target, (x))) +#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (image_target, (x))) +#define grub_target_to_host16(x) (grub_target_to_host16_real (image_target, (x))) +#define grub_host_to_target16(x) (grub_host_to_target16_real (image_target, (x))) + +static inline grub_uint32_t +grub_target_to_host32_real (const struct grub_install_image_target_desc *image_target, + grub_uint32_t in) +{ + if (image_target->bigendian) + return grub_be_to_cpu32 (in); + else + return grub_le_to_cpu32 (in); +} + +static inline grub_uint64_t +grub_target_to_host64_real (const struct grub_install_image_target_desc *image_target, + grub_uint64_t in) +{ + if (image_target->bigendian) + return grub_be_to_cpu64 (in); + else + return grub_le_to_cpu64 (in); +} + +static inline grub_uint64_t +grub_host_to_target64_real (const struct grub_install_image_target_desc *image_target, + grub_uint64_t in) +{ + if (image_target->bigendian) + return grub_cpu_to_be64 (in); + else + return grub_cpu_to_le64 (in); +} + +static inline grub_uint32_t +grub_host_to_target32_real (const struct grub_install_image_target_desc *image_target, + grub_uint32_t in) +{ + if (image_target->bigendian) + return grub_cpu_to_be32 (in); + else + return grub_cpu_to_le32 (in); +} + +static inline grub_uint16_t +grub_target_to_host16_real (const struct grub_install_image_target_desc *image_target, + grub_uint16_t in) +{ + if (image_target->bigendian) + return grub_be_to_cpu16 (in); + else + return grub_le_to_cpu16 (in); +} + +static inline grub_uint16_t +grub_host_to_target16_real (const struct grub_install_image_target_desc *image_target, + grub_uint16_t in) +{ + if (image_target->bigendian) + return grub_cpu_to_be16 (in); + else + return grub_cpu_to_le16 (in); +} + +static inline grub_uint64_t +grub_host_to_target_addr_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) +{ + if (image_target->voidp_sizeof == 8) + return grub_host_to_target64_real (image_target, in); + else + return grub_host_to_target32_real (image_target, in); +} + +static inline grub_uint64_t +grub_target_to_host_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) +{ + if (image_target->voidp_sizeof == 8) + return grub_target_to_host64_real (image_target, in); + else + return grub_target_to_host32_real (image_target, in); +} + +#define grub_target_to_host(val) grub_target_to_host_real(image_target, (val)) + +#endif diff --git a/include/grub/util/resolve.h b/include/grub/util/resolve.h index f42df32f9..8923a6e6c 100644 --- a/include/grub/util/resolve.h +++ b/include/grub/util/resolve.h @@ -31,5 +31,6 @@ struct grub_util_path_list * grub_util_resolve_dependencies (const char *prefix, const char *dep_list_file, char *modules[]); +void grub_util_free_path_list (struct grub_util_path_list *path_list); #endif /* ! GRUB_UTIL_RESOLVE_HEADER */ diff --git a/include/grub/xen/relocator.h b/include/grub/xen/relocator.h index ae45dce21..35a0ad9c7 100644 --- a/include/grub/xen/relocator.h +++ b/include/grub/xen/relocator.h @@ -23,11 +23,13 @@ #include #include +#define XEN_MAX_MAPPINGS 3 + struct grub_relocator_xen_state { grub_addr_t start_info; - grub_addr_t paging_start; - grub_addr_t paging_size; + grub_addr_t paging_start[XEN_MAX_MAPPINGS]; + grub_addr_t paging_size[XEN_MAX_MAPPINGS]; grub_addr_t mfn_list; grub_addr_t stack; grub_addr_t entry_point; diff --git a/include/grub/xen_file.h b/include/grub/xen_file.h index 45a45a55b..f8d8b19a7 100644 --- a/include/grub/xen_file.h +++ b/include/grub/xen_file.h @@ -35,10 +35,13 @@ struct grub_xen_file_info grub_uint64_t entry_point; grub_uint64_t hypercall_page; grub_uint64_t paddr_offset; + grub_uint64_t p2m_base; int has_hypercall_page; int has_note; int has_xen_guest; + int has_p2m_base; int extended_cr3; + int unmapped_initrd; enum { GRUB_XEN_FILE_I386 = 1, diff --git a/include/multiboot2.h b/include/multiboot2.h index 9d4862759..5a3db5a7c 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -60,6 +60,9 @@ #define MULTIBOOT_TAG_TYPE_NETWORK 16 #define MULTIBOOT_TAG_TYPE_EFI_MMAP 17 #define MULTIBOOT_TAG_TYPE_EFI_BS 18 +#define MULTIBOOT_TAG_TYPE_EFI32_IH 19 +#define MULTIBOOT_TAG_TYPE_EFI64_IH 20 +#define MULTIBOOT_TAG_TYPE_LOAD_BASE_ADDR 21 #define MULTIBOOT_HEADER_TAG_END 0 #define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1 @@ -69,11 +72,17 @@ #define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5 #define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6 #define MULTIBOOT_HEADER_TAG_EFI_BS 7 +#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 +#define MULTIBOOT_HEADER_TAG_RELOCATABLE 10 #define MULTIBOOT_ARCHITECTURE_I386 0 #define MULTIBOOT_ARCHITECTURE_MIPS32 4 #define MULTIBOOT_HEADER_TAG_OPTIONAL 1 +#define MULTIBOOT_LOAD_PREFERENCE_NONE 0 +#define MULTIBOOT_LOAD_PREFERENCE_LOW 1 +#define MULTIBOOT_LOAD_PREFERENCE_HIGH 2 + #define MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED 1 #define MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED 2 @@ -158,6 +167,17 @@ struct multiboot_header_tag_module_align multiboot_uint32_t size; }; +struct multiboot_header_tag_relocatable +{ + multiboot_uint16_t type; + multiboot_uint16_t flags; + multiboot_uint32_t size; + multiboot_uint32_t min_addr; + multiboot_uint32_t max_addr; + multiboot_uint32_t align; + multiboot_uint32_t preference; +}; + struct multiboot_color { multiboot_uint8_t red; @@ -176,7 +196,7 @@ struct multiboot_mmap_entry #define MULTIBOOT_MEMORY_BADRAM 5 multiboot_uint32_t type; multiboot_uint32_t zero; -} GRUB_PACKED; +}; typedef struct multiboot_mmap_entry multiboot_memory_map_t; struct multiboot_tag @@ -370,6 +390,27 @@ struct multiboot_tag_efi_mmap multiboot_uint8_t efi_mmap[0]; }; +struct multiboot_tag_efi32_ih +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint32_t pointer; +}; + +struct multiboot_tag_efi64_ih +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint64_t pointer; +}; + +struct multiboot_tag_load_base_addr +{ + multiboot_uint32_t type; + multiboot_uint32_t size; + multiboot_uint32_t load_base_addr; +}; + #endif /* ! ASM_FILE */ #endif /* ! MULTIBOOT_HEADER */ diff --git a/include/xen/arch-x86/xen-x86_32.h b/include/xen/arch-x86/xen-x86_32.h index 15041911e..7eca6cd41 100644 --- a/include/xen/arch-x86/xen-x86_32.h +++ b/include/xen/arch-x86/xen-x86_32.h @@ -58,34 +58,31 @@ #define __HYPERVISOR_VIRT_START_PAE 0xF5800000 #define __MACH2PHYS_VIRT_START_PAE 0xF5800000 #define __MACH2PHYS_VIRT_END_PAE 0xF6800000 -#define HYPERVISOR_VIRT_START_PAE \ - mk_unsigned_long(__HYPERVISOR_VIRT_START_PAE) -#define MACH2PHYS_VIRT_START_PAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_START_PAE) -#define MACH2PHYS_VIRT_END_PAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_END_PAE) +#define HYPERVISOR_VIRT_START_PAE xen_mk_ulong(__HYPERVISOR_VIRT_START_PAE) +#define MACH2PHYS_VIRT_START_PAE xen_mk_ulong(__MACH2PHYS_VIRT_START_PAE) +#define MACH2PHYS_VIRT_END_PAE xen_mk_ulong(__MACH2PHYS_VIRT_END_PAE) /* Non-PAE bounds are obsolete. */ #define __HYPERVISOR_VIRT_START_NONPAE 0xFC000000 #define __MACH2PHYS_VIRT_START_NONPAE 0xFC000000 #define __MACH2PHYS_VIRT_END_NONPAE 0xFC400000 #define HYPERVISOR_VIRT_START_NONPAE \ - mk_unsigned_long(__HYPERVISOR_VIRT_START_NONPAE) + xen_mk_ulong(__HYPERVISOR_VIRT_START_NONPAE) #define MACH2PHYS_VIRT_START_NONPAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_START_NONPAE) + xen_mk_ulong(__MACH2PHYS_VIRT_START_NONPAE) #define MACH2PHYS_VIRT_END_NONPAE \ - mk_unsigned_long(__MACH2PHYS_VIRT_END_NONPAE) + xen_mk_ulong(__MACH2PHYS_VIRT_END_NONPAE) #define __HYPERVISOR_VIRT_START __HYPERVISOR_VIRT_START_PAE #define __MACH2PHYS_VIRT_START __MACH2PHYS_VIRT_START_PAE #define __MACH2PHYS_VIRT_END __MACH2PHYS_VIRT_END_PAE #ifndef HYPERVISOR_VIRT_START -#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) +#define HYPERVISOR_VIRT_START xen_mk_ulong(__HYPERVISOR_VIRT_START) #endif -#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) -#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) +#define MACH2PHYS_VIRT_START xen_mk_ulong(__MACH2PHYS_VIRT_START) +#define MACH2PHYS_VIRT_END xen_mk_ulong(__MACH2PHYS_VIRT_END) #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>2) #ifndef machine_to_phys_mapping #define machine_to_phys_mapping ((unsigned long *)MACH2PHYS_VIRT_START) @@ -104,6 +101,7 @@ do { if ( sizeof(hnd) == 8 ) *(uint64_t *)&(hnd) = 0; \ (hnd).p = val; \ } while ( 0 ) +#define int64_aligned_t int64_t __attribute__((aligned(8))) #define uint64_aligned_t uint64_t __attribute__((aligned(8))) #define __XEN_GUEST_HANDLE_64(name) __guest_handle_64_ ## name #define XEN_GUEST_HANDLE_64(name) __XEN_GUEST_HANDLE_64(name) diff --git a/include/xen/arch-x86/xen-x86_64.h b/include/xen/arch-x86/xen-x86_64.h index 1c4e1590f..5e18613bd 100644 --- a/include/xen/arch-x86/xen-x86_64.h +++ b/include/xen/arch-x86/xen-x86_64.h @@ -76,12 +76,12 @@ #define __MACH2PHYS_VIRT_END 0xFFFF804000000000 #ifndef HYPERVISOR_VIRT_START -#define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START) -#define HYPERVISOR_VIRT_END mk_unsigned_long(__HYPERVISOR_VIRT_END) +#define HYPERVISOR_VIRT_START xen_mk_ulong(__HYPERVISOR_VIRT_START) +#define HYPERVISOR_VIRT_END xen_mk_ulong(__HYPERVISOR_VIRT_END) #endif -#define MACH2PHYS_VIRT_START mk_unsigned_long(__MACH2PHYS_VIRT_START) -#define MACH2PHYS_VIRT_END mk_unsigned_long(__MACH2PHYS_VIRT_END) +#define MACH2PHYS_VIRT_START xen_mk_ulong(__MACH2PHYS_VIRT_START) +#define MACH2PHYS_VIRT_END xen_mk_ulong(__MACH2PHYS_VIRT_END) #define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3) #ifndef machine_to_phys_mapping #define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START) diff --git a/include/xen/elfnote.h b/include/xen/elfnote.h new file mode 100644 index 000000000..71cd4ec52 --- /dev/null +++ b/include/xen/elfnote.h @@ -0,0 +1,281 @@ +/****************************************************************************** + * elfnote.h + * + * Definitions used for the Xen ELF notes. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Copyright (c) 2006, Ian Campbell, XenSource Ltd. + */ + +#ifndef __XEN_PUBLIC_ELFNOTE_H__ +#define __XEN_PUBLIC_ELFNOTE_H__ + +/* + * `incontents 200 elfnotes ELF notes + * + * The notes should live in a PT_NOTE segment and have "Xen" in the + * name field. + * + * Numeric types are either 4 or 8 bytes depending on the content of + * the desc field. + * + * LEGACY indicated the fields in the legacy __xen_guest string which + * this a note type replaces. + * + * String values (for non-legacy) are NULL terminated ASCII, also known + * as ASCIZ type. + */ + +/* + * NAME=VALUE pair (string). + */ +#define XEN_ELFNOTE_INFO 0 + +/* + * The virtual address of the entry point (numeric). + * + * LEGACY: VIRT_ENTRY + */ +#define XEN_ELFNOTE_ENTRY 1 + +/* The virtual address of the hypercall transfer page (numeric). + * + * LEGACY: HYPERCALL_PAGE. (n.b. legacy value is a physical page + * number not a virtual address) + */ +#define XEN_ELFNOTE_HYPERCALL_PAGE 2 + +/* The virtual address where the kernel image should be mapped (numeric). + * + * Defaults to 0. + * + * LEGACY: VIRT_BASE + */ +#define XEN_ELFNOTE_VIRT_BASE 3 + +/* + * The offset of the ELF paddr field from the actual required + * pseudo-physical address (numeric). + * + * This is used to maintain backwards compatibility with older kernels + * which wrote __PAGE_OFFSET into that field. This field defaults to 0 + * if not present. + * + * LEGACY: ELF_PADDR_OFFSET. (n.b. legacy default is VIRT_BASE) + */ +#define XEN_ELFNOTE_PADDR_OFFSET 4 + +/* + * The version of Xen that we work with (string). + * + * LEGACY: XEN_VER + */ +#define XEN_ELFNOTE_XEN_VERSION 5 + +/* + * The name of the guest operating system (string). + * + * LEGACY: GUEST_OS + */ +#define XEN_ELFNOTE_GUEST_OS 6 + +/* + * The version of the guest operating system (string). + * + * LEGACY: GUEST_VER + */ +#define XEN_ELFNOTE_GUEST_VERSION 7 + +/* + * The loader type (string). + * + * LEGACY: LOADER + */ +#define XEN_ELFNOTE_LOADER 8 + +/* + * The kernel supports PAE (x86/32 only, string = "yes", "no" or + * "bimodal"). + * + * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting + * may be given as "yes,bimodal" which will cause older Xen to treat + * this kernel as PAE. + * + * LEGACY: PAE (n.b. The legacy interface included a provision to + * indicate 'extended-cr3' support allowing L3 page tables to be + * placed above 4G. It is assumed that any kernel new enough to use + * these ELF notes will include this and therefore "yes" here is + * equivalent to "yes[entended-cr3]" in the __xen_guest interface. + */ +#define XEN_ELFNOTE_PAE_MODE 9 + +/* + * The features supported/required by this kernel (string). + * + * The string must consist of a list of feature names (as given in + * features.h, without the "XENFEAT_" prefix) separated by '|' + * characters. If a feature is required for the kernel to function + * then the feature name must be preceded by a '!' character. + * + * LEGACY: FEATURES + */ +#define XEN_ELFNOTE_FEATURES 10 + +/* + * The kernel requires the symbol table to be loaded (string = "yes" or "no") + * LEGACY: BSD_SYMTAB (n.b. The legacy treated the presence or absence + * of this string as a boolean flag rather than requiring "yes" or + * "no". + */ +#define XEN_ELFNOTE_BSD_SYMTAB 11 + +/* + * The lowest address the hypervisor hole can begin at (numeric). + * + * This must not be set higher than HYPERVISOR_VIRT_START. Its presence + * also indicates to the hypervisor that the kernel can deal with the + * hole starting at a higher address. + */ +#define XEN_ELFNOTE_HV_START_LOW 12 + +/* + * List of maddr_t-sized mask/value pairs describing how to recognize + * (non-present) L1 page table entries carrying valid MFNs (numeric). + */ +#define XEN_ELFNOTE_L1_MFN_VALID 13 + +/* + * Whether or not the guest supports cooperative suspend cancellation. + * This is a numeric value. + * + * Default is 0 + */ +#define XEN_ELFNOTE_SUSPEND_CANCEL 14 + +/* + * The (non-default) location the initial phys-to-machine map should be + * placed at by the hypervisor (Dom0) or the tools (DomU). + * The kernel must be prepared for this mapping to be established using + * large pages, despite such otherwise not being available to guests. + * The kernel must also be able to handle the page table pages used for + * this mapping not being accessible through the initial mapping. + * (Only x86-64 supports this at present.) + */ +#define XEN_ELFNOTE_INIT_P2M 15 + +/* + * Whether or not the guest can deal with being passed an initrd not + * mapped through its initial page tables. + */ +#define XEN_ELFNOTE_MOD_START_PFN 16 + +/* + * The features supported by this kernel (numeric). + * + * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a + * kernel to specify support for features that older hypervisors don't + * know about. The set of features 4.2 and newer hypervisors will + * consider supported by the kernel is the combination of the sets + * specified through this and the string note. + * + * LEGACY: FEATURES + */ +#define XEN_ELFNOTE_SUPPORTED_FEATURES 17 + +/* + * Physical entry point into the kernel. + * + * 32bit entry point into the kernel. When requested to launch the + * guest kernel in a HVM container, Xen will use this entry point to + * launch the guest in 32bit protected mode with paging disabled. + * Ignored otherwise. + */ +#define XEN_ELFNOTE_PHYS32_ENTRY 18 + +/* + * The number of the highest elfnote defined. + */ +#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY + +/* + * System information exported through crash notes. + * + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO + * note in case of a system crash. This note will contain various + * information about the system, see xen/include/xen/elfcore.h. + */ +#define XEN_ELFNOTE_CRASH_INFO 0x1000001 + +/* + * System registers exported through crash notes. + * + * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS + * note per cpu in case of a system crash. This note is architecture + * specific and will contain registers not saved in the "CORE" note. + * See xen/include/xen/elfcore.h for more information. + */ +#define XEN_ELFNOTE_CRASH_REGS 0x1000002 + + +/* + * xen dump-core none note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE + * in its dump file to indicate that the file is xen dump-core + * file. This note doesn't have any other information. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_NONE 0x2000000 + +/* + * xen dump-core header note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER + * in its dump file. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_HEADER 0x2000001 + +/* + * xen dump-core xen version note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION + * in its dump file. It contains the xen version obtained via the + * XENVER hypercall. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION 0x2000002 + +/* + * xen dump-core format version note. + * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION + * in its dump file. It contains a format version identifier. + * See tools/libxc/xc_core.h for more information. + */ +#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION 0x2000003 + +#endif /* __XEN_PUBLIC_ELFNOTE_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/include/xen/xen.h b/include/xen/xen.h index a6a20926a..6c9e42b2b 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -52,6 +52,19 @@ DEFINE_XEN_GUEST_HANDLE(void); DEFINE_XEN_GUEST_HANDLE(uint64_t); DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); + +/* Turn a plain number into a C unsigned (long) constant. */ +#define __xen_mk_uint(x) x ## U +#define __xen_mk_ulong(x) x ## UL +#define xen_mk_uint(x) __xen_mk_uint(x) +#define xen_mk_ulong(x) __xen_mk_ulong(x) + +#else + +/* In assembly code we cannot use C numeric constant suffixes. */ +#define xen_mk_uint(x) x +#define xen_mk_ulong(x) x + #endif /* @@ -101,6 +114,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); #define __HYPERVISOR_kexec_op 37 #define __HYPERVISOR_tmem_op 38 #define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */ +#define __HYPERVISOR_xenpmu_op 40 /* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48 @@ -160,6 +174,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); #define VIRQ_MEM_EVENT 10 /* G. (DOM0) A memory event has occured */ #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient */ #define VIRQ_ENOMEM 12 /* G. (DOM0) Low on heap memory */ +#define VIRQ_XENPMU 13 /* V. PMC interrupt */ /* Architecture-specific VIRQ definitions. */ #define VIRQ_ARCH_0 16 @@ -449,13 +464,13 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */ /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */ /* ` enum uvm_flags { */ -#define UVMF_NONE (0UL<<0) /* No flushing at all. */ -#define UVMF_TLB_FLUSH (1UL<<0) /* Flush entire TLB(s). */ -#define UVMF_INVLPG (2UL<<0) /* Flush only one entry. */ -#define UVMF_FLUSHTYPE_MASK (3UL<<0) -#define UVMF_MULTI (0UL<<2) /* Flush subset of TLBs. */ -#define UVMF_LOCAL (0UL<<2) /* Flush local TLB. */ -#define UVMF_ALL (1UL<<2) /* Flush all TLBs. */ +#define UVMF_NONE (xen_mk_ulong(0)<<0) /* No flushing at all. */ +#define UVMF_TLB_FLUSH (xen_mk_ulong(1)<<0) /* Flush entire TLB(s). */ +#define UVMF_INVLPG (xen_mk_ulong(2)<<0) /* Flush only one entry. */ +#define UVMF_FLUSHTYPE_MASK (xen_mk_ulong(3)<<0) +#define UVMF_MULTI (xen_mk_ulong(0)<<2) /* Flush subset of TLBs. */ +#define UVMF_LOCAL (xen_mk_ulong(0)<<2) /* Flush local TLB. */ +#define UVMF_ALL (xen_mk_ulong(1)<<2) /* Flush all TLBs. */ /* ` } */ /* @@ -486,17 +501,27 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t); /* x86/PAE guests: support PDPTs above 4GB. */ #define VMASST_TYPE_pae_extended_cr3 3 +/* + * x86/64 guests: strictly hide M2P from user mode. + * This allows the guest to control respective hypervisor behavior: + * - when not set, L4 tables get created with the respective slot blank, + * and whenever the L4 table gets used as a kernel one the missing + * mapping gets inserted, + * - when set, L4 tables get created with the respective slot initialized + * as before, and whenever the L4 table gets used as a user one the + * mapping gets zapped. + */ +#define VMASST_TYPE_m2p_strict 32 + +#if __XEN_INTERFACE_VERSION__ < 0x00040600 #define MAX_VMASST_TYPE 3 - -#ifndef __ASSEMBLY__ - -typedef uint16_t domid_t; +#endif /* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */ -#define DOMID_FIRST_RESERVED (0x7FF0U) +#define DOMID_FIRST_RESERVED xen_mk_uint(0x7FF0) /* DOMID_SELF is used in certain contexts to refer to oneself. */ -#define DOMID_SELF (0x7FF0U) +#define DOMID_SELF xen_mk_uint(0x7FF0) /* * DOMID_IO is used to restrict page-table updates to mapping I/O memory. @@ -507,7 +532,7 @@ typedef uint16_t domid_t; * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can * be specified by any calling domain. */ -#define DOMID_IO (0x7FF1U) +#define DOMID_IO xen_mk_uint(0x7FF1) /* * DOMID_XEN is used to allow privileged domains to map restricted parts of @@ -515,17 +540,21 @@ typedef uint16_t domid_t; * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if * the caller is privileged. */ -#define DOMID_XEN (0x7FF2U) +#define DOMID_XEN xen_mk_uint(0x7FF2) /* * DOMID_COW is used as the owner of sharable pages */ -#define DOMID_COW (0x7FF3U) +#define DOMID_COW xen_mk_uint(0x7FF3) /* DOMID_INVALID is used to identify pages with unknown owner. */ -#define DOMID_INVALID (0x7FF4U) +#define DOMID_INVALID xen_mk_uint(0x7FF4) /* Idle domain. */ -#define DOMID_IDLE (0x7FFFU) +#define DOMID_IDLE xen_mk_uint(0x7FFF) + +#ifndef __ASSEMBLY__ + +typedef uint16_t domid_t; /* * Send an array of these to HYPERVISOR_mmu_update(). @@ -682,6 +711,12 @@ struct shared_info { uint32_t wc_version; /* Version counter: see vcpu_time_info_t. */ uint32_t wc_sec; /* Secs 00:00:00 UTC, Jan 1, 1970. */ uint32_t wc_nsec; /* Nsecs 00:00:00 UTC, Jan 1, 1970. */ +#if !defined(__i386__) + uint32_t wc_sec_hi; +# define xen_wc_sec_hi wc_sec_hi +#elif !defined(__XEN__) && !defined(__XEN_TOOLS__) +# define xen_wc_sec_hi arch.wc_sec_hi +#endif struct arch_shared_info arch; @@ -698,24 +733,27 @@ typedef struct shared_info shared_info_t; * 3. This the order of bootstrap elements in the initial virtual region: * a. relocated kernel image * b. initial ram disk [mod_start, mod_len] + * (may be omitted) * c. list of allocated page frames [mfn_list, nr_pages] * (unless relocated due to XEN_ELFNOTE_INIT_P2M) * d. start_info_t structure [register ESI (x86)] - * e. bootstrap page tables [pt_base and CR3 (x86)] - * f. bootstrap stack [register ESP (x86)] + * in case of dom0 this page contains the console info, too + * e. unless dom0: xenstore ring page + * f. unless dom0: console ring page + * g. bootstrap page tables [pt_base and CR3 (x86)] + * h. bootstrap stack [register ESP (x86)] * 4. Bootstrap elements are packed together, but each is 4kB-aligned. - * 5. The initial ram disk may be omitted. - * 6. The list of page frames forms a contiguous 'pseudo-physical' memory + * 5. The list of page frames forms a contiguous 'pseudo-physical' memory * layout for the domain. In particular, the bootstrap virtual-memory * region is a 1:1 mapping to the first section of the pseudo-physical map. - * 7. All bootstrap elements are mapped read-writable for the guest OS. The + * 6. All bootstrap elements are mapped read-writable for the guest OS. The * only exception is the bootstrap page table, which is mapped read-only. - * 8. There is guaranteed to be at least 512kB padding after the final + * 7. There is guaranteed to be at least 512kB padding after the final * bootstrap element. If necessary, the bootstrap virtual region is * extended by an extra 4MB to ensure this. * * Note: Prior to 25833:bb85bbccb1c9. ("x86/32-on-64 adjust Dom0 initial page - * table layout") a bug caused the pt_base (3.e above) and cr3 to not point + * table layout") a bug caused the pt_base (3.g above) and cr3 to not point * to the start of the guest page tables (it was offset by two pages). * This only manifested itself on 32-on-64 dom0 kernels and not 32-on-64 domU * or 64-bit kernels of any colour. The page tables for a 32-on-64 dom0 got @@ -759,6 +797,29 @@ struct start_info { }; typedef struct start_info start_info_t; +/* + * Start of day structure passed to PVH guests in %ebx. + * + * NOTE: nothing will be loaded at physical address 0, so + * a 0 value in any of the address fields should be treated + * as not present. + */ +struct hvm_start_info { +#define HVM_START_MAGIC_VALUE 0x336ec578 + uint32_t magic; /* Contains the magic value 0x336ec578 */ + /* ("xEn3" with the 0x80 bit of the "E" set).*/ + uint32_t flags; /* SIF_xxx flags. */ + uint32_t cmdline_paddr; /* Physical address of the command line. */ + uint32_t nr_modules; /* Number of modules passed to the kernel. */ + uint32_t modlist_paddr; /* Physical address of an array of */ + /* hvm_modlist_entry. */ +}; + +struct hvm_modlist_entry { + uint32_t paddr; /* Physical address of the module. */ + uint32_t size; /* Size of the module in bytes. */ +}; + /* New console union for dom0 introduced in 0x00030203. */ #if __XEN_INTERFACE_VERSION__ < 0x00030203 #define console_mfn console.domU.mfn @@ -771,6 +832,8 @@ typedef struct start_info start_info_t; #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ #define SIF_MULTIBOOT_MOD (1<<2) /* Is mod_start a multiboot module? */ #define SIF_MOD_START_PFN (1<<3) /* Is mod_start a PFN? */ +#define SIF_VIRT_P2M_4TOOLS (1<<4) /* Do Xen tools understand a virt. mapped */ + /* P->M making the 3 level tree obsolete? */ #define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */ /* @@ -851,25 +914,19 @@ typedef struct dom0_vga_console_info { typedef uint8_t xen_domain_handle_t[16]; -/* Turn a plain number into a C unsigned long constant. */ -#define __mk_unsigned_long(x) x ## UL -#define mk_unsigned_long(x) __mk_unsigned_long(x) - __DEFINE_XEN_GUEST_HANDLE(uint8, uint8_t); __DEFINE_XEN_GUEST_HANDLE(uint16, uint16_t); __DEFINE_XEN_GUEST_HANDLE(uint32, uint32_t); __DEFINE_XEN_GUEST_HANDLE(uint64, uint64_t); -#else /* __ASSEMBLY__ */ - -/* In assembly code we cannot use C numeric constant suffixes. */ -#define mk_unsigned_long(x) x - #endif /* !__ASSEMBLY__ */ /* Default definitions for macros used by domctl/sysctl. */ #if defined(__XEN__) || defined(__XEN_TOOLS__) +#ifndef int64_aligned_t +#define int64_aligned_t int64_t +#endif #ifndef uint64_aligned_t #define uint64_aligned_t uint64_t #endif diff --git a/tests/ahci_test.in b/tests/ahci_test.in index e7d26ac07..1d01d1f59 100644 --- a/tests/ahci_test.in +++ b/tests/ahci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/ehci_test.in b/tests/ehci_test.in index 5cfe726df..7dd8d3e8f 100644 --- a/tests/ehci_test.in +++ b/tests/ehci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in index 1c84fbfbb..eb362aa24 100644 --- a/tests/grub_cmd_sleep.in +++ b/tests/grub_cmd_sleep.in @@ -14,6 +14,11 @@ dt=`echo 'date; sleep 10; date' | @builddir@/grub-shell` dt1="$(date -u -d "$(echo "$dt" | head -n 1)" +%s)" dt2="$(date -u -d "$(echo "$dt" | tail -n 1)" +%s)" +# Ignore QEMU bug +if [ "${grub_modinfo_target_cpu}" = arm ] && [ $((dt2 - dt1)) -ge 15 ] && [ $((dt2 - dt1)) -le 17 ]; then + exit 0; +fi + if [ $((dt2 - dt1)) -gt 11 ] || [ $((dt2 - dt1)) -lt 9 ]; then echo "Interval not in range $dt2-$dt1 != 10" exit 1 diff --git a/tests/hddboot_test.in b/tests/hddboot_test.in index 2cbbf97ec..c229716a6 100644 --- a/tests/hddboot_test.in +++ b/tests/hddboot_test.in @@ -29,9 +29,6 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in # FIXME: currently grub-shell uses only -kernel for loongson mipsel-loongson) exit 0;; - # FIXME: OVMF skips HDDs for automatic boot and has no USB support - *-efi) - exit 0;; esac if [ "$(echo hello | "${grubshell}" --boot=hd)" != "Hello World" ]; then diff --git a/tests/minixfs_test.in b/tests/minixfs_test.in index 8075ba890..1784b1261 100644 --- a/tests/minixfs_test.in +++ b/tests/minixfs_test.in @@ -16,10 +16,20 @@ if ! which mkfs.minix >/dev/null 2>&1; then fi if ! mkfs.minix -h | grep -- -v > /dev/null; then + echo "mkfs.minix doesn't support minix2fs; cannot test minix*fs." + exit 77 +fi + +if ! mkfs.minix -h | grep -- -3 > /dev/null; then echo "mkfs.minix doesn't support minix3fs; cannot test minix*fs." exit 77 fi +if ! mkfs.minix -h | grep -- -B > /dev/null; then + echo "mkfs.minix doesn't support variable block size; cannot test minix*fs." + exit 77 +fi + "@builddir@/grub-fs-tester" minix "@builddir@/grub-fs-tester" minix2 "@builddir@/grub-fs-tester" minix3 diff --git a/tests/ohci_test.in b/tests/ohci_test.in index f841bd25c..7fede6f26 100644 --- a/tests/ohci_test.in +++ b/tests/ohci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/partmap_test.in b/tests/partmap_test.in index 4230ba228..f8dc456fb 100644 --- a/tests/partmap_test.in +++ b/tests/partmap_test.in @@ -88,6 +88,9 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mipsel-arc) disk=arc/scsi0/disk0/rdisk0 ;; + arm*-efi) + disk=hd3 + ;; *) disk=hd0 ;; diff --git a/tests/pata_test.in b/tests/pata_test.in index 07d17b781..c1d0f63ea 100644 --- a/tests/pata_test.in +++ b/tests/pata_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in *-arc) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; i386-ieee1275) disk=hdb diff --git a/tests/printf_unit_test.c b/tests/printf_unit_test.c index eb76bd002..d7b12c6db 100644 --- a/tests/printf_unit_test.c +++ b/tests/printf_unit_test.c @@ -66,6 +66,9 @@ printf_test (void) grub_snprintf (real, sizeof (real), "%3$d %2$lld %1$d", 1, 2LL, 3); snprintf (expected, sizeof (expected), "%3$d %2$lld %1$d", 1, 2LL, 3); grub_test_assert (strcmp (real, expected) == 0, MSG); + grub_snprintf (real, sizeof (real), "%%0%dd ", 1); + snprintf (expected, sizeof (expected), "%%0%dd ", 1); + grub_test_assert (strcmp (real, expected) == 0, MSG); } GRUB_UNIT_TEST ("printf_unit_test", printf_test); diff --git a/tests/uhci_test.in b/tests/uhci_test.in index 3dea51c01..89e2c1805 100644 --- a/tests/uhci_test.in +++ b/tests/uhci_test.in @@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips*-arc | mips*-qemu_mips) exit 0;; # FIXME: No native drivers are available for those - powerpc-ieee1275 | sparc64-ieee1275) + powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi) exit 0;; esac diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in index 6d2b1327e..ab19dbbf5 100644 --- a/tests/util/grub-shell.in +++ b/tests/util/grub-shell.in @@ -65,7 +65,7 @@ serial_port=com0 serial_null= halt_cmd=halt pseries=n -disk=hda +disk="hda " case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in *-emu) device_map=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 @@ -74,6 +74,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in disk=0 # To skip "Welcome to GRUB" and color setttings trim=1 + serial_port= ;; powerpc-ieee1275) boot=hd @@ -82,6 +83,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in serial_port=escc-ch-b serial_null="-serial null" netbootext=elf + trim=1 ;; sparc64-ieee1275) @@ -97,13 +99,13 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mips-qemu_mips) boot=mips_qemu qemu=qemu-system-mips - qemuopts="$qemuopts -M mips" + qemuopts="-M mips $qemuopts" console=vga_text ;; mips-arc) boot=cd qemu=qemu-system-mips64 - qemuopts="$qemuopts -M indy" + qemuopts="-M indy $qemuopts" serial_port=arc/serial0/line0 console= trim=1 @@ -111,7 +113,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mipsel-arc) boot=cd qemu=qemu-system-mips64el - qemuopts="$qemuopts -M magnum -no-reboot" + qemuopts="-M magnum $qemuopts -no-reboot" serial_port=arc/multi0/serial0 console=console halt_cmd=reboot @@ -120,13 +122,13 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in mipsel-qemu_mips) boot=mipsel_qemu qemu=qemu-system-mipsel - qemuopts="$qemuopts -M mips" + qemuopts="-M mips $qemuopts" console=vga_text ;; mipsel-loongson) boot=mipsel_fulong2e qemu=qemu-system-mips64el - qemuopts="$qemuopts -M fulong2e" + qemuopts="-M fulong2e $qemuopts" console= trim=1 ;; @@ -145,7 +147,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in qemu=qemu-system-i386 console=console trim=1 - disk=hdb + disk="hdb " ;; i386-qemu) boot=qemu @@ -164,12 +166,32 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in boot=cd console=console trim=1 + qemuopts="-bios OVMF-ia32.fd $qemuopts" ;; x86_64-efi) qemu=qemu-system-x86_64 boot=cd console=console trim=1 + qemuopts="-bios OVMF.fd $qemuopts" + ;; + arm64-efi) + qemu=qemu-system-aarch64 + boot=hd + console=console + trim=1 + qemuopts="-machine virt -cpu cortex-a57 -bios /usr/share/qemu-efi/QEMU_EFI.fd $qemuopts" + disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file=" + serial_port= + ;; + arm-efi) + qemu=qemu-system-arm + boot=hd + console=console + trim=1 + qemuopts="-machine virt -bios /usr/share/ovmf-arm/QEMU_EFI.fd $qemuopts" + disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file=" + serial_port=efi0 ;; *) boot=hd @@ -222,17 +244,17 @@ for option in "$@"; do echo "(hd$disk) $dsk" >> "$device_map" disk="$((disk+1))" else - if [ $disk = error ]; then + if [ "$disk" = error ]; then echo "Too many disks" 1>&2 exit 1; fi - qemuopts="$qemuopts -$disk $dsk" - if [ "$disk" = hda ]; then - disk=hdb; - elif [ "$disk" = hdb ]; then + qemuopts="$qemuopts -$disk$dsk" + if [ "$disk" = "hda " ]; then + disk="hdb "; + elif [ "$disk" = "hdb " ]; then # CDROM is hdc - disk=hdd - elif [ "$disk" = hdd ]; then + disk="hdd " + elif [ "$disk" = "hdd " ]; then # CDROM is hdc disk=error fi @@ -289,6 +311,8 @@ fi cfgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 cat <${cfgfile} grubshell=yes +enable_progress_indicator=0 +export enable_progress_indicator EOF @@ -299,7 +323,7 @@ fi if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ]; then echo insmod escc >>${cfgfile} fi -if [ "${grub_modinfo_platform}" != emu ]; then +if [ "${serial_port}" != "" ]; then echo "serial ${serial_port}" >>${cfgfile} term="serial_${serial_port}" else @@ -329,7 +353,8 @@ cat <>${cfgfile} source "\$prefix/testcase.cfg" # Stop serial output to suppress "ACPI shutdown failed" error. EOF -if [ x$console != x ]; then +# Attempt to switch to console on i386-ieee1275 causes "screen not found" message +if [ x$console != x ] && [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" != xi386-ieee1275 ]; then echo "terminal_output $console" >>${cfgfile} fi echo "${halt_cmd}" >>${cfgfile} @@ -356,7 +381,9 @@ if [ x$boot != xnet ] && [ x$boot != xemu ]; then ${files} >/dev/null 2>&1 fi if [ x$boot = xhd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then + if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then + device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file=" + elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc ]; then device="hdb " else device="hda " @@ -364,7 +391,9 @@ if [ x$boot = xhd ]; then bootdev="-boot c" fi if [ x$boot = xcd ]; then - if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then + if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then + device="device virtio-blk-device,drive=cd0 -drive if=none,id=cd0,media=cdrom,file=" + elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] && [ x$pseries != xy ] ; then device="-drive if=ide,media=cdrom,file=" else device="cdrom " @@ -399,7 +428,7 @@ fi if [ x$boot = xcoreboot ]; then imgfile=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1 cp "${GRUB_COREBOOT_ROM}" "${imgfile}" - "${GRUB_CBFSTOOL}" "${imgfile}" add-payload "${rom_directory}/coreboot.elf" fallback/payload + "${GRUB_CBFSTOOL}" "${imgfile}" add-payload -f "${rom_directory}/coreboot.elf" -n fallback/payload bootdev="-bios ${imgfile}" device="cdrom " test -z "$debug" || echo "Coreboot image: ${imgfile}" >&2 @@ -447,7 +476,8 @@ if [ x$boot = xnet ]; then [ -z "$files" ] || copy_extra_files "$netdir" $files timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -boot n -net "user,tftp=$netdir,bootfile=/boot/grub/${grub_modinfo_target_cpu}-${grub_modinfo_platform}/core.$netbootext" -net nic | cat | tr -d "\r" | do_trim elif [ x$boot = xemu ]; then - grubdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" + rootdir="$(mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" + grubdir="$rootdir/boot/grub" mkdir -p "$grubdir/fonts" mkdir -p "$grubdir/themes" mkdir -p "$grubdir/locale" @@ -460,8 +490,12 @@ elif [ x$boot = xemu ]; then done cp "${cfgfile}" "$grubdir/grub.cfg" cp "${source}" "$grubdir/testcase.cfg" - @builddir@/grub-core/grub-emu -m "$device_map" -d "$grubdir" | tr -d "\r" | do_trim - rm -rf "$grubdir" + [ -z "$files" ] || copy_extra_files "$rootdir" $files + roottar="$(mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")" + (cd "$rootdir"; tar cf "$roottar" .) + @builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim + test -n "$debug" || rm -rf "$rootdir" + test -n "$debug" || rm -f "$roottar" else timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout -${device}"${isofile}" ${bootdev} | cat | tr -d "\r" | do_trim fi diff --git a/util/getroot.c b/util/getroot.c index 36f1730c0..92c0d709b 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -383,9 +383,6 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) grub_util_info ("%s starts from %" GRUB_HOST_PRIuLONG_LONG, os_dev, (unsigned long long) ctx.start); - if (ctx.start == 0 && !is_part) - return name; - grub_util_info ("opening the device %s", name); disk = grub_disk_open (name); free (name); diff --git a/util/grub-install-common.c b/util/grub-install-common.c index 25983089f..452b230da 100644 --- a/util/grub-install-common.c +++ b/util/grub-install-common.c @@ -765,6 +765,8 @@ grub_install_copy_files (const char *src, grub_install_compress_file (srcf, dstf, 1); free (dstf); } + + grub_util_free_path_list (path_list); } const char *pkglib_DATA[] = {"efiemu32.o", "efiemu64.o", diff --git a/util/grub-install.c b/util/grub-install.c index eabd6de4d..6c89c2b0c 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1282,6 +1282,7 @@ main (int argc, char *argv[]) grub_install_push_module ("ahci"); grub_install_push_module ("ohci"); grub_install_push_module ("uhci"); + grub_install_push_module ("ehci"); grub_install_push_module ("usbms"); } else if (disk_module && disk_module[0]) diff --git a/util/grub-kbdcomp.in b/util/grub-kbdcomp.in index 715c483af..a15ec24e5 100644 --- a/util/grub-kbdcomp.in +++ b/util/grub-kbdcomp.in @@ -25,7 +25,7 @@ usage () { gettext "Make GRUB keyboard layout file."; echo echo print_option_help "-h, --help" "$(gettext "print this message and exit")" - print_option_help "-v, --version" "$(gettext "print the version information and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")" echo gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self" @@ -54,7 +54,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; -o | --output) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 3183744bf..f8496d28b 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -85,7 +85,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; -o | --output) @@ -273,6 +273,7 @@ Ensure that there are no errors in /etc/default/grub and /etc/grub.d/* files or please file a bug report with %s file attached." "${grub_cfg}.new" >&2 echo >&2 + exit 1 else # none of the children aborted with error, install the new grub.cfg mv -f ${grub_cfg}.new ${grub_cfg} diff --git a/util/grub-mkimage.c b/util/grub-mkimage.c index 1e0bcf1bf..10375f4d2 100644 --- a/util/grub-mkimage.c +++ b/util/grub-mkimage.c @@ -304,8 +304,7 @@ main (int argc, char *argv[]) grub_util_file_sync (fp); fclose (fp); - if (arguments.dir) - free (arguments.dir); + free (arguments.dir); if (arguments.output) free (arguments.output); diff --git a/util/grub-mkimage32.c b/util/grub-mkimage32.c new file mode 100644 index 000000000..9b31397bc --- /dev/null +++ b/util/grub-mkimage32.c @@ -0,0 +1,22 @@ +#define MKIMAGE_ELF32 1 + +# define SUFFIX(x) x ## 32 +# define ELFCLASSXX ELFCLASS32 +# define Elf_Ehdr Elf32_Ehdr +# define Elf_Phdr Elf32_Phdr +# define Elf_Nhdr Elf32_Nhdr +# define Elf_Addr Elf32_Addr +# define Elf_Sym Elf32_Sym +# define Elf_Off Elf32_Off +# define Elf_Shdr Elf32_Shdr +# define Elf_Rela Elf32_Rela +# define Elf_Rel Elf32_Rel +# define Elf_Word Elf32_Word +# define Elf_Half Elf32_Half +# define Elf_Section Elf32_Section +# define ELF_R_SYM(val) ELF32_R_SYM(val) +# define ELF_R_TYPE(val) ELF32_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) +#define XEN_NOTE_SIZE 132 + +#include "grub-mkimagexx.c" diff --git a/util/grub-mkimage64.c b/util/grub-mkimage64.c new file mode 100644 index 000000000..d83345924 --- /dev/null +++ b/util/grub-mkimage64.c @@ -0,0 +1,22 @@ +#define MKIMAGE_ELF64 1 + +# define SUFFIX(x) x ## 64 +# define ELFCLASSXX ELFCLASS64 +# define Elf_Ehdr Elf64_Ehdr +# define Elf_Phdr Elf64_Phdr +# define Elf_Nhdr Elf64_Nhdr +# define Elf_Addr Elf64_Addr +# define Elf_Sym Elf64_Sym +# define Elf_Off Elf64_Off +# define Elf_Shdr Elf64_Shdr +# define Elf_Rela Elf64_Rela +# define Elf_Rel Elf64_Rel +# define Elf_Word Elf64_Word +# define Elf_Half Elf64_Half +# define Elf_Section Elf64_Section +# define ELF_R_SYM(val) ELF64_R_SYM(val) +# define ELF_R_TYPE(val) ELF64_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) +#define XEN_NOTE_SIZE 120 + +#include "grub-mkimagexx.c" diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index a1ddc6269..353a9407a 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -17,58 +17,178 @@ * along with GRUB. If not, see . */ -#undef ELF_R_SYM -#undef ELF_R_TYPE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#if defined(MKIMAGE_ELF32) -# define SUFFIX(x) x ## 32 -# define ELFCLASSXX ELFCLASS32 -# define Elf_Ehdr Elf32_Ehdr -# define Elf_Phdr Elf32_Phdr -# define Elf_Nhdr Elf32_Nhdr -# define Elf_Addr Elf32_Addr -# define Elf_Sym Elf32_Sym -# define Elf_Off Elf32_Off -# define Elf_Shdr Elf32_Shdr -# define Elf_Rela Elf32_Rela -# define Elf_Rel Elf32_Rel -# define Elf_Word Elf32_Word -# define Elf_Half Elf32_Half -# define Elf_Section Elf32_Section -# define ELF_R_SYM(val) ELF32_R_SYM(val) -# define ELF_R_TYPE(val) ELF32_R_TYPE(val) -# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) -#define XEN_NOTE_SIZE 132 -#elif defined(MKIMAGE_ELF64) -# define SUFFIX(x) x ## 64 -# define ELFCLASSXX ELFCLASS64 -# define Elf_Ehdr Elf64_Ehdr -# define Elf_Phdr Elf64_Phdr -# define Elf_Nhdr Elf64_Nhdr -# define Elf_Addr Elf64_Addr -# define Elf_Sym Elf64_Sym -# define Elf_Off Elf64_Off -# define Elf_Shdr Elf64_Shdr -# define Elf_Rela Elf64_Rela -# define Elf_Rel Elf64_Rel -# define Elf_Word Elf64_Word -# define Elf_Half Elf64_Half -# define Elf_Section Elf64_Section -# define ELF_R_SYM(val) ELF64_R_SYM(val) -# define ELF_R_TYPE(val) ELF64_R_TYPE(val) -# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) -#define XEN_NOTE_SIZE 120 -#else -#error "I'm confused" -#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#pragma GCC diagnostic ignored "-Wcast-align" static Elf_Addr SUFFIX (entry_point); -static void -SUFFIX (generate_elf) (const struct grub_install_image_target_desc *image_target, - int note, char **core_img, size_t *core_size, - Elf_Addr target_addr, grub_size_t align, - size_t kernel_size, size_t bss_size) +/* These structures are defined according to the CHRP binding to IEEE1275, + "Client Program Format" section. */ + +struct grub_ieee1275_note_desc +{ + grub_uint32_t real_mode; + grub_uint32_t real_base; + grub_uint32_t real_size; + grub_uint32_t virt_base; + grub_uint32_t virt_size; + grub_uint32_t load_base; +}; + +#define GRUB_IEEE1275_NOTE_NAME "PowerPC" +#define GRUB_IEEE1275_NOTE_TYPE 0x1275 + +struct grub_ieee1275_note +{ + Elf32_Nhdr header; + char name[ALIGN_UP(sizeof (GRUB_IEEE1275_NOTE_NAME), 4)]; + struct grub_ieee1275_note_desc descriptor; +}; + +#define GRUB_XEN_NOTE_NAME "Xen" + +struct fixup_block_list +{ + struct fixup_block_list *next; + int state; + struct grub_pe32_fixup_block b; +}; + +#define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) + +static int +is_relocatable (const struct grub_install_image_target_desc *image_target) +{ + return image_target->id == IMAGE_EFI || image_target->id == IMAGE_UBOOT; +} + +#ifdef MKIMAGE_ELF32 + +/* + * R_ARM_THM_CALL/THM_JUMP24 + * + * Relocate Thumb (T32) instruction set relative branches: + * B.W, BL and BLX + */ +static grub_err_t +grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) +{ + grub_int32_t offset; + + offset = grub_arm_thm_call_get_offset (target); + + grub_dprintf ("dl", " sym_addr = 0x%08x", sym_addr); + + offset += sym_addr; + + grub_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", + target, sym_addr, offset); + + /* Keep traditional (pre-Thumb2) limits on blx. In any case if the kernel + is bigger than 2M (currently under 150K) then we probably have a problem + somewhere else. */ + if (offset < -0x200000 || offset >= 0x200000) + return grub_error (GRUB_ERR_BAD_MODULE, + "THM_CALL Relocation out of range."); + + grub_dprintf ("dl", " relative destination = %p", + (char *) target + offset); + + return grub_arm_thm_call_set_offset (target, offset); +} + +/* + * R_ARM_THM_JUMP19 + * + * Relocate conditional Thumb (T32) B.W + */ +static grub_err_t +grub_arm_reloc_thm_jump19 (grub_uint16_t *target, Elf32_Addr sym_addr) +{ + grub_int32_t offset; + + if (!(sym_addr & 1)) + return grub_error (GRUB_ERR_BAD_MODULE, + "Relocation targeting wrong execution state"); + + offset = grub_arm_thm_jump19_get_offset (target); + + /* Adjust and re-truncate offset */ + offset += sym_addr; + + if (!grub_arm_thm_jump19_check_offset (offset)) + return grub_error (GRUB_ERR_BAD_MODULE, + "THM_JUMP19 Relocation out of range."); + + grub_arm_thm_jump19_set_offset (target, offset); + + return GRUB_ERR_NONE; +} + +/* + * R_ARM_JUMP24 + * + * Relocate ARM (A32) B + */ +static grub_err_t +grub_arm_reloc_jump24 (grub_uint32_t *target, Elf32_Addr sym_addr) +{ + grub_int32_t offset; + + if (sym_addr & 1) + return grub_error (GRUB_ERR_BAD_MODULE, + "Relocation targeting wrong execution state"); + + offset = grub_arm_jump24_get_offset (target); + offset += sym_addr; + + if (!grub_arm_jump24_check_offset (offset)) + return grub_error (GRUB_ERR_BAD_MODULE, + "JUMP24 Relocation out of range."); + + + grub_arm_jump24_set_offset (target, offset); + + return GRUB_ERR_NONE; +} + +#endif + +void +SUFFIX (grub_mkimage_generate_elf) (const struct grub_install_image_target_desc *image_target, + int note, char **core_img, size_t *core_size, + Elf_Addr target_addr, grub_size_t align, + size_t kernel_size, size_t bss_size) { char *elf_img; size_t program_size; @@ -376,11 +496,12 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Shdr *symtab_section, Elf_Addr *section_addresses, Elf_Half section_entsize, Elf_Half num_sections, void *jumpers, Elf_Addr jumpers_addr, + Elf_Addr bss_start, Elf_Addr end, const struct grub_install_image_target_desc *image_target) { Elf_Word symtab_size, sym_size, num_syms; Elf_Off symtab_offset; - Elf_Addr start_address = 0; + Elf_Addr start_address = (Elf_Addr) -1; Elf_Sym *sym; Elf_Word i; Elf_Shdr *strtab_section; @@ -414,16 +535,22 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, } else if (cur_index == STN_UNDEF) { - if (sym->st_name) + if (sym->st_name && grub_strcmp (name, "__bss_start") == 0) + sym->st_value = bss_start; + else if (sym->st_name && grub_strcmp (name, "_end") == 0) + sym->st_value = end; + else if (sym->st_name) grub_util_error ("undefined symbol %s", name); else continue; } else if (cur_index >= num_sections) grub_util_error ("section %d does not exist", cur_index); - - sym->st_value = (grub_target_to_host (sym->st_value) - + section_addresses[cur_index]); + else + { + sym->st_value = (grub_target_to_host (sym->st_value) + + section_addresses[cur_index]); + } if (image_target->elf_target == EM_IA_64 && ELF_ST_TYPE (sym->st_info) == STT_FUNC) @@ -439,7 +566,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections, (unsigned long long) sym->st_value, (unsigned long long) section_addresses[cur_index]); - if (! start_address) + if (start_address == (Elf_Addr)-1) if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0) start_address = sym->st_value; } @@ -836,6 +963,14 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, *target = grub_host_to_target64 (grub_target_to_host64 (*target) + sym_addr); } break; + case R_AARCH64_ADD_ABS_LO12_NC: + grub_arm64_set_abs_lo12 ((grub_uint32_t *) target, + sym_addr); + break; + case R_AARCH64_LDST64_ABS_LO12_NC: + grub_arm64_set_abs_lo12_ldst64 ((grub_uint32_t *) target, + sym_addr); + break; case R_AARCH64_JUMP26: case R_AARCH64_CALL26: { @@ -848,6 +983,17 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, sym_addr); } break; + case R_AARCH64_ADR_PREL_PG_HI21: + { + sym_addr &= ~0xfffULL; + sym_addr -= (offset + SUFFIX (entry_point)) & ~0xfffULL; + if (!grub_arm64_check_hi21_signed (sym_addr)) + grub_util_error ("%s", "CALL26 Relocation out of range"); + + grub_arm64_set_hi21((grub_uint32_t *)target, + sym_addr); + } + break; default: grub_util_error (_("relocation 0x%x is not implemented yet"), (unsigned int) ELF_R_TYPE (info)); @@ -868,7 +1014,8 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, grub_util_info (" ABS32:\toffset=%d\t(0x%08x)", (int) sym_addr, (int) sym_addr); /* Data will be naturally aligned */ - sym_addr += 0x400; + if (image_target->id == IMAGE_EFI) + sym_addr += 0x400; *target = grub_host_to_target32 (grub_target_to_host32 (*target) + sym_addr); } break; @@ -962,9 +1109,9 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections, /* Add a PE32's fixup entry for a relocation. Return the resulting address after having written to the file OUT. */ static Elf_Addr -SUFFIX (add_fixup_entry) (struct fixup_block_list **cblock, grub_uint16_t type, - Elf_Addr addr, int flush, Elf_Addr current_address, - const struct grub_install_image_target_desc *image_target) +add_fixup_entry (struct fixup_block_list **cblock, grub_uint16_t type, + Elf_Addr addr, int flush, Elf_Addr current_address, + const struct grub_install_image_target_desc *image_target) { struct grub_pe32_fixup_block *b; @@ -1054,22 +1201,376 @@ SUFFIX (add_fixup_entry) (struct fixup_block_list **cblock, grub_uint16_t type, return current_address; } -/* Make a .reloc section. */ -static Elf_Addr -SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, - Elf_Addr *section_addresses, Elf_Shdr *sections, - Elf_Half section_entsize, Elf_Half num_sections, - const char *strtab, - Elf_Addr jumpers, grub_size_t njumpers, +struct raw_reloc +{ + struct raw_reloc *next; + grub_uint32_t offset; + enum raw_reloc_type { + RAW_RELOC_NONE = -1, + RAW_RELOC_32 = 0, + RAW_RELOC_MAX = 1, + } type; +}; + +struct translate_context +{ + /* PE */ + struct fixup_block_list *lst, *lst0; + Elf_Addr current_address; + + /* Raw */ + struct raw_reloc *raw_relocs; +}; + +static void +translate_reloc_start (struct translate_context *ctx, + const struct grub_install_image_target_desc *image_target) +{ + grub_memset (ctx, 0, sizeof (*ctx)); + if (image_target->id == IMAGE_EFI) + { + ctx->lst = ctx->lst0 = xmalloc (sizeof (*ctx->lst) + 2 * 0x1000); + memset (ctx->lst, 0, sizeof (*ctx->lst) + 2 * 0x1000); + ctx->current_address = 0; + } +} + +static void +translate_relocation_pe (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + /* Necessary to relocate only absolute addresses. */ + switch (image_target->elf_target) + { + case EM_386: + if (ELF_R_TYPE (info) == R_386_32) + { + grub_util_info ("adding a relocation entry for 0x%" + GRUB_HOST_PRIxLONG_LONG, + (unsigned long long) addr); + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_HIGHLOW, + addr, 0, ctx->current_address, + image_target); + } + break; + case EM_X86_64: + if ((ELF_R_TYPE (info) == R_X86_64_32) || + (ELF_R_TYPE (info) == R_X86_64_32S)) + { + grub_util_error ("can\'t add fixup entry for R_X86_64_32(S)"); + } + else if (ELF_R_TYPE (info) == R_X86_64_64) + { + grub_util_info ("adding a relocation entry for 0x%" + GRUB_HOST_PRIxLONG_LONG, + (unsigned long long) addr); + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + addr, + 0, ctx->current_address, + image_target); + } + break; + case EM_IA_64: + switch (ELF_R_TYPE (info)) + { + case R_IA64_PCREL64LSB: + case R_IA64_LDXMOV: + case R_IA64_PCREL21B: + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF22: + case R_IA64_GPREL22: + case R_IA64_SEGREL64LSB: + break; + + case R_IA64_FPTR64LSB: + case R_IA64_DIR64LSB: +#if 1 + { + grub_util_info ("adding a relocation entry for 0x%" + GRUB_HOST_PRIxLONG_LONG, + (unsigned long long) addr); + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + addr, + 0, ctx->current_address, + image_target); + } +#endif + break; + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; + case EM_AARCH64: + switch (ELF_R_TYPE (info)) + { + case R_AARCH64_ABS64: + { + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + addr, 0, ctx->current_address, + image_target); + } + break; + /* Relative relocations do not require fixup entries. */ + case R_AARCH64_CALL26: + case R_AARCH64_JUMP26: + break; + /* Page-relative relocations do not require fixup entries. */ + case R_AARCH64_ADR_PREL_PG_HI21: + /* We page-align the whole kernel, so no need + for fixup entries. + */ + case R_AARCH64_ADD_ABS_LO12_NC: + case R_AARCH64_LDST64_ABS_LO12_NC: + break; + + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; + break; +#if defined(MKIMAGE_ELF32) + case EM_ARM: + switch (ELF_R_TYPE (info)) + { + case R_ARM_V4BX: + /* Relative relocations do not require fixup entries. */ + case R_ARM_JUMP24: + case R_ARM_THM_CALL: + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + case R_ARM_CALL: + { + grub_util_info (" %s: not adding fixup: 0x%08x : 0x%08x", __FUNCTION__, (unsigned int) addr, (unsigned int) ctx->current_address); + } + break; + /* Create fixup entry for PE/COFF loader */ + case R_ARM_ABS32: + { + ctx->current_address + = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_HIGHLOW, + addr, 0, ctx->current_address, + image_target); + } + break; + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; +#endif /* defined(MKIMAGE_ELF32) */ + default: + grub_util_error ("unknown machine type 0x%x", image_target->elf_target); + } +} + +static enum raw_reloc_type +classify_raw_reloc (Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + /* Necessary to relocate only absolute addresses. */ + switch (image_target->elf_target) + { + case EM_ARM: + switch (ELF_R_TYPE (info)) + { + case R_ARM_V4BX: + case R_ARM_JUMP24: + case R_ARM_THM_CALL: + case R_ARM_THM_JUMP19: + case R_ARM_THM_JUMP24: + case R_ARM_CALL: + return RAW_RELOC_NONE; + case R_ARM_ABS32: + return RAW_RELOC_32; + default: + grub_util_error (_("relocation 0x%x is not implemented yet"), + (unsigned int) ELF_R_TYPE (info)); + break; + } + break; + default: + grub_util_error ("unknown machine type 0x%x", image_target->elf_target); + } +} + +static void +translate_relocation_raw (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + enum raw_reloc_type class = classify_raw_reloc (info, image_target); + struct raw_reloc *rel; + if (class == RAW_RELOC_NONE) + return; + rel = xmalloc (sizeof (*rel)); + rel->next = ctx->raw_relocs; + rel->type = class; + rel->offset = addr; + ctx->raw_relocs = rel; +} + +static void +translate_relocation (struct translate_context *ctx, + Elf_Addr addr, + Elf_Addr info, + const struct grub_install_image_target_desc *image_target) +{ + if (image_target->id == IMAGE_EFI) + translate_relocation_pe (ctx, addr, info, image_target); + else + translate_relocation_raw (ctx, addr, info, image_target); +} + +static void +finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_layout *layout, const struct grub_install_image_target_desc *image_target) +{ + ctx->current_address = add_fixup_entry (&ctx->lst, 0, 0, 1, ctx->current_address, image_target); + + { + grub_uint8_t *ptr; + layout->reloc_section = ptr = xmalloc (ctx->current_address); + for (ctx->lst = ctx->lst0; ctx->lst; ctx->lst = ctx->lst->next) + if (ctx->lst->state) + { + memcpy (ptr, &ctx->lst->b, grub_target_to_host32 (ctx->lst->b.block_size)); + ptr += grub_target_to_host32 (ctx->lst->b.block_size); + } + assert ((ctx->current_address + (grub_uint8_t *) layout->reloc_section) == ptr); + } + + for (ctx->lst = ctx->lst0; ctx->lst; ) + { + struct fixup_block_list *next; + next = ctx->lst->next; + free (ctx->lst); + ctx->lst = next; + } + + layout->reloc_size = ctx->current_address; + if (image_target->elf_target == EM_ARM && layout->reloc_size > GRUB_KERNEL_ARM_STACK_SIZE) + grub_util_error ("Reloc section (%d) is bigger than stack size (%d). " + "This breaks assembly assumptions. Please increase stack size", + (int) layout->reloc_size, + (int) GRUB_KERNEL_ARM_STACK_SIZE); +} + +/* + Layout: + + + + + ... + + + each relocation starts with 32-bit offset. Rest depends on relocation. + mkimage stops when it sees first unknown type or end marker. + This allows images to be created with mismatched mkimage and + kernel as long as no relocations are present in kernel that mkimage + isn't aware of (in which case mkimage aborts). + This also allows simple assembly to do the relocs. +*/ + +#define RAW_SEPARATOR 0xfffffffe +#define RAW_END_MARKER 0xffffffff + +static void +finish_reloc_translation_raw (struct translate_context *ctx, struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) +{ + size_t count = 0, sz; + enum raw_reloc_type highest = RAW_RELOC_NONE; + enum raw_reloc_type curtype; + struct raw_reloc *cur; + grub_uint32_t *p; + if (!ctx->raw_relocs) + { + layout->reloc_section = p = xmalloc (sizeof (grub_uint32_t)); + p[0] = RAW_END_MARKER; + layout->reloc_size = sizeof (grub_uint32_t); + return; + } + for (cur = ctx->raw_relocs; cur; cur = cur->next) + { + count++; + if (cur->type > highest) + highest = cur->type; + } + /* highest separators, count relocations and one end marker. */ + sz = (highest + count + 1) * sizeof (grub_uint32_t); + layout->reloc_section = p = xmalloc (sz); + for (curtype = 0; curtype <= highest; curtype++) + { + /* Support for special cases would go here. */ + for (cur = ctx->raw_relocs; cur; cur = cur->next) + if (cur->type == curtype) + { + *p++ = cur->offset; + } + *p++ = RAW_SEPARATOR; + } + *--p = RAW_END_MARKER; + layout->reloc_size = sz; +} + +static void +finish_reloc_translation (struct translate_context *ctx, struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) +{ + if (image_target->id == IMAGE_EFI) + finish_reloc_translation_pe (ctx, layout, image_target); + else + finish_reloc_translation_raw (ctx, layout, image_target); +} + + +static void +translate_reloc_jumpers (struct translate_context *ctx, + Elf_Addr jumpers, grub_size_t njumpers, + const struct grub_install_image_target_desc *image_target) +{ + unsigned i; + assert (image_target->id == IMAGE_EFI); + for (i = 0; i < njumpers; i++) + ctx->current_address = add_fixup_entry (&ctx->lst, + GRUB_PE32_REL_BASED_DIR64, + jumpers + 8 * i, + 0, ctx->current_address, + image_target); +} + +/* Make a .reloc section. */ +static void +make_reloc_section (Elf_Ehdr *e, struct grub_mkimage_layout *layout, + Elf_Addr *section_addresses, Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections, + const char *strtab, + const struct grub_install_image_target_desc *image_target) { unsigned i; Elf_Shdr *s; - struct fixup_block_list *lst, *lst0; - Elf_Addr current_address = 0; + struct translate_context ctx; - lst = lst0 = xmalloc (sizeof (*lst) + 2 * 0x1000); - memset (lst, 0, sizeof (*lst) + 2 * 0x1000); + translate_reloc_start (&ctx, image_target); for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -1098,190 +1599,25 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, { Elf_Addr info; Elf_Addr offset; + Elf_Addr addr; offset = grub_target_to_host (r->r_offset); info = grub_target_to_host (r->r_info); - /* Necessary to relocate only absolute addresses. */ - switch (image_target->elf_target) - { - case EM_386: - if (ELF_R_TYPE (info) == R_386_32) - { - Elf_Addr addr; + addr = section_address + offset; - addr = section_address + offset; - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, - (unsigned long long) addr); - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_HIGHLOW, - addr, 0, current_address, - image_target); - } - break; - case EM_X86_64: - if ((ELF_R_TYPE (info) == R_X86_64_32) || - (ELF_R_TYPE (info) == R_X86_64_32S)) - { - grub_util_error ("can\'t add fixup entry for R_X86_64_32(S)"); - } - else if (ELF_R_TYPE (info) == R_X86_64_64) - { - Elf_Addr addr; - - addr = section_address + offset; - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, - (unsigned long long) addr); - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - addr, - 0, current_address, - image_target); - } - break; - case EM_IA_64: - switch (ELF_R_TYPE (info)) - { - case R_IA64_PCREL64LSB: - case R_IA64_LDXMOV: - case R_IA64_PCREL21B: - case R_IA64_LTOFF_FPTR22: - case R_IA64_LTOFF22X: - case R_IA64_LTOFF22: - case R_IA64_GPREL22: - case R_IA64_SEGREL64LSB: - break; - - case R_IA64_FPTR64LSB: - case R_IA64_DIR64LSB: -#if 1 - { - Elf_Addr addr; - - addr = section_address + offset; - grub_util_info ("adding a relocation entry for 0x%" - GRUB_HOST_PRIxLONG_LONG, - (unsigned long long) addr); - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - addr, - 0, current_address, - image_target); - } -#endif - break; - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); - break; - } - break; - case EM_AARCH64: - switch (ELF_R_TYPE (info)) - { - case R_AARCH64_ABS64: - { - Elf_Addr addr; - - addr = section_address + offset; - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - addr, 0, current_address, - image_target); - } - break; - /* Relative relocations do not require fixup entries. */ - case R_AARCH64_CALL26: - case R_AARCH64_JUMP26: - break; - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); - break; - } - break; - break; -#if defined(MKIMAGE_ELF32) - case EM_ARM: - switch (ELF_R_TYPE (info)) - { - case R_ARM_V4BX: - /* Relative relocations do not require fixup entries. */ - case R_ARM_JUMP24: - case R_ARM_THM_CALL: - case R_ARM_THM_JUMP19: - case R_ARM_THM_JUMP24: - case R_ARM_CALL: - { - Elf_Addr addr; - - addr = section_address + offset; - grub_util_info (" %s: not adding fixup: 0x%08x : 0x%08x", __FUNCTION__, (unsigned int) addr, (unsigned int) current_address); - } - break; - /* Create fixup entry for PE/COFF loader */ - case R_ARM_ABS32: - { - Elf_Addr addr; - - addr = section_address + offset; - current_address - = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_HIGHLOW, - addr, 0, current_address, - image_target); - } - break; - default: - grub_util_error (_("relocation 0x%x is not implemented yet"), - (unsigned int) ELF_R_TYPE (info)); - break; - } - break; -#endif /* defined(MKIMAGE_ELF32) */ - default: - grub_util_error ("unknown machine type 0x%x", image_target->elf_target); - } + translate_relocation (&ctx, addr, info, image_target); } } if (image_target->elf_target == EM_IA_64) - for (i = 0; i < njumpers; i++) - current_address = SUFFIX (add_fixup_entry) (&lst, - GRUB_PE32_REL_BASED_DIR64, - jumpers + 8 * i, - 0, current_address, - image_target); + translate_reloc_jumpers (&ctx, + layout->ia64jmp_off + + image_target->vaddr_offset, + 2 * layout->ia64jmpnum + (layout->got_size / 8), + image_target); - current_address = SUFFIX (add_fixup_entry) (&lst, 0, 0, 1, current_address, image_target); - - { - grub_uint8_t *ptr; - ptr = *out = xmalloc (current_address); - for (lst = lst0; lst; lst = lst->next) - if (lst->state) - { - memcpy (ptr, &lst->b, grub_target_to_host32 (lst->b.block_size)); - ptr += grub_target_to_host32 (lst->b.block_size); - } - assert ((current_address + (grub_uint8_t *) *out) == ptr); - } - - for (lst = lst0; lst; ) - { - struct fixup_block_list *next; - next = lst->next; - free (lst); - lst = next; - } - - return current_address; + finish_reloc_translation (&ctx, layout, image_target); } /* Determine if this section is a text section. Return false if this @@ -1289,24 +1625,31 @@ SUFFIX (make_reloc_section) (Elf_Ehdr *e, void **out, static int SUFFIX (is_text_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) { - if (image_target->id != IMAGE_EFI + if (!is_relocatable (image_target) && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) return 0; return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) == (SHF_EXECINSTR | SHF_ALLOC)); } -/* Determine if this section is a data section. This assumes that - BSS is also a data section, since the converter initializes BSS - when producing PE32 to avoid a bug in EFI implementations. */ +/* Determine if this section is a data section. */ static int SUFFIX (is_data_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) { - if (image_target->id != IMAGE_EFI + if (!is_relocatable (image_target) && grub_target_to_host32 (s->sh_type) != SHT_PROGBITS) return 0; return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) - == SHF_ALLOC); + == SHF_ALLOC) && !(grub_target_to_host32 (s->sh_type) == SHT_NOBITS); +} + +static int +SUFFIX (is_bss_section) (Elf_Shdr *s, const struct grub_install_image_target_desc *image_target) +{ + if (!is_relocatable (image_target)) + return 0; + return ((grub_target_to_host (s->sh_flags) & (SHF_EXECINSTR | SHF_ALLOC)) + == SHF_ALLOC) && (grub_target_to_host32 (s->sh_type) == SHT_NOBITS); } /* Return if the ELF header is valid. */ @@ -1326,82 +1669,13 @@ SUFFIX (check_elf_header) (Elf_Ehdr *e, size_t size, const struct grub_install_i return 1; } -/* Locate section addresses by merging code sections and data sections - into .text and .data, respectively. Return the array of section - addresses. */ -static Elf_Addr * -SUFFIX (locate_sections) (const char *kernel_path, - Elf_Shdr *sections, Elf_Half section_entsize, - Elf_Half num_sections, const char *strtab, - size_t *exec_size, size_t *kernel_sz, - size_t *all_align, - const struct grub_install_image_target_desc *image_target) +static Elf_Addr +SUFFIX (put_section) (Elf_Shdr *s, int i, + Elf_Addr current_address, + Elf_Addr *section_addresses, + const char *strtab, + const struct grub_install_image_target_desc *image_target) { - int i; - Elf_Addr current_address; - Elf_Addr *section_addresses; - Elf_Shdr *s; - - *all_align = 1; - - section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); - memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); - - current_address = 0; - - for (i = 0, s = sections; - i < num_sections; - i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if ((grub_target_to_host (s->sh_flags) & SHF_ALLOC) - && grub_host_to_target32 (s->sh_addralign) > *all_align) - *all_align = grub_host_to_target32 (s->sh_addralign); - - - /* .text */ - for (i = 0, s = sections; - i < num_sections; - i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if (SUFFIX (is_text_section) (s, image_target)) - { - Elf_Word align = grub_host_to_target_addr (s->sh_addralign); - const char *name = strtab + grub_host_to_target32 (s->sh_name); - if (align) - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, - align) - image_target->vaddr_offset; - grub_util_info ("locating the section %s at 0x%" - GRUB_HOST_PRIxLONG_LONG, - name, (unsigned long long) current_address); - if (image_target->id != IMAGE_EFI) - { - current_address = grub_host_to_target_addr (s->sh_addr) - - image_target->link_addr; - if (grub_host_to_target_addr (s->sh_addr) - != image_target->link_addr) - { - char *msg - = grub_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx" - " instead of 0x%llx: ld.gold bug?"), - kernel_path, - (unsigned long long) grub_host_to_target_addr (s->sh_addr), - (unsigned long long) image_target->link_addr); - grub_util_error ("%s", msg); - } - } - section_addresses[i] = current_address; - current_address += grub_host_to_target_addr (s->sh_size); - } - - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, - image_target->section_align) - - image_target->vaddr_offset; - *exec_size = current_address; - - /* .data */ - for (i = 0, s = sections; - i < num_sections; - i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) - if (SUFFIX (is_data_section) (s, image_target)) - { Elf_Word align = grub_host_to_target_addr (s->sh_addralign); const char *name = strtab + grub_host_to_target32 (s->sh_name); @@ -1413,26 +1687,135 @@ SUFFIX (locate_sections) (const char *kernel_path, grub_util_info ("locating the section %s at 0x%" GRUB_HOST_PRIxLONG_LONG, name, (unsigned long long) current_address); - if (image_target->id != IMAGE_EFI) + if (!is_relocatable (image_target)) current_address = grub_host_to_target_addr (s->sh_addr) - image_target->link_addr; section_addresses[i] = current_address; current_address += grub_host_to_target_addr (s->sh_size); + return current_address; +} + +/* Locate section addresses by merging code sections and data sections + into .text and .data, respectively. Return the array of section + addresses. */ +static Elf_Addr * +SUFFIX (locate_sections) (Elf_Ehdr *e, const char *kernel_path, + Elf_Shdr *sections, Elf_Half section_entsize, + Elf_Half num_sections, const char *strtab, + struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) +{ + int i; + Elf_Addr *section_addresses; + Elf_Shdr *s; + + layout->align = 1; + /* Page-aligning simplifies relocation handling. */ + if (image_target->elf_target == EM_AARCH64) + layout->align = 4096; + + section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); + memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); + + layout->kernel_size = 0; + + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if ((grub_target_to_host (s->sh_flags) & SHF_ALLOC) + && grub_host_to_target32 (s->sh_addralign) > layout->align) + layout->align = grub_host_to_target32 (s->sh_addralign); + + + /* .text */ + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if (SUFFIX (is_text_section) (s, image_target)) + { + layout->kernel_size = SUFFIX (put_section) (s, i, + layout->kernel_size, + section_addresses, + strtab, + image_target); + if (!is_relocatable (image_target) && + grub_host_to_target_addr (s->sh_addr) != image_target->link_addr) + { + char *msg + = grub_xasprintf (_("`%s' is miscompiled: its start address is 0x%llx" + " instead of 0x%llx: ld.gold bug?"), + kernel_path, + (unsigned long long) grub_host_to_target_addr (s->sh_addr), + (unsigned long long) image_target->link_addr); + grub_util_error ("%s", msg); + } } - current_address = ALIGN_UP (current_address + image_target->vaddr_offset, + layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset, + image_target->section_align) + - image_target->vaddr_offset; + layout->exec_size = layout->kernel_size; + + /* .data */ + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if (SUFFIX (is_data_section) (s, image_target)) + layout->kernel_size = SUFFIX (put_section) (s, i, + layout->kernel_size, + section_addresses, + strtab, + image_target); + +#ifdef MKIMAGE_ELF32 + if (image_target->elf_target == EM_ARM) + { + grub_size_t tramp; + layout->kernel_size = ALIGN_UP (layout->kernel_size + image_target->vaddr_offset, + image_target->section_align) - image_target->vaddr_offset; + + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); + + tramp = arm_get_trampoline_size (e, sections, section_entsize, + num_sections, image_target); + + layout->tramp_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (tramp, 16); + } +#endif + + layout->bss_start = layout->kernel_size; + layout->end = layout->kernel_size; + + /* .bss */ + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if (SUFFIX (is_bss_section) (s, image_target)) + layout->end = SUFFIX (put_section) (s, i, + layout->end, + section_addresses, + strtab, + image_target); + + layout->end = ALIGN_UP (layout->end + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - *kernel_sz = current_address; + /* Explicitly initialize BSS + when producing PE32 to avoid a bug in EFI implementations. + Platforms other than EFI and U-boot shouldn't have .bss in + their binaries as we build with -Wl,-Ttext. + */ + if (image_target->id != IMAGE_UBOOT) + layout->kernel_size = layout->end; + return section_addresses; } -static char * -SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, - size_t *kernel_sz, size_t *bss_size, - size_t total_module_size, grub_uint64_t *start, - void **reloc_section, size_t *reloc_size, - size_t *align, - const struct grub_install_image_target_desc *image_target) +char * +SUFFIX (grub_mkimage_load_image) (const char *kernel_path, + size_t total_module_size, + struct grub_mkimage_layout *layout, + const struct grub_install_image_target_desc *image_target) { char *kernel_img, *out_img; const char *strtab; @@ -1446,12 +1829,11 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, Elf_Off section_offset; Elf_Half section_entsize; grub_size_t kernel_size; - grub_size_t ia64jmp_off = 0, tramp_off = 0, ia64_got_off = 0; - unsigned ia64jmpnum = 0; Elf_Shdr *symtab_section = 0; - grub_size_t got = 0; - *start = 0; + grub_memset (layout, 0, sizeof (*layout)); + + layout->start_address = 0; kernel_size = grub_util_get_image_size (kernel_path); kernel_img = xmalloc (kernel_size); @@ -1465,7 +1847,7 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, section_entsize = grub_target_to_host16 (e->e_shentsize); num_sections = grub_target_to_host16 (e->e_shnum); - if (kernel_size < section_offset + section_entsize * num_sections) + if (kernel_size < section_offset + (grub_uint32_t) section_entsize * num_sections) grub_util_error (_("premature end of file %s"), kernel_path); sections = (Elf_Shdr *) (kernel_img + section_offset); @@ -1475,10 +1857,10 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, + grub_host_to_target16 (e->e_shstrndx) * section_entsize); strtab = (char *) e + grub_host_to_target_addr (s->sh_offset); - section_addresses = SUFFIX (locate_sections) (kernel_path, + section_addresses = SUFFIX (locate_sections) (e, kernel_path, sections, section_entsize, num_sections, strtab, - exec_size, kernel_sz, align, + layout, image_target); section_vaddresses = xmalloc (sizeof (*section_addresses) * num_sections); @@ -1486,9 +1868,9 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, for (i = 0; i < num_sections; i++) section_vaddresses[i] = section_addresses[i] + image_target->vaddr_offset; - if (image_target->id != IMAGE_EFI) + if (!is_relocatable (image_target)) { - Elf_Addr current_address = *kernel_sz; + Elf_Addr current_address = layout->kernel_size; for (i = 0, s = sections; i < num_sections; @@ -1507,7 +1889,7 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, grub_util_info ("locating the section %s at 0x%" GRUB_HOST_PRIxLONG_LONG, name, (unsigned long long) current_address); - if (image_target->id != IMAGE_EFI) + if (!is_relocatable (image_target)) current_address = grub_host_to_target_addr (s->sh_addr) - image_target->link_addr; @@ -1518,17 +1900,18 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, current_address = ALIGN_UP (current_address + image_target->vaddr_offset, image_target->section_align) - image_target->vaddr_offset; - *bss_size = current_address - *kernel_sz; + layout->bss_size = current_address - layout->kernel_size; } else - *bss_size = 0; + layout->bss_size = 0; if (image_target->id == IMAGE_SPARC64_AOUT || image_target->id == IMAGE_SPARC64_RAW + || image_target->id == IMAGE_UBOOT || image_target->id == IMAGE_SPARC64_CDCORE) - *kernel_sz = ALIGN_UP (*kernel_sz, image_target->mod_align); + layout->kernel_size = ALIGN_UP (layout->kernel_size, image_target->mod_align); - if (image_target->id == IMAGE_EFI) + if (is_relocatable (image_target)) { symtab_section = NULL; for (i = 0, s = sections; @@ -1541,88 +1924,87 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, } if (! symtab_section) grub_util_error ("%s", _("no symbol table")); - -#ifdef MKIMAGE_ELF32 - if (image_target->elf_target == EM_ARM) - { - grub_size_t tramp; - - *kernel_sz = ALIGN_UP (*kernel_sz, 16); - - tramp = arm_get_trampoline_size (e, sections, section_entsize, - num_sections, image_target); - - tramp_off = *kernel_sz; - *kernel_sz += ALIGN_UP (tramp, 16); - } -#endif - #ifdef MKIMAGE_ELF64 if (image_target->elf_target == EM_IA_64) { grub_size_t tramp; - *kernel_sz = ALIGN_UP (*kernel_sz, 16); + layout->kernel_size = ALIGN_UP (layout->kernel_size, 16); - grub_ia64_dl_get_tramp_got_size (e, &tramp, &got); + grub_ia64_dl_get_tramp_got_size (e, &tramp, &layout->got_size); - tramp_off = *kernel_sz; - *kernel_sz += ALIGN_UP (tramp, 16); + layout->tramp_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (tramp, 16); - ia64jmp_off = *kernel_sz; - ia64jmpnum = SUFFIX (count_funcs) (e, symtab_section, - image_target); - *kernel_sz += 16 * ia64jmpnum; + layout->ia64jmp_off = layout->kernel_size; + layout->ia64jmpnum = SUFFIX (count_funcs) (e, symtab_section, + image_target); + layout->kernel_size += 16 * layout->ia64jmpnum; - ia64_got_off = *kernel_sz; - *kernel_sz += ALIGN_UP (got, 16); + layout->ia64_got_off = layout->kernel_size; + layout->kernel_size += ALIGN_UP (layout->got_size, 16); } #endif - } else { - *reloc_size = 0; - *reloc_section = NULL; + layout->reloc_size = 0; + layout->reloc_section = NULL; } - out_img = xmalloc (*kernel_sz + total_module_size); - memset (out_img, 0, *kernel_sz + total_module_size); + out_img = xmalloc (layout->kernel_size + total_module_size); + memset (out_img, 0, layout->kernel_size + total_module_size); - if (image_target->id == IMAGE_EFI) + if (is_relocatable (image_target)) { - *start = SUFFIX (relocate_symbols) (e, sections, symtab_section, + layout->start_address = SUFFIX (relocate_symbols) (e, sections, symtab_section, section_vaddresses, section_entsize, num_sections, - (char *) out_img + ia64jmp_off, - ia64jmp_off + (char *) out_img + layout->ia64jmp_off, + layout->ia64jmp_off + image_target->vaddr_offset, + layout->bss_start, + layout->end, image_target); - if (*start == 0) + if (layout->start_address == (Elf_Addr) -1) grub_util_error ("start symbol is not defined"); - SUFFIX (entry_point) = (Elf_Addr) *start; + SUFFIX (entry_point) = (Elf_Addr) layout->start_address; /* Resolve addresses in the virtual address space. */ SUFFIX (relocate_addresses) (e, sections, section_addresses, section_entsize, num_sections, strtab, - out_img, tramp_off, ia64_got_off, + out_img, layout->tramp_off, + layout->ia64_got_off, image_target); - *reloc_size = SUFFIX (make_reloc_section) (e, reloc_section, - section_vaddresses, sections, - section_entsize, num_sections, - strtab, ia64jmp_off - + image_target->vaddr_offset, - 2 * ia64jmpnum + (got / 8), - image_target); + make_reloc_section (e, layout, + section_vaddresses, sections, + section_entsize, num_sections, + strtab, + image_target); + if (image_target->id != IMAGE_EFI) + { + out_img = xrealloc (out_img, layout->kernel_size + total_module_size + + ALIGN_UP (layout->reloc_size, image_target->mod_align)); + memcpy (out_img + layout->kernel_size, layout->reloc_section, layout->reloc_size); + memset (out_img + layout->kernel_size + layout->reloc_size, 0, + total_module_size + ALIGN_UP (layout->reloc_size, image_target->mod_align) - layout->reloc_size); + layout->kernel_size += ALIGN_UP (layout->reloc_size, image_target->mod_align); + } } for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (SUFFIX (is_data_section) (s, image_target) + /* Explicitly initialize BSS + when producing PE32 to avoid a bug in EFI implementations. + Platforms other than EFI and U-boot shouldn't have .bss in + their binaries as we build with -Wl,-Ttext. + */ + || (SUFFIX (is_bss_section) (s, image_target) && (image_target->id != IMAGE_UBOOT)) || SUFFIX (is_text_section) (s, image_target)) { if (grub_target_to_host32 (s->sh_type) == SHT_NOBITS) @@ -1640,23 +2022,3 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size, return out_img; } - - -#undef SUFFIX -#undef ELFCLASSXX -#undef Elf_Ehdr -#undef Elf_Phdr -#undef Elf_Nhdr -#undef Elf_Shdr -#undef Elf_Addr -#undef Elf_Sym -#undef Elf_Off -#undef Elf_Rela -#undef Elf_Rel -#undef ELF_R_TYPE -#undef ELF_R_SYM -#undef Elf_Word -#undef Elf_Half -#undef Elf_Section -#undef ELF_ST_TYPE -#undef XEN_NOTE_SIZE diff --git a/util/grub-mklayout.c b/util/grub-mklayout.c index 1a4f1b4c8..d171c2700 100644 --- a/util/grub-mklayout.c +++ b/util/grub-mklayout.c @@ -384,6 +384,13 @@ write_keymaps (FILE *in, FILE *out, const char *out_filename) sscanf (line, "keycode %u = %60s %60s %60s %60s", &keycode_linux, normal, shift, normalalt, shiftalt); + if (keycode_linux >= ARRAY_SIZE (linux_to_usb_map)) + { + /* TRANSLATORS: scan code is keyboard key numeric identifier. */ + fprintf (stderr, _("Unknown keyboard scan code 0x%02x\n"), keycode_linux); + continue; + } + /* Not used. */ if (keycode_linux == 0x77 /* Pause */ /* Some obscure keys */ diff --git a/util/grub-mknetdir.c b/util/grub-mknetdir.c index 3813e8bc0..82073d5cc 100644 --- a/util/grub-mknetdir.c +++ b/util/grub-mknetdir.c @@ -106,7 +106,8 @@ static const struct [GRUB_INSTALL_PLATFORM_I386_EFI] = { "i386-efi", "efinet", ".efi" }, [GRUB_INSTALL_PLATFORM_X86_64_EFI] = { "x86_64-efi", "efinet", ".efi" }, [GRUB_INSTALL_PLATFORM_IA64_EFI] = { "ia64-efi", "efinet", ".efi" }, - [GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm-efi", "efinet", ".efi" } + [GRUB_INSTALL_PLATFORM_ARM_EFI] = { "arm-efi", "efinet", ".efi" }, + [GRUB_INSTALL_PLATFORM_ARM64_EFI] = { "arm64-efi", "efinet", ".efi" } }; static void diff --git a/util/grub-mkrescue.c b/util/grub-mkrescue.c index 451182647..238d4840e 100644 --- a/util/grub-mkrescue.c +++ b/util/grub-mkrescue.c @@ -310,6 +310,7 @@ make_image_fwdisk_abs (enum grub_install_plat plat, grub_install_make_image_wrap (source_dirs[plat], "()/boot/grub", output, 0, load_cfg, mkimage_target, 0); grub_install_pop_module (); + grub_util_unlink (load_cfg); } static int @@ -647,6 +648,7 @@ main (int argc, char *argv[]) } grub_install_pop_module (); grub_install_pop_module (); + grub_util_unlink (load_cfg); } /** build multiboot core.img */ @@ -785,9 +787,14 @@ main (int argc, char *argv[]) free (efidir_efi_boot); efiimgfat = grub_util_path_concat (2, iso9660_dir, "efi.img"); - grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i", + int rv; + rv = grub_util_exec ((const char * []) { "mformat", "-C", "-f", "2880", "-L", "16", "-i", efiimgfat, "::", NULL }); - grub_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL }); + if (rv != 0) + grub_util_error ("`%s` invocation failed\n", "mformat"); + rv = grub_util_exec ((const char * []) { "mcopy", "-s", "-i", efiimgfat, efidir_efi, "::/", NULL }); + if (rv != 0) + grub_util_error ("`%s` invocation failed\n", "mformat"); xorriso_push ("--efi-boot"); xorriso_push ("efi.img"); xorriso_push ("-efi-boot-part"); diff --git a/util/grub-module-verifier.c b/util/grub-module-verifier.c new file mode 100644 index 000000000..405c91170 --- /dev/null +++ b/util/grub-module-verifier.c @@ -0,0 +1,144 @@ +#include +#include + +#include +#include +#include +#include + +struct grub_module_verifier_arch archs[] = { + { "i386", 4, 0, EM_386, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ + R_386_32, + R_386_PC32, + -1 + } }, + { "x86_64", 8, 0, EM_X86_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_X86_64_64, + R_X86_64_PC64, + /* R_X86_64_32, R_X86_64_32S are supported but shouldn't be used because of their limited range. */ + -1 + }, (int[]){ + R_X86_64_PC32, + -1 + } + }, + { "powerpc", 4, 1, EM_PPC, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + GRUB_ELF_R_PPC_ADDR16_LO, + GRUB_ELF_R_PPC_REL24, /* It has limited range but GRUB adds trampolines when necessarry. */ + GRUB_ELF_R_PPC_ADDR16_HA, + GRUB_ELF_R_PPC_ADDR32, + GRUB_ELF_R_PPC_REL32, + -1 + } }, + { "sparc64", 8, 1, EM_SPARCV9, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_SPARC_WDISP30, /* It has limited range but GRUB adds trampolines when necessarry. */ + R_SPARC_HH22, + R_SPARC_HM10, + R_SPARC_LM22, + R_SPARC_LO10, + R_SPARC_64, + R_SPARC_OLO10, + /* Following 2 relocations have limited range but unfortunately + clang generates them, as it doesn't implement mcmodel=large properly. + At least our heap and core are under 4G, so it's not a problem + usually. */ + R_SPARC_HI22, + R_SPARC_32, + -1 + } }, + { "ia64", 8, 0, EM_IA_64, GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_IA64_PCREL21B, /* We should verify that it's pointing either + to a function or to a section in the same module. + Checking that external symbol is a function is + non-trivial and I have never seen this relocation used + for anything else, so assume that it always points to a + function. + */ + R_IA64_SEGREL64LSB, + R_IA64_FPTR64LSB, + R_IA64_DIR64LSB, + R_IA64_PCREL64LSB, + R_IA64_LTOFF22X, + R_IA64_LTOFF22, + R_IA64_LTOFF_FPTR22, + R_IA64_LDXMOV, + -1 + }, (int[]){ + R_IA64_GPREL22, + -1 + } }, + { "mipsel", 4, 0, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_MIPS_HI16, + R_MIPS_LO16, + R_MIPS_32, + R_MIPS_GPREL32, + R_MIPS_26, + R_MIPS_GOT16, + R_MIPS_CALL16, + R_MIPS_JALR, + -1 + } }, + { "mips", 4, 1, EM_MIPS, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_MIPS_HI16, + R_MIPS_LO16, + R_MIPS_32, + R_MIPS_GPREL32, + R_MIPS_26, + R_MIPS_GOT16, + R_MIPS_CALL16, + R_MIPS_JALR, + -1 + } }, + { "arm", 4, 0, EM_ARM, GRUB_MODULE_VERIFY_SUPPORTS_REL, (int[]){ + /* Some relocations are range-limited but trampolines are added when necessarry. */ + R_ARM_ABS32, + R_ARM_CALL, + R_ARM_JUMP24, + R_ARM_THM_CALL, + R_ARM_THM_JUMP24, + R_ARM_V4BX, + R_ARM_THM_MOVW_ABS_NC, + R_ARM_THM_MOVT_ABS, + R_ARM_THM_JUMP19, + -1 + } }, + { "arm64", 8, 0, EM_AARCH64, GRUB_MODULE_VERIFY_SUPPORTS_REL | GRUB_MODULE_VERIFY_SUPPORTS_RELA, (int[]){ + R_AARCH64_ABS64, + R_AARCH64_CALL26, + R_AARCH64_JUMP26, + -1 + }, (int[]){ + R_AARCH64_ADR_PREL_PG_HI21, + R_AARCH64_ADD_ABS_LO12_NC, + R_AARCH64_LDST64_ABS_LO12_NC, + -1 + } + }, +}; + + +int +main (int argc, char **argv) +{ + size_t module_size; + unsigned arch; + char *module_img; + if (argc != 3) { + fprintf (stderr, "usage: %s FILE ARCH\n", argv[0]); + return 1; + } + + for (arch = 0; arch < ARRAY_SIZE(archs); arch++) + if (strcmp(archs[arch].name, argv[2]) == 0) + break; + if (arch == ARRAY_SIZE(archs)) + grub_util_error("unknown arch: %s", argv[2]); + + module_size = grub_util_get_image_size (argv[1]); + module_img = grub_util_read_image (argv[1]); + if (archs[arch].voidp_sizeof == 8) + grub_module_verify64(module_img, module_size, &archs[arch]); + else + grub_module_verify32(module_img, module_size, &archs[arch]); + return 0; +} diff --git a/util/grub-module-verifier32.c b/util/grub-module-verifier32.c new file mode 100644 index 000000000..257229f8f --- /dev/null +++ b/util/grub-module-verifier32.c @@ -0,0 +1,2 @@ +#define MODULEVERIFIER_ELF32 1 +#include "grub-module-verifierXX.c" diff --git a/util/grub-module-verifier64.c b/util/grub-module-verifier64.c new file mode 100644 index 000000000..4db6b4bed --- /dev/null +++ b/util/grub-module-verifier64.c @@ -0,0 +1,2 @@ +#define MODULEVERIFIER_ELF64 1 +#include "grub-module-verifierXX.c" diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c new file mode 100644 index 000000000..9c04caa63 --- /dev/null +++ b/util/grub-module-verifierXX.c @@ -0,0 +1,371 @@ +#include + +#include +#include +#include + +#if defined(MODULEVERIFIER_ELF32) +# define SUFFIX(x) x ## 32 +# define ELFCLASSXX ELFCLASS32 +# define Elf_Ehdr Elf32_Ehdr +# define Elf_Phdr Elf32_Phdr +# define Elf_Nhdr Elf32_Nhdr +# define Elf_Addr Elf32_Addr +# define Elf_Sym Elf32_Sym +# define Elf_Off Elf32_Off +# define Elf_Shdr Elf32_Shdr +# define Elf_Rela Elf32_Rela +# define Elf_Rel Elf32_Rel +# define Elf_Word Elf32_Word +# define Elf_Half Elf32_Half +# define Elf_Section Elf32_Section +# define ELF_R_SYM(val) ELF32_R_SYM(val) +# define ELF_R_TYPE(val) ELF32_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) +#elif defined(MODULEVERIFIER_ELF64) +# define SUFFIX(x) x ## 64 +# define ELFCLASSXX ELFCLASS64 +# define Elf_Ehdr Elf64_Ehdr +# define Elf_Phdr Elf64_Phdr +# define Elf_Nhdr Elf64_Nhdr +# define Elf_Addr Elf64_Addr +# define Elf_Sym Elf64_Sym +# define Elf_Off Elf64_Off +# define Elf_Shdr Elf64_Shdr +# define Elf_Rela Elf64_Rela +# define Elf_Rel Elf64_Rel +# define Elf_Word Elf64_Word +# define Elf_Half Elf64_Half +# define Elf_Section Elf64_Section +# define ELF_R_SYM(val) ELF64_R_SYM(val) +# define ELF_R_TYPE(val) ELF64_R_TYPE(val) +# define ELF_ST_TYPE(val) ELF64_ST_TYPE(val) +#else +#error "I'm confused" +#endif + +#define grub_target_to_host32(x) (grub_target_to_host32_real (arch, (x))) +#define grub_host_to_target32(x) (grub_host_to_target32_real (arch, (x))) +#define grub_target_to_host64(x) (grub_target_to_host64_real (arch, (x))) +#define grub_host_to_target64(x) (grub_host_to_target64_real (arch, (x))) +#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (arch, (x))) +#define grub_target_to_host16(x) (grub_target_to_host16_real (arch, (x))) +#define grub_host_to_target16(x) (grub_host_to_target16_real (arch, (x))) +#define grub_target_to_host(val) grub_target_to_host_real(arch, (val)) + +static inline grub_uint32_t +grub_target_to_host32_real (const struct grub_module_verifier_arch *arch, + grub_uint32_t in) +{ + if (arch->bigendian) + return grub_be_to_cpu32 (in); + else + return grub_le_to_cpu32 (in); +} + +static inline grub_uint64_t +grub_target_to_host64_real (const struct grub_module_verifier_arch *arch, + grub_uint64_t in) +{ + if (arch->bigendian) + return grub_be_to_cpu64 (in); + else + return grub_le_to_cpu64 (in); +} + +static inline grub_uint64_t +grub_host_to_target64_real (const struct grub_module_verifier_arch *arch, + grub_uint64_t in) +{ + if (arch->bigendian) + return grub_cpu_to_be64 (in); + else + return grub_cpu_to_le64 (in); +} + +static inline grub_uint32_t +grub_host_to_target32_real (const struct grub_module_verifier_arch *arch, + grub_uint32_t in) +{ + if (arch->bigendian) + return grub_cpu_to_be32 (in); + else + return grub_cpu_to_le32 (in); +} + +static inline grub_uint16_t +grub_target_to_host16_real (const struct grub_module_verifier_arch *arch, + grub_uint16_t in) +{ + if (arch->bigendian) + return grub_be_to_cpu16 (in); + else + return grub_le_to_cpu16 (in); +} + +static inline grub_uint16_t +grub_host_to_target16_real (const struct grub_module_verifier_arch *arch, + grub_uint16_t in) +{ + if (arch->bigendian) + return grub_cpu_to_be16 (in); + else + return grub_cpu_to_le16 (in); +} + +static inline grub_uint64_t +grub_host_to_target_addr_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) +{ + if (arch->voidp_sizeof == 8) + return grub_host_to_target64_real (arch, in); + else + return grub_host_to_target32_real (arch, in); +} + +static inline grub_uint64_t +grub_target_to_host_real (const struct grub_module_verifier_arch *arch, grub_uint64_t in) +{ + if (arch->voidp_sizeof == 8) + return grub_target_to_host64_real (arch, in); + else + return grub_target_to_host32_real (arch, in); +} + + +static Elf_Shdr * +find_section (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, const char *name) +{ + Elf_Shdr *s; + const char *str; + unsigned i; + + s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host16 (e->e_shstrndx) * grub_target_to_host16 (e->e_shentsize)); + str = (char *) e + grub_target_to_host (s->sh_offset); + + for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + i < grub_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) + if (strcmp (str + grub_target_to_host32 (s->sh_name), name) == 0) + return s; + return NULL; +} + +static void +check_license (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + Elf_Shdr *s = find_section (arch, e, ".module_license"); + if (s && (strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3") == 0 + || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv3+") == 0 + || strcmp ((char *) e + grub_target_to_host(s->sh_offset), "LICENSE=GPLv2+") == 0)) + return; + grub_util_error ("incompatible license"); +} + +static Elf_Sym * +get_symtab (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e, Elf_Word *size, Elf_Word *entsize) +{ + unsigned i; + Elf_Shdr *s, *sections; + Elf_Sym *sym; + + sections = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + for (i = 0, s = sections; + i < grub_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) + if (grub_target_to_host32 (s->sh_type) == SHT_SYMTAB) + break; + + if (i == grub_target_to_host16 (e->e_shnum)) + return NULL; + + sym = (Elf_Sym *) ((char *) e + grub_target_to_host (s->sh_offset)); + *size = grub_target_to_host (s->sh_size); + *entsize = grub_target_to_host (s->sh_entsize); + return sym; +} + +static void +check_symbols (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + Elf_Sym *sym; + Elf_Word size, entsize; + unsigned i; + + /* Module without symbol table and without .moddeps section is useless + at boot time, so catch it early to prevent build errors */ + sym = get_symtab (arch, e, &size, &entsize); + if (!sym) + { + Elf_Shdr *s = find_section (arch, e, ".moddeps"); + + if (!s) + grub_util_error ("no symbol table and no .moddeps section"); + + if (!s->sh_size) + grub_util_error ("no symbol table and empty .moddeps section"); + + return; + } + + for (i = 0; + i < size / entsize; + i++, sym = (Elf_Sym *) ((char *) sym + entsize)) + { + unsigned char type = ELF_ST_TYPE (sym->st_info); + + switch (type) + { + case STT_NOTYPE: + case STT_OBJECT: + case STT_FUNC: + case STT_SECTION: + case STT_FILE: + break; + + default: + return grub_util_error ("unknown symbol type `%d'", (int) type); + } + } +} + +static int +is_symbol_local(Elf_Sym *sym) +{ + switch (ELF_ST_TYPE (sym->st_info)) + { + case STT_NOTYPE: + case STT_OBJECT: + if (sym->st_name != 0 && sym->st_shndx == 0) + return 0; + return 1; + + case STT_FUNC: + case STT_SECTION: + return 1; + + default: + return 0; + } +} + +static void +section_check_relocations (const struct grub_module_verifier_arch *arch, void *ehdr, + Elf_Shdr *s, size_t target_seg_size) +{ + Elf_Rel *rel, *max; + Elf_Sym *symtab; + Elf_Word symtabsize, symtabentsize; + + symtab = get_symtab (arch, ehdr, &symtabsize, &symtabentsize); + if (!symtab) + grub_util_error ("relocation without symbol table"); + + for (rel = (Elf_Rel *) ((char *) ehdr + grub_target_to_host (s->sh_offset)), + max = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_size)); + rel < max; + rel = (Elf_Rel *) ((char *) rel + grub_target_to_host (s->sh_entsize))) + { + Elf_Sym *sym; + unsigned i; + + if (target_seg_size < grub_target_to_host (rel->r_offset)) + grub_util_error ("reloc offset is out of the segment"); + + grub_uint32_t type = ELF_R_TYPE (grub_target_to_host (rel->r_info)); + + if (arch->machine == EM_SPARCV9) + type &= 0xff; + + for (i = 0; arch->supported_relocations[i] != -1; i++) + if (type == arch->supported_relocations[i]) + break; + if (arch->supported_relocations[i] != -1) + continue; + if (!arch->short_relocations) + grub_util_error ("unsupported relocation 0x%x", type); + for (i = 0; arch->short_relocations[i] != -1; i++) + if (type == arch->short_relocations[i]) + break; + if (arch->short_relocations[i] == -1) + grub_util_error ("unsupported relocation 0x%x", type); + sym = (Elf_Sym *) ((char *) symtab + symtabentsize * ELF_R_SYM (grub_target_to_host (rel->r_info))); + + if (is_symbol_local (sym)) + continue; + grub_util_error ("relocation 0x%x is not module-local", type); + } +} + +static void +check_relocations (const struct grub_module_verifier_arch *arch, Elf_Ehdr *e) +{ + Elf_Shdr *s; + unsigned i; + + for (i = 0, s = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff)); + i < grub_target_to_host16 (e->e_shnum); + i++, s = (Elf_Shdr *) ((char *) s + grub_target_to_host16 (e->e_shentsize))) + if (grub_target_to_host32 (s->sh_type) == SHT_REL || grub_target_to_host32 (s->sh_type) == SHT_RELA) + { + Elf_Shdr *ts; + + if (grub_target_to_host32 (s->sh_type) == SHT_REL && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_REL)) + grub_util_error ("unsupported SHT_REL"); + if (grub_target_to_host32 (s->sh_type) == SHT_RELA && !(arch->flags & GRUB_MODULE_VERIFY_SUPPORTS_RELA)) + grub_util_error ("unsupported SHT_RELA"); + + /* Find the target segment. */ + if (grub_target_to_host32 (s->sh_info) >= grub_target_to_host16 (e->e_shnum)) + grub_util_error ("orphaned reloc section"); + ts = (Elf_Shdr *) ((char *) e + grub_target_to_host (e->e_shoff) + grub_target_to_host32 (s->sh_info) * grub_target_to_host16 (e->e_shentsize)); + + section_check_relocations (arch, e, s, grub_target_to_host (ts->sh_size)); + } +} + +void +SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_module_verifier_arch *arch) +{ + Elf_Ehdr *e = module_img; + + /* Check the header size. */ + if (size < sizeof (Elf_Ehdr)) + grub_util_error ("ELF header smaller than expected"); + + /* Check the magic numbers. */ + if (e->e_ident[EI_MAG0] != ELFMAG0 + || e->e_ident[EI_MAG1] != ELFMAG1 + || e->e_ident[EI_MAG2] != ELFMAG2 + || e->e_ident[EI_MAG3] != ELFMAG3 + || e->e_ident[EI_VERSION] != EV_CURRENT + || grub_target_to_host32 (e->e_version) != EV_CURRENT) + grub_util_error ("invalid arch-independent ELF magic"); + + if (e->e_ident[EI_CLASS] != ELFCLASSXX + || e->e_ident[EI_DATA] != (arch->bigendian ? ELFDATA2MSB : ELFDATA2LSB) + || grub_target_to_host16 (e->e_machine) != arch->machine) + grub_util_error ("invalid arch-dependent ELF magic"); + + if (grub_target_to_host16 (e->e_type) != ET_REL) + { + grub_util_error ("this ELF file is not of the right type"); + } + + /* Make sure that every section is within the core. */ + if (size < grub_target_to_host (e->e_shoff) + + (grub_uint32_t) grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum)) + { + grub_util_error ("ELF sections outside core"); + } + + check_license (arch, e); + + Elf_Shdr *s; + + s = find_section (arch, e, ".modname"); + if (!s) + grub_util_error ("no module name found"); + + check_symbols(arch, e); + check_relocations(arch, e); +} diff --git a/util/grub-mount.c b/util/grub-mount.c index 0d0fea5f2..aca5f82e3 100644 --- a/util/grub-mount.c +++ b/util/grub-mount.c @@ -151,7 +151,6 @@ fuse_getattr (const char *path, struct stat *st) { struct fuse_getattr_ctx ctx; char *pathname, *path2; - const char *pathname_t; if (path[0] == '/' && path[1] == 0) { @@ -170,12 +169,7 @@ fuse_getattr (const char *path, struct stat *st) ctx.file_exists = 0; - pathname_t = grub_strchr (path, ')'); - if (! pathname_t) - pathname_t = path; - else - pathname_t++; - pathname = xstrdup (pathname_t); + pathname = xstrdup (path); /* Remove trailing '/'. */ while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') diff --git a/util/grub-probe.c b/util/grub-probe.c index b1f533626..8ac527d2f 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -279,7 +279,7 @@ probe (const char *path, char **device_names, char delim) printf ("%s", *curdev); putchar (delim); } - return; + goto free_device_names; } if (print == PRINT_DISK) @@ -297,7 +297,7 @@ probe (const char *path, char **device_names, char delim) putchar (delim); free (disk); } - return; + goto free_device_names; } for (curdev = device_names; *curdev; curdev++) @@ -668,6 +668,14 @@ probe (const char *path, char **device_names, char delim) for (curdrive = drives_names; *curdrive; curdrive++) free (*curdrive); free (drives_names); + +free_device_names: + if (path != NULL) + { + for (curdev = device_names; *curdev; curdev++) + free (*curdev); + free (device_names); + } } static struct argp_option options[] = { diff --git a/util/grub-reboot.in b/util/grub-reboot.in index 225fe5f21..4d4f75704 100644 --- a/util/grub-reboot.in +++ b/util/grub-reboot.in @@ -47,7 +47,7 @@ usage () { gettext_printf "Usage: %s [OPTION] MENU_ENTRY\n" "$self" gettext "Set the default boot menu entry for GRUB, for the next boot only."; echo print_option_help "-h, --help" "$(gettext "print this message and exit")" - print_option_help "-v, --version" "$(gettext "print the version information and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")" print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg" echo @@ -81,7 +81,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; diff --git a/util/grub-set-default.in b/util/grub-set-default.in index 83a7be12f..6036f81e5 100644 --- a/util/grub-set-default.in +++ b/util/grub-set-default.in @@ -49,7 +49,7 @@ usage () { gettext_printf "This requires setting GRUB_DEFAULT=saved in %s/default/grub.\n" "$sysconfdir" echo print_option_help "-h, --help" "$(gettext "print this message and exit")" - print_option_help "-v, --version" "$(gettext "print the version information and exit")" + print_option_help "-V, --version" "$(gettext "print the version information and exit")" dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")" print_option_help "--boot-directory=$(gettext "DIR")" "$dirmsg" echo @@ -79,7 +79,7 @@ do -h | --help) usage exit 0 ;; - -v | --version) + -V | --version) echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}" exit 0 ;; diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 859b608f6..de9044c7f 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in ;; esac +# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter +# and mounting btrfs requires user space scanning, so force UUID in this case. if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || uses_abstraction "${GRUB_DEVICE}" lvm; then + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} diff --git a/util/grub.d/10_xnu.in b/util/grub.d/10_xnu.in index 51ee2f427..9c40b4536 100644 --- a/util/grub.d/10_xnu.in +++ b/util/grub.d/10_xnu.in @@ -56,6 +56,9 @@ EOF fi if [ /kernelcache -nt /System/Library/Extensions ]; then $1 /kernelcache boot-uuid=\${uuid} rd=*uuid + elif [ -f /System/Library/Kernels/kernel ]; then + $1 /System/Library/Kernels/kernel boot-uuid=\${uuid} rd=*uuid + xnu_kextdir /System/Library/Extensions else $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in index f532fb98f..c48af948d 100644 --- a/util/grub.d/20_linux_xen.in +++ b/util/grub.d/20_linux_xen.in @@ -43,9 +43,11 @@ case ${GRUB_DEVICE} in ;; esac +# btrfs may reside on multiple devices. We cannot pass them as value of root= parameter +# and mounting btrfs requires user space scanning, so force UUID in this case. if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ - || uses_abstraction "${GRUB_DEVICE}" lvm; then + || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 5fc4f0c83..515a68c7a 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -71,6 +71,9 @@ EOF fi if [ /kernelcache -nt /System/Library/Extensions ]; then $1 /kernelcache boot-uuid=\${uuid} rd=*uuid + elif [ -f /System/Library/Kernels/kernel ]; then + $1 /System/Library/Kernels/kernel boot-uuid=\${uuid} rd=*uuid + xnu_kextdir /System/Library/Extensions else $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then @@ -135,6 +138,9 @@ for OS in ${OSPROBED} ; do LONGNAME="${LABEL}" fi + # os-prober returns text string followed by optional counter + CLASS="--class $(echo "${LABEL}" | LC_ALL=C sed 's,[[:digit:]]*$,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=C sed 's,[^[:alnum:]_],_,g')" + gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2 case ${BOOT} in @@ -142,7 +148,7 @@ for OS in ${OSPROBED} ; do onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { EOF save_default_entry | grub_add_tab prepare_grub_to_access_device ${DEVICE} | grub_add_tab @@ -174,7 +180,7 @@ EOF DEVICE=${DEVICE%@*} onstr="$(gettext_printf "(on %s)" "${DEVICE}")" cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' { +menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' { EOF save_default_entry | sed -e "s/^/\t/" prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" @@ -230,7 +236,7 @@ EOF if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then cat << EOF -menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { +menuentry '$(echo "$OS $onstr" | grub_quote)' $CLASS --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { EOF save_default_entry | grub_add_tab printf '%s\n' "${prepare_boot_cache}" diff --git a/util/misc.c b/util/misc.c index b8ec69108..d545212d9 100644 --- a/util/misc.c +++ b/util/misc.c @@ -74,32 +74,6 @@ grub_util_get_path (const char *dir, const char *file) return path; } -size_t -grub_util_get_image_size (const char *path) -{ - FILE *f; - size_t ret; - off_t sz; - - f = grub_util_fopen (path, "rb"); - - if (!f) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); - - fseeko (f, 0, SEEK_END); - - sz = ftello (f); - if (sz < 0) - grub_util_error (_("cannot open `%s': %s"), path, strerror (errno)); - if (sz != (size_t) sz) - grub_util_error (_("file `%s' is too big"), path); - ret = (size_t) sz; - - fclose (f); - - return ret; -} - char * grub_util_read_image (const char *path) { @@ -126,28 +100,6 @@ grub_util_read_image (const char *path) return img; } -void -grub_util_load_image (const char *path, char *buf) -{ - FILE *fp; - size_t size; - - grub_util_info ("reading %s", path); - - size = grub_util_get_image_size (path); - - fp = grub_util_fopen (path, "rb"); - if (! fp) - grub_util_error (_("cannot open `%s': %s"), path, - strerror (errno)); - - if (fread (buf, 1, size, fp) != size) - grub_util_error (_("cannot read `%s': %s"), path, - strerror (errno)); - - fclose (fp); -} - void grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out, const char *name) diff --git a/util/mkimage.c b/util/mkimage.c index dc4046185..9ad4cfe42 100644 --- a/util/mkimage.c +++ b/util/mkimage.c @@ -46,6 +46,7 @@ #include #include #include +#include #define ALIGN_ADDR(x) (ALIGN_UP((x), image_target->voidp_sizeof)) @@ -53,45 +54,13 @@ #include #endif +#pragma GCC diagnostic ignored "-Wcast-align" + #define TARGET_NO_FIELD 0xffffffff /* use 2015-01-01T00:00:00+0000 as a stock timestamp */ #define STABLE_EMBEDDING_TIMESTAMP 1420070400 -struct grub_install_image_target_desc -{ - const char *dirname; - const char *names[6]; - grub_size_t voidp_sizeof; - int bigendian; - enum { - IMAGE_I386_PC, IMAGE_EFI, IMAGE_COREBOOT, - IMAGE_SPARC64_AOUT, IMAGE_SPARC64_RAW, IMAGE_SPARC64_CDCORE, - IMAGE_I386_IEEE1275, - IMAGE_LOONGSON_ELF, IMAGE_QEMU, IMAGE_PPC, IMAGE_YEELOONG_FLASH, - IMAGE_FULOONG2F_FLASH, IMAGE_I386_PC_PXE, IMAGE_MIPS_ARC, - IMAGE_QEMU_MIPS_FLASH, IMAGE_UBOOT, IMAGE_XEN, IMAGE_I386_PC_ELTORITO - } id; - enum - { - PLATFORM_FLAGS_NONE = 0, - PLATFORM_FLAGS_DECOMPRESSORS = 2, - PLATFORM_FLAGS_MODULES_BEFORE_KERNEL = 4, - } flags; - unsigned total_module_size; - unsigned decompressor_compressed_size; - unsigned decompressor_uncompressed_size; - unsigned decompressor_uncompressed_addr; - unsigned link_align; - grub_uint16_t elf_target; - unsigned section_align; - signed vaddr_offset; - grub_uint64_t link_addr; - unsigned mod_gap, mod_align; - grub_compression_t default_compression; - grub_uint16_t pe_target; -}; - #define EFI32_HEADER_SIZE ALIGN_UP (GRUB_PE32_MSDOS_STUB_SIZE \ + GRUB_PE32_SIGNATURE_SIZE \ + sizeof (struct grub_pe32_coff_header) \ @@ -119,6 +88,7 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_compressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_size = TARGET_NO_FIELD, .decompressor_uncompressed_addr = TARGET_NO_FIELD, + .reloc_table_offset = TARGET_NO_FIELD, .section_align = 1, .vaddr_offset = 0, .link_addr = GRUB_KERNEL_I386_COREBOOT_LINK_ADDR, @@ -558,7 +528,6 @@ static const struct grub_install_image_target_desc image_targets[] = .decompressor_uncompressed_addr = TARGET_NO_FIELD, .section_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN, .vaddr_offset = 0, - .link_addr = GRUB_KERNEL_ARM_UBOOT_LINK_ADDR, .elf_target = EM_ARM, .mod_gap = GRUB_KERNEL_ARM_UBOOT_MOD_GAP, .mod_align = GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN, @@ -603,119 +572,6 @@ static const struct grub_install_image_target_desc image_targets[] = }, }; -#define grub_target_to_host32(x) (grub_target_to_host32_real (image_target, (x))) -#define grub_host_to_target32(x) (grub_host_to_target32_real (image_target, (x))) -#define grub_target_to_host64(x) (grub_target_to_host64_real (image_target, (x))) -#define grub_host_to_target64(x) (grub_host_to_target64_real (image_target, (x))) -#define grub_host_to_target_addr(x) (grub_host_to_target_addr_real (image_target, (x))) -#define grub_target_to_host16(x) (grub_target_to_host16_real (image_target, (x))) -#define grub_host_to_target16(x) (grub_host_to_target16_real (image_target, (x))) - -static inline grub_uint32_t -grub_target_to_host32_real (const struct grub_install_image_target_desc *image_target, - grub_uint32_t in) -{ - if (image_target->bigendian) - return grub_be_to_cpu32 (in); - else - return grub_le_to_cpu32 (in); -} - -static inline grub_uint64_t -grub_target_to_host64_real (const struct grub_install_image_target_desc *image_target, - grub_uint64_t in) -{ - if (image_target->bigendian) - return grub_be_to_cpu64 (in); - else - return grub_le_to_cpu64 (in); -} - -static inline grub_uint64_t -grub_host_to_target64_real (const struct grub_install_image_target_desc *image_target, - grub_uint64_t in) -{ - if (image_target->bigendian) - return grub_cpu_to_be64 (in); - else - return grub_cpu_to_le64 (in); -} - -static inline grub_uint32_t -grub_host_to_target32_real (const struct grub_install_image_target_desc *image_target, - grub_uint32_t in) -{ - if (image_target->bigendian) - return grub_cpu_to_be32 (in); - else - return grub_cpu_to_le32 (in); -} - -static inline grub_uint16_t -grub_target_to_host16_real (const struct grub_install_image_target_desc *image_target, - grub_uint16_t in) -{ - if (image_target->bigendian) - return grub_be_to_cpu16 (in); - else - return grub_le_to_cpu16 (in); -} - -static inline grub_uint16_t -grub_host_to_target16_real (const struct grub_install_image_target_desc *image_target, - grub_uint16_t in) -{ - if (image_target->bigendian) - return grub_cpu_to_be16 (in); - else - return grub_cpu_to_le16 (in); -} - -static inline grub_uint64_t -grub_host_to_target_addr_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) -{ - if (image_target->voidp_sizeof == 8) - return grub_host_to_target64_real (image_target, in); - else - return grub_host_to_target32_real (image_target, in); -} - -static inline grub_uint64_t -grub_target_to_host_real (const struct grub_install_image_target_desc *image_target, grub_uint64_t in) -{ - if (image_target->voidp_sizeof == 8) - return grub_target_to_host64_real (image_target, in); - else - return grub_target_to_host32_real (image_target, in); -} - -#define GRUB_IEEE1275_NOTE_NAME "PowerPC" -#define GRUB_IEEE1275_NOTE_TYPE 0x1275 - -/* These structures are defined according to the CHRP binding to IEEE1275, - "Client Program Format" section. */ - -struct grub_ieee1275_note_desc -{ - grub_uint32_t real_mode; - grub_uint32_t real_base; - grub_uint32_t real_size; - grub_uint32_t virt_base; - grub_uint32_t virt_size; - grub_uint32_t load_base; -}; - -struct grub_ieee1275_note -{ - Elf32_Nhdr header; - char name[ALIGN_UP(sizeof (GRUB_IEEE1275_NOTE_NAME), 4)]; - struct grub_ieee1275_note_desc descriptor; -}; - -#define GRUB_XEN_NOTE_NAME "Xen" - -#define grub_target_to_host(val) grub_target_to_host_real(image_target, (val)) - #include static void *SzAlloc(void *p __attribute__ ((unused)), size_t size) { return xmalloc(size); } @@ -830,111 +686,6 @@ compress_kernel (const struct grub_install_image_target_desc *image_target, char *core_size = kernel_size; } -struct fixup_block_list -{ - struct fixup_block_list *next; - int state; - struct grub_pe32_fixup_block b; -}; - -/* - * R_ARM_THM_CALL/THM_JUMP24 - * - * Relocate Thumb (T32) instruction set relative branches: - * B.W, BL and BLX - */ -static grub_err_t -grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) -{ - grub_int32_t offset; - - offset = grub_arm_thm_call_get_offset (target); - - grub_dprintf ("dl", " sym_addr = 0x%08x", sym_addr); - - offset += sym_addr; - - grub_dprintf("dl", " BL*: target=%p, sym_addr=0x%08x, offset=%d\n", - target, sym_addr, offset); - - /* Keep traditional (pre-Thumb2) limits on blx. In any case if the kernel - is bigger than 2M (currently under 150K) then we probably have a problem - somewhere else. */ - if (offset < -0x200000 || offset >= 0x200000) - return grub_error (GRUB_ERR_BAD_MODULE, - "THM_CALL Relocation out of range."); - - grub_dprintf ("dl", " relative destination = %p", - (char *) target + offset); - - return grub_arm_thm_call_set_offset (target, offset); -} - -/* - * R_ARM_THM_JUMP19 - * - * Relocate conditional Thumb (T32) B.W - */ -static grub_err_t -grub_arm_reloc_thm_jump19 (grub_uint16_t *target, Elf32_Addr sym_addr) -{ - grub_int32_t offset; - - if (!(sym_addr & 1)) - return grub_error (GRUB_ERR_BAD_MODULE, - "Relocation targeting wrong execution state"); - - offset = grub_arm_thm_jump19_get_offset (target); - - /* Adjust and re-truncate offset */ - offset += sym_addr; - - if (!grub_arm_thm_jump19_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, - "THM_JUMP19 Relocation out of range."); - - grub_arm_thm_jump19_set_offset (target, offset); - - return GRUB_ERR_NONE; -} - -/* - * R_ARM_JUMP24 - * - * Relocate ARM (A32) B - */ -static grub_err_t -grub_arm_reloc_jump24 (grub_uint32_t *target, Elf32_Addr sym_addr) -{ - grub_int32_t offset; - - if (sym_addr & 1) - return grub_error (GRUB_ERR_BAD_MODULE, - "Relocation targeting wrong execution state"); - - offset = grub_arm_jump24_get_offset (target); - offset += sym_addr; - - if (!grub_arm_jump24_check_offset (offset)) - return grub_error (GRUB_ERR_BAD_MODULE, - "JUMP24 Relocation out of range."); - - - grub_arm_jump24_set_offset (target, offset); - - return GRUB_ERR_NONE; -} - -#pragma GCC diagnostic ignored "-Wcast-align" - -#define MKIMAGE_ELF32 1 -#include "grub-mkimagexx.c" -#undef MKIMAGE_ELF32 - -#define MKIMAGE_ELF64 1 -#include "grub-mkimagexx.c" -#undef MKIMAGE_ELF64 - const struct grub_install_image_target_desc * grub_install_get_image_target (const char *arg) { @@ -991,17 +742,14 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_compression_t comp) { char *kernel_img, *core_img; - size_t kernel_size, total_module_size, core_size, exec_size; + size_t total_module_size, core_size; size_t memdisk_size = 0, config_size = 0; size_t prefix_size = 0; char *kernel_path; size_t offset; - struct grub_util_path_list *path_list, *p, *next; - size_t bss_size; - grub_uint64_t start_address; - void *rel_section = 0; - size_t reloc_size = 0, align; + struct grub_util_path_list *path_list, *p; size_t decompress_size = 0; + struct grub_mkimage_layout layout; if (comp == GRUB_COMPRESSION_AUTO) comp = image_target->default_compression; @@ -1063,15 +811,13 @@ grub_install_generate_image (const char *dir, const char *prefix, (unsigned long long) total_module_size); if (image_target->voidp_sizeof == 4) - kernel_img = load_image32 (kernel_path, &exec_size, &kernel_size, &bss_size, - total_module_size, &start_address, &rel_section, - &reloc_size, &align, image_target); + kernel_img = grub_mkimage_load_image32 (kernel_path, total_module_size, + &layout, image_target); else - kernel_img = load_image64 (kernel_path, &exec_size, &kernel_size, &bss_size, - total_module_size, &start_address, &rel_section, - &reloc_size, &align, image_target); - if (image_target->id == IMAGE_XEN && align < 4096) - align = 4096; + kernel_img = grub_mkimage_load_image64 (kernel_path, total_module_size, + &layout, image_target); + if (image_target->id == IMAGE_XEN && layout.align < 4096) + layout.align = 4096; if ((image_target->flags & PLATFORM_FLAGS_DECOMPRESSORS) && (image_target->total_module_size != TARGET_NO_FIELD)) @@ -1080,7 +826,7 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) { - memmove (kernel_img + total_module_size, kernel_img, kernel_size); + memmove (kernel_img + total_module_size, kernel_img, layout.kernel_size); memset (kernel_img, 0, total_module_size); } @@ -1091,14 +837,14 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) modinfo = (struct grub_module_info64 *) kernel_img; else - modinfo = (struct grub_module_info64 *) (kernel_img + kernel_size); + modinfo = (struct grub_module_info64 *) (kernel_img + layout.kernel_size); modinfo->magic = grub_host_to_target32 (GRUB_MODULE_MAGIC); modinfo->offset = grub_host_to_target_addr (sizeof (struct grub_module_info64)); modinfo->size = grub_host_to_target_addr (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) offset = sizeof (struct grub_module_info64); else - offset = kernel_size + sizeof (struct grub_module_info64); + offset = layout.kernel_size + sizeof (struct grub_module_info64); } else { @@ -1107,14 +853,14 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) modinfo = (struct grub_module_info32 *) kernel_img; else - modinfo = (struct grub_module_info32 *) (kernel_img + kernel_size); + modinfo = (struct grub_module_info32 *) (kernel_img + layout.kernel_size); modinfo->magic = grub_host_to_target32 (GRUB_MODULE_MAGIC); modinfo->offset = grub_host_to_target_addr (sizeof (struct grub_module_info32)); modinfo->size = grub_host_to_target_addr (total_module_size); if (image_target->flags & PLATFORM_FLAGS_MODULES_BEFORE_KERNEL) offset = sizeof (struct grub_module_info32); else - offset = kernel_size + sizeof (struct grub_module_info32); + offset = layout.kernel_size + sizeof (struct grub_module_info32); } for (p = path_list; p; p = p->next) @@ -1193,8 +939,8 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_util_info ("kernel_img=%p, kernel_size=0x%" GRUB_HOST_PRIxLONG_LONG, kernel_img, - (unsigned long long) kernel_size); - compress_kernel (image_target, kernel_img, kernel_size + total_module_size, + (unsigned long long) layout.kernel_size); + compress_kernel (image_target, kernel_img, layout.kernel_size + total_module_size, &core_img, &core_size, comp); free (kernel_img); @@ -1246,7 +992,7 @@ grub_install_generate_image (const char *dir, const char *prefix, if (image_target->decompressor_uncompressed_size != TARGET_NO_FIELD) *((grub_uint32_t *) (decompress_img + image_target->decompressor_uncompressed_size)) - = grub_host_to_target32 (kernel_size + total_module_size); + = grub_host_to_target32 (layout.kernel_size + total_module_size); if (image_target->decompressor_uncompressed_addr != TARGET_NO_FIELD) { @@ -1279,16 +1025,17 @@ grub_install_generate_image (const char *dir, const char *prefix, case IMAGE_I386_PC_ELTORITO: if (GRUB_KERNEL_I386_PC_LINK_ADDR + core_size > 0x78000 || (core_size > (0xffff << GRUB_DISK_SECTOR_BITS)) - || (kernel_size + bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)) + || (layout.kernel_size + layout.bss_size + + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000)) grub_util_error (_("core image is too big (0x%x > 0x%x)"), GRUB_KERNEL_I386_PC_LINK_ADDR + (unsigned) core_size, 0x78000); /* fallthrough */ case IMAGE_COREBOOT: case IMAGE_QEMU: - if (kernel_size + bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000) + if (layout.kernel_size + layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR > 0x68000) grub_util_error (_("kernel image is too big (0x%x > 0x%x)"), - (unsigned) kernel_size + (unsigned) bss_size + (unsigned) layout.kernel_size + (unsigned) layout.bss_size + GRUB_KERNEL_I386_PC_LINK_ADDR, 0x68000); break; @@ -1410,13 +1157,13 @@ grub_install_generate_image (const char *dir, const char *prefix, reloc_addr = ALIGN_UP (header_size + core_size, image_target->section_align); - pe_size = ALIGN_UP (reloc_addr + reloc_size, + pe_size = ALIGN_UP (reloc_addr + layout.reloc_size, image_target->section_align); - pe_img = xmalloc (reloc_addr + reloc_size); + pe_img = xmalloc (reloc_addr + layout.reloc_size); memset (pe_img, 0, header_size); memcpy ((char *) pe_img + header_size, core_img, core_size); memset ((char *) pe_img + header_size + core_size, 0, reloc_addr - (header_size + core_size)); - memcpy ((char *) pe_img + reloc_addr, rel_section, reloc_size); + memcpy ((char *) pe_img + reloc_addr, layout.reloc_section, layout.reloc_size); header = pe_img; /* The magic. */ @@ -1450,14 +1197,14 @@ grub_install_generate_image (const char *dir, const char *prefix, (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE + sizeof (struct grub_pe32_coff_header)); o->magic = grub_host_to_target16 (GRUB_PE32_PE32_MAGIC); - o->code_size = grub_host_to_target32 (exec_size); - o->data_size = grub_cpu_to_le32 (reloc_addr - exec_size + o->code_size = grub_host_to_target32 (layout.exec_size); + o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size - header_size); - o->bss_size = grub_cpu_to_le32 (bss_size); - o->entry_addr = grub_cpu_to_le32 (start_address); + o->bss_size = grub_cpu_to_le32 (layout.bss_size); + o->entry_addr = grub_cpu_to_le32 (layout.start_address); o->code_base = grub_cpu_to_le32 (header_size); - o->data_base = grub_host_to_target32 (header_size + exec_size); + o->data_base = grub_host_to_target32 (header_size + layout.exec_size); o->image_base = 0; o->section_alignment = grub_host_to_target32 (image_target->section_align); @@ -1475,7 +1222,7 @@ grub_install_generate_image (const char *dir, const char *prefix, o->num_data_directories = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); - o->base_relocation_table.size = grub_host_to_target32 (reloc_size); + o->base_relocation_table.size = grub_host_to_target32 (layout.reloc_size); sections = o + 1; } else @@ -1488,11 +1235,11 @@ grub_install_generate_image (const char *dir, const char *prefix, (header + GRUB_PE32_MSDOS_STUB_SIZE + GRUB_PE32_SIGNATURE_SIZE + sizeof (struct grub_pe32_coff_header)); o->magic = grub_host_to_target16 (GRUB_PE32_PE64_MAGIC); - o->code_size = grub_host_to_target32 (exec_size); - o->data_size = grub_cpu_to_le32 (reloc_addr - exec_size + o->code_size = grub_host_to_target32 (layout.exec_size); + o->data_size = grub_cpu_to_le32 (reloc_addr - layout.exec_size - header_size); - o->bss_size = grub_cpu_to_le32 (bss_size); - o->entry_addr = grub_cpu_to_le32 (start_address); + o->bss_size = grub_cpu_to_le32 (layout.bss_size); + o->entry_addr = grub_cpu_to_le32 (layout.start_address); o->code_base = grub_cpu_to_le32 (header_size); o->image_base = 0; o->section_alignment = grub_host_to_target32 (image_target->section_align); @@ -1511,15 +1258,15 @@ grub_install_generate_image (const char *dir, const char *prefix, = grub_host_to_target32 (GRUB_PE32_NUM_DATA_DIRECTORIES); o->base_relocation_table.rva = grub_host_to_target32 (reloc_addr); - o->base_relocation_table.size = grub_host_to_target32 (reloc_size); + o->base_relocation_table.size = grub_host_to_target32 (layout.reloc_size); sections = o + 1; } /* The sections. */ text_section = sections; strcpy (text_section->name, ".text"); - text_section->virtual_size = grub_cpu_to_le32 (exec_size); + text_section->virtual_size = grub_cpu_to_le32 (layout.exec_size); text_section->virtual_address = grub_cpu_to_le32 (header_size); - text_section->raw_data_size = grub_cpu_to_le32 (exec_size); + text_section->raw_data_size = grub_cpu_to_le32 (layout.exec_size); text_section->raw_data_offset = grub_cpu_to_le32 (header_size); text_section->characteristics = grub_cpu_to_le32_compile_time ( GRUB_PE32_SCN_CNT_CODE @@ -1528,10 +1275,10 @@ grub_install_generate_image (const char *dir, const char *prefix, data_section = text_section + 1; strcpy (data_section->name, ".data"); - data_section->virtual_size = grub_cpu_to_le32 (kernel_size - exec_size); - data_section->virtual_address = grub_cpu_to_le32 (header_size + exec_size); - data_section->raw_data_size = grub_cpu_to_le32 (kernel_size - exec_size); - data_section->raw_data_offset = grub_cpu_to_le32 (header_size + exec_size); + data_section->virtual_size = grub_cpu_to_le32 (layout.kernel_size - layout.exec_size); + data_section->virtual_address = grub_cpu_to_le32 (header_size + layout.exec_size); + data_section->raw_data_size = grub_cpu_to_le32 (layout.kernel_size - layout.exec_size); + data_section->raw_data_offset = grub_cpu_to_le32 (header_size + layout.exec_size); data_section->characteristics = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_READ @@ -1540,8 +1287,8 @@ grub_install_generate_image (const char *dir, const char *prefix, #if 0 bss_section = data_section + 1; strcpy (bss_section->name, ".bss"); - bss_section->virtual_size = grub_cpu_to_le32 (bss_size); - bss_section->virtual_address = grub_cpu_to_le32 (header_size + kernel_size); + bss_section->virtual_size = grub_cpu_to_le32 (layout.bss_size); + bss_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size); bss_section->raw_data_size = 0; bss_section->raw_data_offset = 0; bss_section->characteristics @@ -1554,10 +1301,10 @@ grub_install_generate_image (const char *dir, const char *prefix, mods_section = data_section + 1; strcpy (mods_section->name, "mods"); - mods_section->virtual_size = grub_cpu_to_le32 (reloc_addr - kernel_size - header_size); - mods_section->virtual_address = grub_cpu_to_le32 (header_size + kernel_size + bss_size); - mods_section->raw_data_size = grub_cpu_to_le32 (reloc_addr - kernel_size - header_size); - mods_section->raw_data_offset = grub_cpu_to_le32 (header_size + kernel_size); + mods_section->virtual_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); + mods_section->virtual_address = grub_cpu_to_le32 (header_size + layout.kernel_size + layout.bss_size); + mods_section->raw_data_size = grub_cpu_to_le32 (reloc_addr - layout.kernel_size - header_size); + mods_section->raw_data_offset = grub_cpu_to_le32 (header_size + layout.kernel_size); mods_section->characteristics = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA | GRUB_PE32_SCN_MEM_READ @@ -1565,9 +1312,9 @@ grub_install_generate_image (const char *dir, const char *prefix, reloc_section = mods_section + 1; strcpy (reloc_section->name, ".reloc"); - reloc_section->virtual_size = grub_cpu_to_le32 (reloc_size); - reloc_section->virtual_address = grub_cpu_to_le32 (reloc_addr + bss_size); - reloc_section->raw_data_size = grub_cpu_to_le32 (reloc_size); + reloc_section->virtual_size = grub_cpu_to_le32 (layout.reloc_size); + reloc_section->virtual_address = grub_cpu_to_le32 (reloc_addr + layout.bss_size); + reloc_section->raw_data_size = grub_cpu_to_le32 (layout.reloc_size); reloc_section->raw_data_offset = grub_cpu_to_le32 (reloc_addr); reloc_section->characteristics = grub_cpu_to_le32_compile_time (GRUB_PE32_SCN_CNT_INITIALIZED_DATA @@ -1775,9 +1522,9 @@ grub_install_generate_image (const char *dir, const char *prefix, hdr->ih_magic = grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAGIC); hdr->ih_time = grub_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP); hdr->ih_size = grub_cpu_to_be32 (core_size); - hdr->ih_load = grub_cpu_to_be32 (image_target->link_addr); - hdr->ih_ep = grub_cpu_to_be32 (image_target->link_addr); - hdr->ih_type = GRUB_UBOOT_IH_TYPE_KERNEL; + hdr->ih_load = 0; + hdr->ih_ep = 0; + hdr->ih_type = GRUB_UBOOT_IH_TYPE_KERNEL_NOLOAD; hdr->ih_os = GRUB_UBOOT_IH_OS_LINUX; hdr->ih_arch = GRUB_UBOOT_IH_ARCH_ARM; hdr->ih_comp = GRUB_UBOOT_IH_COMP_NONE; @@ -1838,7 +1585,7 @@ grub_install_generate_image (const char *dir, const char *prefix, target_addr = (image_target->link_addr - decompress_size); else target_addr = ALIGN_UP (image_target->link_addr - + kernel_size + total_module_size, 32); + + layout.kernel_size + total_module_size, 32); ecoff_img = xmalloc (program_size + sizeof (*head) + sizeof (*section)); grub_memset (ecoff_img, 0, program_size + sizeof (*head) + sizeof (*section)); @@ -1885,16 +1632,16 @@ grub_install_generate_image (const char *dir, const char *prefix, target_addr = (image_target->link_addr - decompress_size); else target_addr = ALIGN_UP (image_target->link_addr - + kernel_size + total_module_size, 32); + + layout.kernel_size + total_module_size, 32); } else target_addr = image_target->link_addr; if (image_target->voidp_sizeof == 4) - generate_elf32 (image_target, note, &core_img, &core_size, - target_addr, align, kernel_size, bss_size); + grub_mkimage_generate_elf32 (image_target, note, &core_img, &core_size, + target_addr, layout.align, layout.kernel_size, layout.bss_size); else - generate_elf64 (image_target, note, &core_img, &core_size, - target_addr, align, kernel_size, bss_size); + grub_mkimage_generate_elf64 (image_target, note, &core_img, &core_size, + target_addr, layout.align, layout.kernel_size, layout.bss_size); } break; } @@ -1902,13 +1649,7 @@ grub_install_generate_image (const char *dir, const char *prefix, grub_util_write_image (core_img, core_size, out, outname); free (core_img); free (kernel_path); - free (rel_section); + free (layout.reloc_section); - while (path_list) - { - next = path_list->next; - free ((void *) path_list->name); - free (path_list); - path_list = next; - } + grub_util_free_path_list (path_list); } diff --git a/util/resolve.c b/util/resolve.c index 002bfbd72..3e887d2ff 100644 --- a/util/resolve.c +++ b/util/resolve.c @@ -271,3 +271,17 @@ grub_util_resolve_dependencies (const char *prefix, return prev; } } + +void +grub_util_free_path_list (struct grub_util_path_list *path_list) +{ + struct grub_util_path_list *next; + + while (path_list) + { + next = path_list->next; + free ((void *) path_list->name); + free (path_list); + path_list = next; + } +} diff --git a/util/setup.c b/util/setup.c index 8f20e9983..8aa5a39a7 100644 --- a/util/setup.c +++ b/util/setup.c @@ -312,6 +312,9 @@ SETUP (const char *dir, char **cur; int found = 0; + if (!root_devices) + grub_util_error (_("cannot find a device for %s (is /dev mounted?)"), dir); + for (cur = root_devices; *cur; cur++) { char *drive; @@ -353,6 +356,10 @@ SETUP (const char *dir, } grub_util_info ("guessed root_dev `%s' from " "dir `%s'", root_dev->disk->name, dir); + + for (cur = root_devices; *cur; cur++) + free (*cur); + free (root_devices); } grub_util_info ("setting the root device to `%s'", root);