Commit graph

1003 commits

Author SHA1 Message Date
robertmh
5e15ee3d38 2008-08-04 Robert Millan <rmh@aybabtu.com>
* conf/i386-coreboot.rmk (COMMON_ASFLAGS, COMMON_CFLAGS)
        (COMMON_LDFLAGS): Harmonize with i386-pc version (fixes a code
        corruption problem).
2008-08-04 11:38:45 +00:00
robertmh
a9053f8f5d 2008-08-04 Robert Millan <rmh@aybabtu.com>
* loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Fix misc
        warnings introduced in my last commit.
2008-08-04 09:30:36 +00:00
robertmh
2960a0c228 Add a few new files. 2008-08-03 20:28:36 +00:00
robertmh
dd19c7d795 2008-08-03 Robert Millan <rmh@aybabtu.com>
Make PCI available on all i386 architectures.

        * include/grub/i386/pc/pci.h: Move from here ...
        * include/grub/i386/pci.h: ... to here.

        * include/grub/i386/pc/pci.h: Remove.
        * include/grub/i386/efi/pci.h: Remove.
        * include/grub/x86_64/efi/pci.h: Remove.

        * include/grub/pci.h: Replace `<grub/machine/pci.h>' with
        `<grub/cpu/pci.h>'.

        * conf/i386-coreboot.rmk (pkglib_MODULES): Add `pci' and `lspci'.
        (pci_mod_SOURCES, pci_mod_CFLAGS, pci_mod_LDFLAGS, lspci_mod_SOURCES)
        (lspci_mod_CFLAGS, lspci_mod_LDFLAGS): New variables.

        * conf/i386-ieee1275.rmk: Likewise.
2008-08-03 18:14:07 +00:00
robertmh
e14a6184ba 2008-08-03 Robert Millan <rmh@aybabtu.com>
* term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro.
        (grub_console_setcursor): Make it possible to set cursor off.
2008-08-03 17:09:21 +00:00
robertmh
52768e37c2 2008-08-03 Robert Millan <rmh@aybabtu.com>
* util/grub.d/00_header.in: Be platform-agnostic.  Probe for existence
        of modules instead of assuming which platform provides what.
        * util/update-grub.in: Likewise.
2008-08-03 16:38:40 +00:00
robertmh
2d52f57f10 2008-08-03 Robert Millan <rmh@aybabtu.com>
* kern/i386/pc/init.c (make_install_device): Check for `grub_prefix'
        instead of `grub_install_dos_part' to determine whether a drive needs
        to be prepended to prefix (`grub_install_dos_part' is not reliable,
        because it can be overriden when loading GRUB via Multiboot).
2008-08-02 23:24:34 +00:00
robertmh
2a5cd121da 2008-08-02 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-install.in: Remove trailing slash from prefix.
2008-08-02 20:30:19 +00:00
robertmh
93808428ce 2008-08-02 Robert Millan <rmh@aybabtu.com>
* loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Add a pair
        of informational grub_dprintf() calls.
2008-08-02 15:51:12 +00:00
robertmh
3bd0a12aca 2008-08-02 Robert Millan <rmh@aybabtu.com>
* disk/memdisk.c (memdisk_size): Don't initialize.
        (GRUB_MOD_INIT(memdisk)): Find memdisk using grub_module_iterate().

        * include/grub/i386/pc/kernel.h
        (GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): Remove macro.
        (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Shift.
        (grub_memdisk_image_size, grub_arch_memdisk_addr)
        (grub_arch_memdisk_size): Remove.

        * include/grub/kernel.h (struct grub_module_header): Remove `offset'
        field (was only used to transfer a constant).  Add `type' field to
        support multiple module types.
        (grub_module_iterate): New function.

        * kern/device.c (grub_device_open): Do not hide error messages
        when grub_disk_open() fails.  Use grub_print_error() instead.

        * kern/i386/pc/init.c (grub_arch_modules_addr)
        (grub_arch_memdisk_size): Remove functions.
        (grub_arch_modules_addr): Return the module address in high memory
        (now that it isn't copied anymore).

        * kern/i386/pc/startup.S (grub_memdisk_image_size): Remove variable.
        (codestart): Don't add grub_memdisk_image_size to %ecx in LZMA
        decompression routine (grub_total_module_size already includes that
        now).  Don't copy modules back to low memory.

        * kern/main.c: Include `<grub/mm.h>'.
        (grub_load_modules): Split out (and use) ...
        (grub_module_iterate): ... this function, which iterates through
        module objects and runs a hook.
        Comment out grub_mm_init_region() call, as it would cause non-ELF
        modules to be overwritten.

        * util/i386/pc/grub-mkimage.c (generate_image): Instead of appending
        the memdisk image in its own region, make it part of the module list.
        * util/elf/grub-mkimage.c (options): Add "memdisk"|'m' option.
        (main): Parse --memdisk|-m option, and pass user-provided path as
        parameter to generate_image().
        (add_segments): Pass `memdisk_path' down to load_modules().
        (load_modules): Embed memdisk image in module section when requested.
        * util/i386/efi/grub-mkimage.c (make_mods_section): Initialize
        `header.type' instead of `header.offset'.

        * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add `memdisk.mod'.
        (memdisk_mod_SOURCES, memdisk_mod_CFLAGS)
        (memdisk_mod_LDFLAGS): New variables.
        * conf/i386-coreboot.rmk: Likewise.
        * conf/i386-ieee1275.rmk: Likewise.
2008-08-02 12:17:44 +00:00
robertmh
a927cc7383 2008-08-02 Robert Millan <rmh@aybabtu.com>
* loader/i386/pc/multiboot.c (playground, forward_relocator)
        (backward_relocator): New variables.  Used to allocate and relocate
        the payload, respectively.
        (grub_multiboot_load_elf32): Load into heap instead of requested
        address, install the appropiate relocator code in each bound of
        the payload, and set the entry point such that
        grub_multiboot_real_boot() will jump to one of them.

        * kern/i386/loader.S (grub_multiboot_payload_size)
        (grub_multiboot_payload_orig, grub_multiboot_payload_dest)
        (grub_multiboot_payload_entry_offset): New variables.
        (grub_multiboot_real_boot): Set cpu context to what the relocator
        expects, and jump to the relocator instead of the payload.

        * include/grub/i386/loader.h (grub_multiboot_payload_size)
        (grub_multiboot_payload_orig, grub_multiboot_payload_dest)
        (grub_multiboot_payload_entry_offset): Export.
2008-08-02 12:12:14 +00:00
bean
b15d8a0cc6 2008-08-01 Bean <bean123ch@gmail.com>
* normal/menu_entry.c (editor_getline): Don't return the original
	string as result, as it will be released by lexer once it has done
	using it.
2008-08-01 18:18:32 +00:00
robertmh
cdfb3d2273 2008-08-01 Robert Millan <rmh@aybabtu.com>
* util/grub.d/10_linux.in: Use prepare_grub_to_access_device() from
        within menuentries, not before them.
        util/grub.d/10_hurd.in: Likewise.
2008-08-01 12:56:56 +00:00
bean
9175e93d11 2008-08-01 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkglib_MODULES): Add bufio.mod.
	(bufio_mod_SOURCES): New macro.
	(bufio_mod_CFLAGS): Likewise.
	(bufio_mod_LDFLAGS): Likewise.

	* include/grub/bufio.h: New file.

	* io/bufio.c: Likewise.

	* video/png.c: Replace <grub/file.h> with <grub/bufio.h>.
	(grub_video_reader_png): Use grub_buffile_open to open file.

	* video/jpeg.c: Replace <grub/file.h> with <grub/bufio.h>.
	(grub_video_reader_jpeg): Use grub_buffile_open to open file.

	* video/tga.c: Replace <grub/file.h> with <grub/bufio.h>.
	(grub_video_reader_tga): Use grub_buffile_open to open file.

	* font/manager.c: Include <grub/bufio.h>.
	(add_font): Use grub_buffile_open to open file.
2008-08-01 04:06:55 +00:00
robertmh
3d8383e7a5 2008-07-31 Robert Millan <rmh@aybabtu.com>
* loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): When loading
        ELF segments, use a macro for arbitrarily accessing any of them instead
        of preparing a pointer that allows access to one at a time.
        (grub_multiboot_load_elf64): Likewise.
2008-07-31 20:48:40 +00:00
robertmh
edb3d5c272 Add missing copyright years for recent changes 2008-07-31 19:33:23 +00:00
bean
16e641b612 2008-07-31 Bean <bean123ch@gmail.com>
* boot/i386/pc/lnxboot.S (real_code_2): Replace 0x50 with
	GRUB_KERNEL_MACHINE_DATA_END.
2008-07-31 14:15:53 +00:00
robertmh
59198b722c 2008-07-30 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_DATA_END):
        Increase from 0x50 to 0x60.
        * util/i386/pc/grub-install.in: Detect cross-disk installs, and
        use UUIDs to identify the root drive for them.  If that's not
        possible, abort.
        * util/i386/pc/grub-setup.c (setup): Do not special-case, or even
        check, for cross-disk installs.
2008-07-30 10:44:38 +00:00
robertmh
ae88bca301 2008-07-30 Robert Millan <rmh@aybabtu.com>
* kern/ieee1275/init.c (grub_machine_set_prefix): If `grub_prefix'
        is non-empty, use it to set the `prefix' environment variable instead
        of the usual approach.
        * kern/i386/linuxbios/init.c (make_install_device): Remove function.
        (grub_machine_set_prefix): Use `grub_prefix' to set the `prefix'
        environment variable instead of dummy make_install_device().

        * kern/i386/ieee1275/startup.S: Include `<grub/machine/kernel.h>'.
        (start): Insert a data section, with `grub_prefix' variable.
        * kern/i386/linuxbios/startup.S: Likewise.

        * include/grub/powerpc/ieee1275/kernel.h [!ASM_FILE] (grub_prefix):
        New variable reference.
        * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX):
        New macro.  Defines offset of `grub_prefix' within startup.S (relative
        to `start').
        (GRUB_KERNEL_MACHINE_DATA_END): New macro.  Defines the end of data
        section within startup.S (relative to `start').
        * include/grub/i386/coreboot/kernel.h: Likewise.

        * util/elf/grub-mkimage.c (add_segments): Receive `prefix' parameter.
        Overwrite grub_prefix with its contents, at the beginning of the
        first segment.
        (main): Understand -p|--prefix.
2008-07-30 10:42:11 +00:00
robertmh
14f41dd1ed 2008-07-30 Robert Millan <rmh@aybabtu.com>
* util/grub.d/10_hurd.in: Source /grub/update-grub_lib.
2008-07-30 00:21:35 +00:00
robertmh
4ca049a365 2008-07-30 Robert Millan <rmh@aybabtu.com>
* term/i386/pc/vga_text.c (grub_console_cls): Use
        grub_console_gotoxy() to go back to beginning of the screen.
        Found by Patrick Georgi <patrick.georgi@coresystems.de>
2008-07-29 23:29:03 +00:00
chrfranke
2921d33798 2008-07-29 Christian Franke <franke@computer.org>
* util/update-grub_lib.in (make_system_path_relative_to_its_root):
	Add conversion of emulated mount points on Cygwin.
2008-07-29 16:47:31 +00:00
chrfranke
b609876d15 2008-07-29 Christian Franke <franke@computer.org>
* util/update-grub.in: Add a check for admin
	group on Cygwin.
	Remove old `grub.cfg.new' before creation.
	Add `-f' to `mv' to handle the different filesystem
	semantics of Windows.
2008-07-29 15:38:05 +00:00
bean
e93e4679ce 2008-07-29 Bean <bean123ch@gmail.com>
* normal/main.c (get_line): Fix buffer overflow bug.
2008-07-29 15:07:47 +00:00
robertmh
41694fd019 2008-07-28 Robert Millan <rmh@aybabtu.com>
* partmap/apple.c (GRUB_APPLE_HEADER_MAGIC): New macro.
        (struct grub_apple_header): New struct.  Describes the layout of
        the partmap header.
        (apple_partition_map_iterate): Check the header magic as well as the
        partition magic (which was already being checked).
2008-07-28 22:37:32 +00:00
proski
cfd0b4e6fa 2008-07-28 Pavel Roskin <proski@gnu.org>
* genmk.rb: Add a warning to the beginning of the output that
	it's a generated file and should not be edited.
2008-07-28 22:35:40 +00:00
proski
96cdbeff6a autogen.sh: touch stamp-h.in after running autoheader
This prevents autoheader from being rerun by make if somebody changes
configure.ac or aclocal.m4 and runs autogen.sh.

Suggested by Christian Franke <Christian.Franke@t-online.de>
2008-07-28 19:34:15 +00:00
proski
c298def0bf Fix spacing 2008-07-28 19:27:42 +00:00
robertmh
93cce01644 2008-07-28 Robert Millan <rmh@aybabtu.com>
* disk/raid.c (grub_raid_scan_device): Do not abort when two disks
        with the same number are found, just use issue a warning with
        grub_dprintf(), as this error has been reported to be non-fatal.
2008-07-28 09:25:37 +00:00
robertmh
cd1df915ea 2008-07-27 Robert Millan <rmh@aybabtu.com>
* disk/ata.c (grub_ata_dumpinfo): Use grub_dprintf() for debugging
        information.
2008-07-27 20:57:43 +00:00
robertmh
47f908abba add grub/term.h like ChangeLog says.. 2008-07-27 15:44:37 +00:00
robertmh
2c76932c4b forgot to checkin last commit 2008-07-27 15:41:43 +00:00
bean
b70a8427ce 2008-07-27 Bean <bean123ch@gmail.com>
* fs/fat.c (GRUB_FAT_MAXFILE): New constant.
	(grub_fat_find_dir): Ignore case when comparing filename.
2008-07-27 14:46:45 +00:00
bean
8f5e379ff3 2008-07-27 Bean <bean123ch@gmail.com>
* fs/xfs.c (grub_xfs_dir_header): Change field i8count back to
	smallino, as it's more descriptive, and i8count can be confused with
	the other field count.
	(grub_xfs_iterate_dir): Adjust grub_xfs_dir_entry pointer for small
	inode type.
2008-07-27 14:20:49 +00:00
bean
a85cd5a0b5 2008-07-27 Bean <bean123ch@gmail.com>
* commands/crc.c: New file.

	* lib/crc.c: Likewise.

	* include/grub/lib/crc.h: Likewise.

	* util/grub-fstest.c: grub/hexdump.h => grub/lib/hexdump.h.

	* commands/hexdump.c: grub/hexdump.h => grub/lib/hexdump.h.
	(hexdump): Move this function to ...

	* lib/hexdump.c: ... here.

	* include/grub/hexdump.h: Renamed to ...

	* include/grub/lib/hexdump.h: ... this.

	* commands/loadenv.c: grub/envblk.h => grub/lib/envblk.h

	* util/grub-editenv.c: Likewise.

	* include/envblk.h: Renamed to ...

	* include/lib/envblk.h: ... this.

	* util/envblk.c: Renamed to ...

	* lib/envblk.c: ... this.

	* conf/common.rmk (grub_fstest_SOURCES): commands/hexdump.c =>
	lib/hexdump.c.
	(grub_editenv_SOURCES): util/envblk.c => lib/envblk.c
	(pkglib_MODULES): Add crc.mod.
	(hexdump_mod_SOURCES): Add lib/hexdump.c.
	(loadenv_mod_SOURCES): util/envblk.c => lib/envblk.c.
	(crc_mod_SOURCES): New macro.
	(crc_mod_CFLAGS): Likewise.
	(crc_mod_LDFLAGS): Likewise.

	* conf/i386-coreboot.rmk (grub_emu_SOURCES): Add lib/hexdump.c.

	* conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.

	* conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise.
2008-07-27 13:51:30 +00:00
robertmh
8749e9e524 2008-07-27 Felix Zielcke <fzielcke@z-51.de>
* commands/help.c: Include <grub/term.h>.
        (TERM_WIDTH): Removed.  Updated all users.
2008-07-27 13:04:02 +00:00
proski
cc349fb3dd 2008-07-27 Pavel Roskin <proski@gnu.org>
* util/getroot.c (find_root_device): Rephrase a comment to avoid
	spurious warnings about a comment within a comment.
2008-07-27 05:57:10 +00:00
robertmh
9051607e1e 2008-07-25 Robert Millan <rmh@aybabtu.com>
* util/getroot.c (find_root_device): Skip devices that match
        /dev/dm-[0-9].  This lets the real device be found for any type of
        abstraction (LVM, EVMS, RAID..).
        (grub_guess_root_device): Do not traverse /dev/mapper (for LVM)
        and /dev/evms (for EVMS) before traversing /dev.  If a /dev/dm-[0-9]
        device is found first, find_root_device() will now skip it.
2008-07-25 19:05:06 +00:00
proski
51cc519338 Typo fix 2008-07-24 23:37:22 +00:00
proski
01453bfcd7 2008-07-24 Pavel Roskin <proski@gnu.org>
* include/grub/types.h: Use __builtin_bswap32() and
	__builtin_bswap64() with gcc 4.3 and newer.
2008-07-24 23:36:13 +00:00
chrfranke
6af9849fbd Remove trailing whitespace. 2008-07-24 19:40:05 +00:00
chrfranke
3a0fa256ac 2008-07-24 Christian Franke <franke@computer.org>
* util/i386/pc/grub-install.in: If `--debug' is specified,
	pass `--verbose' to grub-setup.
	Abort script if make_system_path_relative_to_its_root() fails.
2008-07-24 19:02:47 +00:00
bean
7810e74787 2008-07-24 Bean <bean123ch@gmail.com>
* configure.ac: Fixed a bug caused by the previous cygwin patch,
	variable `target_platform' should be `platform'.
2008-07-24 18:14:41 +00:00
bean
42290e17c5 2008-07-24 Bean <bean123ch@gmail.com>
* video/reader/png.c (DELFATE_HLIT_MAX): Change value.
	(grub_png_init_fixed_block): New function.
	(grub_png_decode_image_data): Handle fixed huffman code compression.
2008-07-24 15:02:36 +00:00
bean
2a8a80e4f4 2008-07-24 Bean <bean123ch@gmail.com>
* common.rmk (bin_UTILITIES): Add grub-pe2elf.
	(grub_pe2elf_SOURCES): New macro.
	(CLEANFILES): Add grub-pe2elf.

	* include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant.
	(GRUB_PE32_SCN_ALIGN_2BYTES): Likewise.
	(GRUB_PE32_SCN_ALIGN_4BYTES): Likewise.
	(GRUB_PE32_SCN_ALIGN_8BYTES): Likewise.
	(GRUB_PE32_SCN_ALIGN_16BYTES): Likewise.
	(GRUB_PE32_SCN_ALIGN_32BYTES): Likewise.
	(GRUB_PE32_SCN_ALIGN_64BYTES): Likewise.
	(GRUB_PE32_SCN_ALIGN_SHIFT): Likewise.
	(GRUB_PE32_SCN_ALIGN_MASK): Likewise.
	(GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise.
	(GRUB_PE32_SYM_CLASS_STATIC): Likewise.
	(GRUB_PE32_SYM_CLASS_FILE): Likewise.
	(GRUB_PE32_DT_FUNCTION): Likewise.
	(GRUB_PE32_REL_I386_DIR32): Likewise.
	(GRUB_PE32_REL_I386_REL32): Likewise.
	(grub_pe32_symbol): New structure.
	(grub_pe32_reloc): Likewise.

	* util/grub-pe2elf.c: New file.

	* configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for
	start symbol in non pc platform.

	* genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf.

	The following patches are from Christian Franke.

	* include/grub/dl.h: Remove .previous, gas supports this only
	for ELF format.

	* include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE):
	Remove .type, gas supports this only for ELF format.

	* kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing
	nullbytes in symbol table. This fixes an infinite loop if table is
	zero filled.

	* Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT,
	TARGET_IMG_LDFLAGS and EXEEXT.

	* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by
	TARGET_IMG_LDFLAGS_AC.
	(grub_CHECK_STACK_ARG_PROBE): New function.

	* conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS.

	* conf/i386-pc-cygwin-ld-img.sc: New linker script.

	* configure.ac: Add check for linker script "conf/${target}-img-ld.c"
	to set TARGET_IMG_LD* accordingly.
	Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly.
	Add call to grub_CHECK_STACK_ARG_PROBE.
	Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols.

	* genkernsyms.sh.in: Handle HAVE_ASM_USCORE case.

	* genmk.rb: Add EXEEXT to CLEANFILES.
2008-07-24 14:56:30 +00:00
robertmh
12ccdb75a9 2008-07-23 Robert Millan <rmh@aybabtu.com>
* Makefile.in (UNICODE_ARROWS, UNICODE_LINES): New variables (they
        define the codes for arrows and lines used for the menu).
        (ascii.pff): Generate fonts for $(UNICODE_ARROWS) and $(UNICODE_LINES)
        as well.

        * util/update-grub_lib.in (font_path): Prefer ascii.pff over complete
        fonts, because the latter are too slow.
2008-07-22 22:23:45 +00:00
bean
18eeaf04d7 2008-07-21 Bean <bean123ch@gmail.com>
* kern/i386/pc/startup.S (gate_a20_try_bios): Change test order for
	a20. Run keyboard test last, as it will cause macbook to halt.
2008-07-21 10:40:01 +00:00
proski
b095e2adbf 2008-07-18 Pavel Roskin <proski@gnu.org>
* kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P.  We cannot
	load foreign architecture modules correctly anyway.  Keep
	support for loading host architecture modules, whether we
	compile them or not.
2008-07-18 16:11:35 +00:00
proski
8aaedab414 Typo fix 2008-07-18 03:47:33 +00:00
proski
3f4ce737bb 2008-07-17 Pavel Roskin <proski@gnu.org>
* configure.ac: Use -m32 or -m64 regardless of whether we had to
	change target_cpu.  The compiler default can mismatch target_cpu
	in any case.
2008-07-18 03:21:47 +00:00