Commit graph

582 commits

Author SHA1 Message Date
robertmh
9ca7033376 2008-01-07 Robert Millan <rmh@aybabtu.com>
* boot/i386/pc/boot.S (boot_drive_check): Add a comment indicating
        which instruction is modified by grub-setup during installation
        (since it wasn't obvious by only looking at this file).
2008-01-07 19:52:08 +00:00
robertmh
38ccf57536 2008-01-07 Robert Millan <rmh@aybabtu.com>
* TODO: Rewrite.  Just refer to the wiki and the BTS instead of
        listing actual TODO items.
2008-01-07 19:21:34 +00:00
okuji
868967cfaf 2008-01-06 Yoshinori K. Okuji <okuji@enbug.org>
* fs/reiserfs.c (grub_reiserfs_get_key_v2_type): Handle endianness
    correctly.
    (grub_reiserfs_get_key_offset): Likewise.
    (grub_reiserfs_set_key_offset): Likewise.
    (grub_reiserfs_set_key_type): Likewise.
    (grub_reiserfs_iterate_dir): Return 1 if found, otheriwise 0.

    (GRUB_REISERFS_KEYV2_BITFIELD): Undefined. Probably it would be
    better to remove the bitfield version completely.
2008-01-06 22:57:50 +00:00
okuji
f5db429174 2008-01-06 Yoshinori K. Okuji <okuji@enbug.org>
* fs/reiserfs.c (grub_reiserfs_iterate_dir): ENTRY_ITEM must be
    allocated from the heap, due to the fshelp implementation.
    (grub_reiserfs_dir): Free NODE, due to the same reason.
2008-01-06 15:34:11 +00:00
okuji
492e6d9d4b 2008-01-06 Yoshinori K. Okuji <okuji@enbug.org>
Mostly from Vincent Pelletier:

    * fs/reiserfs.c: New file.

    * conf/common.rmk (pkglib_MODULES): Added reiserfs.mod.
    (reiserfs_mod_SOURCES): New variable.
    (reiserfs_mod_CFLAGS): Likewise.
    (reiserfs_mod_LDFLAGS): Likewise.

    * DISTLIST: Added boot/i386/pc/lnxboot.S, commands/hexdump.c,
    disk/ata.c, fs/cpio.c, fs/ntfscomp.c, fs/reiserfs.c,
    include/grub/ntfs.h, include/grub/i386/pc/machine.h, and
    normal/color.c.
2008-01-06 14:14:31 +00:00
robertmh
9ce3e7c170 2008-01-06 Robert Millan <rmh@aybabtu.com>
* normal/color.c: Remove `<grub/env.h>'.
2008-01-06 12:58:46 +00:00
jeroen
f3b58148d6 2008-01-05 Jeroen Dekkers <jeroen@dekkers.cx>
* include/grub/normal.h: Include <grub/env.h>.
2008-01-05 21:45:21 +00:00
robertmh
fb3581902c Give credit to the person who reported that.. 2008-01-05 12:21:08 +00:00
robertmh
7ac3bcfa83 2008-01-05 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-setup.c (usage): Replace obsolete `(hd0,0)' in
        usage example with `(hd0,1)'.
2008-01-05 12:20:28 +00:00
robertmh
c8ee99d76e 2008-01-05 Robert Millan <rmh@aybabtu.com>
* kern/i386/loader.S (grub_linux_is_bzimage): New variable.
        (grub_linux_boot_zimage): Rename to ...
        (grub_linux_boot): ... this.
        (grub_linux_boot_bzimage): Merge with `grub_linux_boot_zimage'.
        (grub_linux_boot_zimage): Conditionalize zImage copy.

        * include/grub/i386/loader.h (grub_linux_is_bzimage): Add prototype.
        (grub_linux_boot_bzimage): Remove prototype.
        (grub_linux_boot_zimage): Rename to ...
        (grub_linux_boot): ... this.

        * loader/i386/pc/linux.c (big_linux): Replace with `grub_linux_is_bzimage'.
        (grub_linux_boot): Remove function.
2008-01-05 12:14:05 +00:00
robertmh
0ece25b1e1 2008-01-05 Robert Millan <rmh@aybabtu.com>
* include/grub/normal.h (grub_env_write_color_normal): New prototype.
	(grub_env_write_color_highlight): Likewise.
	(grub_wait_after_message): Likewise.

	* normal/color.c: New file.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `normal/color.c'.
	(normal_mod_DEPENDENCIES): Likewise.

	* conf/i386-efi.rmk (grub_emu_SOURCES): Add `normal/color.c'.
	(normal_mod_DEPENDENCIES): Likewise.

	* conf/i386-linuxbios.rmk (grub_emu_SOURCES): Add `normal/color.c'.
	(normal_mod_DEPENDENCIES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `normal/color.c'.
	(normal_mod_DEPENDENCIES): Likewise.

	* normal/menu_entry.c (run): Rely on grub_wait_after_message()
	for waiting after a message is printed.
	* normal/main.c (read_config_file): Likewise.
	(grub_normal_init): Register grub_env_write_color_normal() and
	grub_env_write_color_highlight() hooks.  Mark `color_normal' and
	`color_highlight' variables as global.

	* normal/menu.c (grub_wait_after_message): New function.
	(grub_color_menu_normal): New variable.  Replaces ...
	(GRUB_COLOR_MENU_NORMAL): ... this macro.
	(grub_color_menu_highlight): New variable.  Replaces ...
	(GRUB_COLOR_MENU_HIGHLIGHT): ... this macro.
	(draw_border): Set color state to `GRUB_TERM_COLOR_NORMAL' instead of
	`GRUB_TERM_COLOR_STANDARD'.
	(print_message): Use `grub_setcolorstate' to reload colors.  Rename
	`normal_code' and `highlight_code' to `old_color_normal' and
	`old_color_highlight', respectively.
	(grub_menu_init_page): Update colors when drawing the menu, based on
	`menu_color_normal' and `menu_color_highlight' variables.
	(grub_menu_run): Rely on grub_wait_after_message() for waiting after
	a message is printed.
2008-01-05 12:10:28 +00:00
robertmh
182dd4e568 2008-01-05 Robert Millan <rmh@aybabtu.com>
* kern/env.c (grub_env_context_open): Propagate hooks for global
        variables to new context.

        * kern/main.c (grub_set_root_dev): Export `root' variable.
2008-01-05 12:04:35 +00:00
robertmh
ddf8f6add7 2008-01-05 Robert Millan <rmh@aybabtu.com>
* util/biosdisk.c (get_os_disk): Check for devfs-style IDE and SCSI
        discs unconditionaly, since udev and others have options to provide
        them.
2008-01-05 12:02:03 +00:00
robertmh
d8b43d9b50 2008-01-05 Robert Millan <rmh@aybabtu.com>
* normal/completion.c (iterate_dir): Skip `.' and `..' directories.
2008-01-05 11:59:34 +00:00
robertmh
2bff2de347 2008-01-04 Christian Franke <franke@computer.org>
* kern/i386/pc/init.c (grub_machine_init): Fix evaluation
        of eisa_mmap.
2008-01-04 08:31:36 +00:00
proski
97eab9176c 2008-01-03 Pavel Roskin <proski@gnu.org>
* kern/i386/linuxbios/init.c: Put "void" to all function
	declarations with no arguments.
	* kern/powerpc/ieee1275/init.c: Likewise.
	* term/i386/pc/at_keyboard.c: Likewise.
	* term/i386/pc/vga_text.c: Likewise.
	* util/grub-mkdevicemap.c: Likewise.
2008-01-03 22:43:46 +00:00
robertmh
b9416d00ad 2008-01-02 Robert Millan <rmh@aybabtu.com>
* loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Improve error
        message when loaded image is out of bounds.
        (grub_multiboot_load_elf64): Likewise.
2008-01-02 11:55:23 +00:00
proski
92695df9e8 * util/grub.d/10_linux.in: Try version without ".old" when
looking for initrd.  It's better to use initrd from the newer
kernel of the same version than no initrd at all.
2008-01-02 08:34:41 +00:00
robertmh
d98d9cad88 2008-01-01 Robert Millan <rmh@aybabtu.com>
* util/biosdisk.c (get_os_disk): Fix check for IDE or SCSI discs.
2008-01-01 21:59:03 +00:00
chaac
dbfdce36f1 2008-01-01 Vesa Jaaskelainen <chaac@nic.fi>
* include/grub/video.h: Added grub_video_unmap_color and
        grub_video_get_active_render_target.
        (grub_video_adapter): Added unmap_color and get_active_render_target.

        * video/video.c: Added grub_video_unmap_color and
        grub_video_get_active_render_target.
        (grub_video_get_info): Changed method to accept NULL pointer as an
        argument to allow detection of active video adapter.

        * video/i386/pc/vbe.c: Renamed grub_video_vbe_unmap_color as
        grub_video_vbe_unmap_color_int.
        Added grub_video_vbe_unmap_color and
        grub_video_vbe_get_active_render_target.
        (grub_video_vbe_adapter): Added unmap_color and
        get_active_render_target.

        * video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage
        with grub_video_vbe_unmap_color_int.

        * term/gfxterm.c (DEFAULT_STANDARD_COLOR): Added.
        (DEFAULT_NORMAL_COLOR): Likewise.
        (DEFAULT_HIGHLIGHT_COLOR) Likewise.
        (DEFAULT_FG_COLOR): Removed.
        (DEFAULT_BG_COLOR): Likewise.
        (DEFAULT_CURSOR_COLOR): Changed value.
        (grub_virtual_screen): Added standard_color_setting,
        normal_color_setting, highlight_color_setting and term_color.
        (grub_virtual_screen): Removed fg_color_setting and bg_color_setting.
        (bitmap_width): Added.
        (bitmap_height): Likewise.
        (bitmap): Likewise.
        (set_term_color): Likewise.
        (grub_virtual_screen_setup): Changed to use new terminal coloring
        settings.
        (grub_gfxterm_init): Added init for bitmap.
        (grub_gfxterm_fini): Added destroy for bitmap.
        (redraw_screen_rect): Updated to use background bitmap and new
        terminal coloring.
        (scroll_up): Added optimization for case when there is no bitmap.
        (grub_gfxterm_cls): Fixed to use correct background color.
        (grub_virtual_screen_setcolorstate): Changed to use new terminal
        coloring.
        (grub_virtual_screen_setcolor): Likewise.
        (grub_virtual_screen_getcolor): Added.
        (grub_gfxterm_background_image_cmd): Likewise.
        (grub_video_term): Added setcolor and getcolor.
        (MOD_INIT): Added registration of background_image command.
        (MOD_TERM): Added unregistration for background_image command.
2008-01-01 12:02:07 +00:00
proski
df26671616 Fix date 2007-12-31 16:21:15 +00:00
proski
c3c20931a9 * loader/multiboot_loader.c: Fix multiboot command
unregistration.  Fix all typos in the word "multiboot".
2007-12-30 08:49:57 +00:00
proski
942391998a * util/grub.d/10_linux.in: Refactor search for initrd. Add
support for initrd names used in Fedora.
2007-12-29 20:53:20 +00:00
robertmh
fc6e896cc5 2007-12-26 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add cpio.mod.
	(cpio_mod_SOURCES): New variable.
	(cpio_mod_CFLAGS): Likewise.
	(cpio_mod_LDFLAGS): Likewise.

	* fs/cpio.c: New file.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add cpio.c.

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

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

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
2007-12-26 07:51:19 +00:00
robertmh
533110ada7 2007-12-25 Robert Millan <rmh@aybabtu.com>
* include/grub/term.h (struct grub_term): Add `getcolor' function.
	(grub_getcolor): New function.

	* kern/term.c (grub_getcolor): New function.
	* normal/menu.c (GRUB_COLOR_MENU_NORMAL): New macro.
	(GRUB_COLOR_MENU_HIGHLIGHT): New macro.
	(print_entry): Set normal and highlight colors to
	`GRUB_COLOR_MENU_NORMAL' and `GRUB_COLOR_MENU_HIGHLIGHT',
	respectively, before printing and restore them to old
	values afterwards.
	(grub_menu_init_page): Likewise.  Fill an additional colored space
	that would otherwise be left blank.

	* term/efi/console.c (grub_console_getcolor): New function.
	(struct grub_console_term.getcolor): New variable.
	* term/i386/pc/console.c (grub_console_getcolor): New function.
	(struct grub_console_term.getcolor): New variable.
	* term/ieee1275/ofconsole.c (grub_ofconsole_getcolor): New function.
	(struct grub_console_term.getcolor): New variable.

	* term/i386/pc/serial.c (grub_serial_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
	* term/i386/pc/vesafb.c (grub_virtual_screen_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
	* term/i386/pc/vga.c (grub_vga_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
	* term/gfxterm.c (grub_virtual_screen_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
2007-12-25 11:10:47 +00:00
robertmh
4931827fe4 2007-12-25 Robert Millan <rmh@aybabtu.com>
* configure.ac: Search for possible unifont.hex locations, and
	define UNIFONT_HEX if found.

	* Makefile.in (UNIFONT_HEX): Define variable.
	(DATA): Rename to ...
	(PKGLIB): ... this.  Update all users.
	(PKGDATA): New variable.
	(pkgdata_IMAGES): Rename to ...
	(pkglib_IMAGES): ... this. Update all users.
	(pkgdata_MODULES): Rename to ...
	(pkglib_MODULES): ... this. Update all users.
	(pkgdata_PROGRAMS): Rename to ...
	(pkglib_PROGRAMS): ... this. Update all users.
	(pkgdata_DATA): Rename to ...
	(pkglib_DATA): ... this. Update all users.
	(CLEANFILES): Redefine to `$(pkglib_DATA) $(pkgdata_DATA)'.
	(unicode.pff, ascii.pff): New rules.
	(all-local): Add `$(PKGDATA)' dependency.
	(install-local): Process `$(PKGDATA)'.

	* util/update-grub_lib.in (font_path): Search for *.pff files in
	a few more locations, including `${pkgdata}'.
2007-12-25 09:09:43 +00:00
robertmh
57e57e3167 2007-12-23 Robert Millan <rmh@aybabtu.com>
Patch from Bean  <bean123ch@gmail.com>:
	* disk/loopback.c (grub_loopback_read): Add missing bit shift to
	`size'.
2007-12-23 21:28:03 +00:00
robertmh
4bc72aa96f 2007-12-21 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add ntfscomp.mod.
	(ntfscomp_mod_SOURCES): New variable.
	(ntfscomp_mod_CFLAGS): Likewise.
	(ntfscomp_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ntfscomp.c.
	(grub_probe_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-efi.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-linuxbios.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c.
	(grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add fs/ntfscomp.c.
	(grub_emu_SOURCES): Likewise.

	* fs/ntfs.c (grub_ntfscomp_func): New variable.
	(read_run_list): Renamed to grub_ntfs_read_run_list.
	(decomp_nextvcn): Moved to ntfscomp.c.
	(decomp_getch): Likewise.
	(decomp_get16): Likewise.
	(decomp_block): Likewise.
	(read_block): Likewise.
	(read_data): Partially moved to ntfscomp.c.
	(fixup): Change unsigned to grub_uint16_t.
	(read_mft): Change unsigned long to grub_uint32_t.
	(read_attr): Likewise.
	(read_data): Likewise.
	(read_run_data): Likewise.
	(read_run_list): Likewise.
	(read_mft): Likewise.

	* fs/ntfscomp.c: New file.

	* include/grub/ntfs.h: New file.
2007-12-21 11:41:23 +00:00
robertmh
af680a8784 2007-12-16 Robert Millan <rmh@aybabtu.com>
* util/grub-mkdevicemap.c (make_device_map): Iterate up to 20 for
	IDE disk check, since Linux is known to support 20 IDE disks.
	Reported by Colin Watson.
2007-12-15 23:08:25 +00:00
robertmh
84be7599f6 2007-12-15 Bean <bean123ch@gmail.com>
* conf/i386-pc.rmk (pkgdata_IMAGES): Add lnxboot.img.
	(lnxboot_img_SOURCES): New variable.
	(lnxboot_img_ASFLAGS): Likewise.
	(lnxboot_img_LDFLAGS): Likewise.

	* boot/i386/pc/lnxboot.S: New file.
2007-12-15 10:42:17 +00:00
proski
6af9db01bc * configure.ac: Test if '--build-id=none' is supported by the
linker.  If yes, add it to TARGET_LDFLAGS.  Build ID causes
objcopy to generate incorrect binary files (binutils
2.17.50.0.18-1 as shipped by Fedora 8).
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
linking, so that build ID doesn't break the test.
2007-11-25 02:01:30 +00:00
proski
7361cfe62e * include/grub/i386/time.h: use "void" in the argument list
of grub_cpu_idle().
* include/grub/powerpc/time.h: Likewise.
* include/grub/sparc64/time.h: Likewise.
2007-11-25 01:46:59 +00:00
robertmh
68f6ac74e2 Fix ChangeLog entry. 2007-11-18 11:54:12 +00:00
robertmh
1593e10c1e 2007-11-18 Christian Franke <franke@computer.org>
* util/console.c (grub_ncurses_getkey): Change curses KEY_* mapping,
	now return control chars instead of GRUB_CONSOLE_KEY_* constants.
	This fixes the problem that function keys did not work in grub-emu.
2007-11-18 07:20:45 +00:00
robertmh
3b8db1a82b 2007-11-18 Christian Franke <franke@computer.org>
* disk/host.c (grub_host_open): Remove attribute unused from
	name parameter. Add check for "host". This fixes the problem
	that grub-emu does not find partitions.
2007-11-18 07:17:40 +00:00
robertmh
2e29408d1f 2007-11-18 Christian Franke <franke@computer.org>
* util/hostfs.c (is_dir): New function.
	(grub_hostfs_dir):  Handle missing dirent.d_type case.
	(grub_hostfs_read): Add missing fseek().
	(grub_hostfs_label): Clear label pointer.  This fixes a crash
	of grub-emu on "ls (host)".
2007-11-18 07:14:26 +00:00
robertmh
398cd047ab 2007-11-18 Christian Franke <franke@computer.org>
* include/grub/i386/pc/init.h (struct grub_machine_mmap_entry):
	Add attribute packed, gcc 3.4.4 on Cygwin aligns this
	to 64 bit boundary by default.
2007-11-18 07:10:47 +00:00
robertmh
c405c39191 2007-11-18 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add hexdump.mod.
	(hexdump_mod_SOURCES): New variable.
	(hexdump_mod_CFLAGS): Likewise.
	(hexdump_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add command/hexdump.c.

	* conf/i386-efi.rmk (grub_emu_SOURCES): Add command/hexdump.c.

	* conf/i386-linuxbios.rmk (grub_emu_SOURCES): Add command/hexdump.c.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add command/hexdump.c.

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

	* commands/hexdump.c: New file.
2007-11-18 06:41:46 +00:00
robertmh
5cced7fd10 2007-11-10 Robert Millan <rmh@aybabtu.com>
* commands/i386/pc/play.c (beep_off): Switch order of arguments
	in grub_outb() calls.
	(beep_on): Likewise.
2007-11-10 21:36:24 +00:00
robertmh
8b714eb0e1 2007-11-10 Christian Franke <franke@computer.org>
* normal/menu.c (run_menu): Check for empty menu to avoid crash.
	(grub_menu_run): Likewise.
2007-11-10 20:32:32 +00:00
robertmh
ce0f1839a5 2007-11-10 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/efi/machine.h: New file.
	* include/grub/i386/linuxbios/machine.h: Likewise.
	* include/grub/i386/pc/machine.h: Likewise.
	* include/grub/powerpc/ieee1275/machine.h: Likewise.
	* include/grub/sparc64/ieee1275/machine.h: Likewise.

	* term/i386/pc/serial.c: Include <grub/machine/machine.h>.
	(serial_hw_io_addr): New variable.
	(serial_hw_get_port): Obtain port address from `serial_hw_io_addr'
	instead of `(unsigned short *) 0x400'.
2007-11-10 20:23:14 +00:00
robertmh
270c237dbe 2007-11-10 Bean <bean123ch@gmail.com>
* fs/ntfs.c (read_block): Fix a bug caused by adjacent blocks.
2007-11-10 20:08:33 +00:00
chaac
a87783bfa1 2007-11-10 Vesa Jaaskelainen <chaac@nic.fi>
* conf/i386-pc.rmk (pkgdata_MODULES): Added vga.mod.
        (vga_mod_SOURCES): Added.
        (vga_mod_CFLAGS): Likewise.
        (vga_mod_LDFLAGS): Likewise.

        * term/i386/pc/vga.c (get_map_mask): Switch order of arguments in
        grub_outb() calls.
        (set_map_mask): Likewise.
        (set_read_map): Likewise.
        (set_read_address): Likewise.
        (vga_font): Removed variable.
        (get_vga_glyph): Removed function.
        (invalidate_char): Likewise.
        (write_char): Changed to use grub_font_get_glyph() for font
        information.
        (grub_vga_putchar): Likewise.
        (grub_vga_getcharwidth): Likewise.
2007-11-10 18:34:48 +00:00
chaac
6433b448ac 2007-11-10 Vesa Jaaskelainen <chaac@nic.fi>
* conf/i386-pc.rmk (boot_img_LDFLAGS): Use COMMON_LDFLAGS for target
        flags.
        (pxeboot_img_LDFLAGS): Likewise.
        (diskboot_img_LDFLAGS): Likewise.
        (kernel_img_LDFLAGS): Likewise.
2007-11-10 18:30:40 +00:00
robertmh
4917851111 2007-11-06 Robert Millan <rmh@aybabtu.com>
* term/i386/pc/serial.c (serial_hw_put): Switch order of arguments
	in grub_outb() calls.
	(serial_hw_init): Likewise.
2007-11-06 21:23:59 +00:00
robertmh
53b052dedb 2007-11-05 Robert Millan <rmh@aybabtu.com>
* util/update-grub.in: Allow files in ${update_grub_dir} to contain
	spaces.  Skip non-regular files.
2007-11-05 16:22:30 +00:00
robertmh
5ab33bba2f 2007-11-05 Robert Millan <rmh@aybabtu.com>
* kern/disk.c (grub_disk_firmware_fini)
	(grub_disk_firmware_is_tainted): New variables.

	* include/grub/disk.h (grub_disk_firmware_fini)
	(grub_disk_firmware_is_tainted): Likewise.

	* disk/i386/pc/biosdisk.c (GRUB_MOD_FINI(biosdisk)): Moved from here ...
	(grub_disk_biosdisk_fini): ... to here.
	(GRUB_MOD_FINI(biosdisk)): Implement using grub_disk_biosdisk_fini().
	(GRUB_MOD_INIT(biosdisk)): Abort when `grub_disk_firmware_is_tainted'
	is set.  Register grub_disk_biosdisk_fini() in
	`grub_disk_firmware_fini'.

	* disk/ata.c: Remove `<grub/machine/biosdisk.h>'.
	(GRUB_MOD_INIT(ata)): Remove grub_biosdisk_fini() call.
	Use `grub_disk_firmware_is_tainted' and `grub_disk_firmware_fini'
	to finish existing firmware disk interface.

	* conf/i386-linuxbios.rmk (pkgdata_MODULES): Add `ata.mod'.
	(ata_mod_SOURCES): New variable.
	(ata_mod_CFLAGS): Likewise.
	(ata_mod_LDFLAGS): Likewise.
2007-11-05 16:15:27 +00:00
robertmh
0149ab7c63 2007-11-05 Robert Millan <rmh@aybabtu.com>
* disk/ata.c: Remove `<grub/machine/time.h>'.  Include `<grub/time.h>'.
	(grub_ata_wait): Reimplement using grub_millisleep().

	* include/grub/misc.h (grub_div_roundup): Fix parenthesization.
	* include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction.
2007-11-05 14:54:00 +00:00
marco_g
be7ac41e14 2007-11-03 Marco Gerards <marco@gnu.org>
* term/i386/pc/vga_text.c: Include <grub/cpu/io.h>.
	(CRTC_ADDR_PORT): New macro.
	(CRTC_DATA_PORT): Likewise.
	(CRTC_CURSOR): Likewise.
	(CRTC_CURSOR_ADDR_HIGH): Likewise.
	(CRTC_CURSOR_ADDR_LOW): Likewise.
	(update_cursor): New function.
	(grub_console_real_putchar): Call `update_cursor'.
	(grub_console_gotoxy): Likewise.
	(grub_console_cls): Set the default color when clearing the
	screen.
	(grub_console_setcursor): Implemented.
2007-11-03 16:46:40 +00:00
marco_g
bb06ab2eb2 2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_pio_read): Don't wait for the command to
	become activate.
	(grub_ata_pio_write): Likewise.

	(grub_atapi_identify): Wait after issuing an ATA command.
	(grub_atapi_packet): Likewise.
	(grub_ata_identify): Likewise.
	(grub_ata_readwrite): Likewise.
2007-11-03 15:45:07 +00:00
marco_g
cf8f780b84 2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_pio_read): Detect and return the error code.
	(grub_ata_pio_write): Likewise.
	(grub_ata_readwrite): Use `grub_error', instead of
	returning `grub_errno'.
2007-11-03 13:12:52 +00:00
marco_g
ed649e5402 2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and
	grub_ata_pio_write once for every single sector, instead of for
	multiple sectors.
2007-11-03 12:25:19 +00:00
robertmh
ca25d8f0c1 2007-10-31 Robert Millan <rmh@aybabtu.com>
* configure.ac: Add `i386-linuxbios' to the list of supported targets.

	* conf/i386-linuxbios.rmk: New file.

	* kern/i386/pc/hardware.c: Likewise.
	* term/i386/pc/at_keyboard.c: Likewise.
	* term/i386/pc/vga_text.c: Likewise.

	* include/grub/i386/linuxbios/boot.h: Likewise.
	* include/grub/i386/linuxbios/console.h: Likewise.
	* include/grub/i386/linuxbios/init.h: Likewise.
	* include/grub/i386/linuxbios/kernel.h: Likewise.
	* include/grub/i386/linuxbios/loader.h: Likewise.
	* include/grub/i386/linuxbios/memory.h: Likewise.
	* include/grub/i386/linuxbios/serial.h: Likewise.
	* include/grub/i386/linuxbios/time.h: Likewise.

	* kern/i386/linuxbios/init.c: Likewise.
	* kern/i386/linuxbios/startup.S: Likewise.
	* kern/i386/linuxbios/table.c: Likewise.
2007-10-31 22:35:13 +00:00
marco_g
e911ecc1c2 2007-10-31 Marco Gerards <marco@gnu.org>
* conf/i386-pc.rmk (pkgdata_MODULES): Add `ata.mod'.
	(ata_mod_SOURCES): New variable.
	(ata_mod_CFLAGS): Likewise.
	(ata_mod_LDFLAGS): Likewise.

	* disk/ata.c: New file.

	* include/grub/disk.h (grub_disk_dev_id): Add
	`GRUB_DISK_DEV_ATA_ID'.
2007-10-31 22:29:20 +00:00
robertmh
7f66d0e020 2007-10-31 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/pc/init.h (grub_lower_mem): Moved from here ...
	* include/grub/i386/pc/memory.h (grub_lower_mem): ... to here.

	* include/grub/i386/pc/init.h (grub_upper_mem): Moved from here ...
	* include/grub/i386/pc/memory.h (grub_upper_mem): ... to here.

	* include/grub/i386/pc/memory.h: Include `<grub/symbol.h>' and
	`<grub/types.h>'.

	* loader/i386/pc/multiboot.c: Include `<grub/machine/memory.h>'.
2007-10-31 22:14:50 +00:00
robertmh
3236ca65b8 adjust last ChangeLog entry. 2007-10-27 12:11:25 +00:00
robertmh
5cd7dd4654 2007-10-27 Robert Millan <rmh@aybabtu.com>
* include/grub/types.h: Define ULONG_MAX.
2007-10-27 11:56:58 +00:00
robertmh
2ebfc90fdb 2007-10-22 Robert Millan <rmh@aybabtu.com>
* kern/i386/pc/startup.S: Remove `"kern/i386/realmode.S"'.  Include
	`"../realmode.S"'.
	Remove `"kern/i386/loader.S"'.  Include `"../loader.S"'.
2007-10-22 20:14:45 +00:00
robertmh
73fcb0f38d 2007-10-22 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Remove `disk/i386/pc/biosdisk.c'.
	(pkgdata_MODULES): Add `biosdisk.mod'.
	(biosdisk_mod_SOURCES, biosdisk_mod_CFLAGS, biosdisk_mod_LDFLAGS): New
	variables.

	* disk/i386/pc/biosdisk.c: Include `<grub/dl.h>'.
	(grub_biosdisk_init): Replace with ...
	(GRUB_MOD_INIT(biosdisk)): ... this.
	(grub_biosdisk_fini): Replace with ...
	(GRUB_MOD_FINI(biosdisk)): ... this.

	* kern/i386/pc/init.c: Remove `<grub/machine/biosdisk.h>'.
	(grub_machine_init): Remove call to grub_biosdisk_init().
	(grub_machine_fini): Remove call to grub_machine_fini().

	* util/i386/pc/grub-install.in (modules): Add `biosdisk'.
2007-10-22 20:05:27 +00:00
robertmh
3381d27403 2007-10-22 Robert Millan <rmh@aybabtu.com>
* include/grub/time.h: New file.
	* include/grub/i386/time.h: Likewise.
	* include/grub/powerpc/time.h: Likewise.
	* include/grub/sparc64/time.h: Likewise.

	* include/grub/i386/pc/time.h (KERNEL_TIME_HEADER): Rename all
	instances to ...
	(KERNEL_MACHINE_TIME_HEADER): ... this.
	* include/grub/powerpc/ieee1275/time.h (KERNEL_TIME_HEADER): Rename all
	instances to ...
	(KERNEL_MACHINE_TIME_HEADER): ... this.
	* include/grub/sparc64/ieee1275/time.h (KERNEL_TIME_HEADER): Rename all
	instances to ...
	(KERNEL_MACHINE_TIME_HEADER): ... this.

	* kern/i386/efi/init.c: Include `<grub/time.h>'.
	(grub_millisleep): New function.
	* kern/i386/pc/init.c: Include `<grub/time.h>'.
	(grub_millisleep): New function.
	* kern/powerpc/ieee1275/init.c: Include `<grub/time.h>'.
	Remove `grub/machine/time.h' include.
	(grub_millisleep): New function.
	* kern/sparc64/ieee1275/init.c: Include `<grub/time.h>'.
	Remove `grub/machine/time.h' include.
	(grub_millisleep): New function.

	* include/grub/misc.h (grub_div_roundup): New function.

	* kern/misc.c: Include `<grub/time.h>'.
	(grub_millisleep_generic): New function.

	* conf/i386-efi.rmk (kernel_mod_HEADERS): Remove `i386/efi/time.h'.
	Add `time.h'.
	* conf/i386-pc.rmk (kernel_img_HEADERS): Remove `machine/time.h'.
	Add `time.h'.
	* conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): Remove
	`machine/time.h'.  Add `time.h'.
	* conf/sparc64-ieee1275.rmk (kernel_elf_HEADERS): Likewise.
2007-10-22 19:59:33 +00:00
robertmh
a39a031233 2007-10-21 Robert Millan <rmh@aybabtu.com>
* include/grub/misc.h (grub_max): New function.
2007-10-21 12:58:21 +00:00
robertmh
2aad70e250 2007-10-21 Robert Millan <rmh@aybabtu.com>
* util/misc.c (grub_util_info): Call fflush() before returning.
2007-10-21 12:29:33 +00:00
robertmh
54b71c4b7b 2007-10-20 Robert Millan <rmh@aybabtu.com>
* genmk.rb (Image): Copy `extra_flags' from here ...
	(PModule): ... to here.  Use it in `#{obj}: #{src}' rule.

	* commands/i386/cpuid.c (grub_cmd_cpuid): Add __attribute__ ((unused))
	to `argc' and `args' arguments.
2007-10-20 18:32:18 +00:00
robertmh
a979f513cd 2007-10-17 Robert Millan <rmh@aybabtu.com>
* kern/i386/loader.S: New file.

	* kern/i386/pc/startup.S (grub_linux_prot_size): Moved from here ...
	* kern/i386/loader.S (grub_linux_prot_size)... to here.
	* kern/i386/pc/startup.S (grub_linux_tmp_addr): Moved from here ...
	* kern/i386/loader.S (grub_linux_tmp_addr)... to here.
	* kern/i386/pc/startup.S (grub_linux_real_addr): Moved from here ...
	* kern/i386/loader.S (grub_linux_real_addr)... to here.
	* kern/i386/pc/startup.S (grub_linux_boot_zimage): Moved from here ...
	* kern/i386/loader.S (grub_linux_boot_zimage)... to here.
	* kern/i386/pc/startup.S (grub_linux_boot_bzimage): Moved from here ...
	* kern/i386/loader.S (grub_linux_boot_bzimage)... to here.
	* kern/i386/pc/startup.S (grub_multiboot_real_boot): Moved from here ...
	* kern/i386/loader.S (grub_multiboot_real_boot)... to here.
	* kern/i386/pc/startup.S (grub_multiboot2_real_boot): Moved from here ...
	* kern/i386/loader.S (grub_multiboot2_real_boot)... to here.

	* kern/i386/realmode.S: New file.

	* kern/i386/pc/startup.S (protstack): Moved from here ...
	* kern/i386/realmode.S (protstack)... to here.
	* kern/i386/pc/startup.S (gdt): Moved from here ...
	* kern/i386/realmode.S (gdt)... to here.
	* kern/i386/pc/startup.S (prot_to_real): Moved from here ...
	* kern/i386/realmode.S (prot_to_real)... to here.

	* kern/i386/pc/startup.S: Include `kern/i386/loader.S' and
	`kern/i386/realmode.S'.
2007-10-17 20:02:56 +00:00
robertmh
825fc8fda2 2007-10-17 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/loader.h: New file.

	* include/grub/i386/pc/loader.h (grub_linux_prot_size)
	(grub_linux_tmp_addr, grub_linux_real_addr, grub_os_area_addr)
	(grub_os_area_size, grub_linux_boot_zimage, grub_linux_boot_bzimage)
	(grub_multiboot_real_boot, grub_multiboot2_real_boot)
	(grub_rescue_cmd_linux, grub_rescue_cmd_initrd): Moved from here ...
	* include/grub/i386/loader.h (grub_linux_prot_size)
	(grub_linux_tmp_addr, grub_linux_real_addr, grub_os_area_addr)
	(grub_os_area_size, grub_linux_boot_zimage, grub_linux_boot_bzimage)
	(grub_multiboot_real_boot, grub_multiboot2_real_boot)
	(grub_rescue_cmd_linux, grub_rescue_cmd_initrd): ... to here.

	* include/grub/i386/pc/loader.h: Include `grub/cpu/loader.h'.
2007-10-17 09:38:55 +00:00
robertmh
e179b2f4a5 2007-10-15 Robert Millan <rmh@aybabtu.com>
* normal/misc.c (grub_normal_print_device_info): Do not probe for
	filesystem when dev->disk is unset.
	Do probe for filesystem even when dev->disk->has_partitions is set.
	In case a filesystem is found, always report it.
	In case it isn't, if dev->disk->has_partitions is set, report that
	a partition table was found instead of reporting that no filesystem
	could be identified.
2007-10-15 10:59:38 +00:00
robertmh
5db82af689 2007-10-12 Robert Millan <rmh@aybabtu.com>
* conf/powerpc-ieee1275.rmk (grub_mkimage_SOURCES): Replace reference
	to util/powerpc/ieee1275/grub-mkimage.c with util/elf/grub-mkimage.c.

	* include/grub/types.h (#ifdef GRUB_CPU_WORDS_BIGENDIAN): Define
	grub_host_to_target16, grub_host_to_target32, grub_host_to_target64,
	grub_target_to_host16, grub_target_to_host32 and grub_target_to_host64.
	(#else): Likewise.

	* include/grub/powerpc/ieee1275/kernel.h (GRUB_IEEE1275_MOD_ALIGN):
	Renamed from to ...
	(GRUB_MOD_ALIGN): ...this.  Update all users.

	* util/elf/grub-mkimage.c: Replace grub_cpu_to_be16, grub_cpu_to_be32,
	grub_be_to_cpu16 and grub_be_to_cpu32 macros with grub_host_to_target16,
	grub_host_to_target32, grub_target_to_host16 and grub_target_to_host32,
	respectively.
2007-10-12 10:22:31 +00:00
robertmh
3cf497cc8d 2007-10-12 Robert Millan <rmh@aybabtu.com>
* util/powerpc/ieee1275/grub-mkimage.c: Moved to ...
	* util/elf/grub-mkimage.c: ... here.

	* DISTLIST: Add `util/elf/grub-mkimage.c'.  Remove
	`util/powerpc/ieee1275/grub-mkimage.c'.
2007-10-12 10:18:13 +00:00
robertmh
c8cc369234 2007-10-07 Robert Millan <rmh@aybabtu.com>
* kern/powerpc/ieee1275/init.c: Rename HEAP_LIMIT to HEAP_MAX_ADDR,
	and make it easier to figure out.
	Add HEAP_MIN_SIZE and HEAP_MAX_ADDR definitions.
	(grub_claim_heap): Use HEAP_MAX_ADDR rather than taking a parameter.
	Do not avoid claiming a region above HEAP_MAX_ADDR if that would
	leave us with less than HEAP_MIN_SIZE total heap.
	Avoid our total amount of heap to surpass HEAP_MAX_SIZE.
2007-10-07 15:32:52 +00:00
robertmh
adbc4c9d7e 2007-10-05 Robert Millan <rmh@aybabtu.com>
* loader/i386/pc/linux.c (grub_rescue_cmd_linux): Specify available
	and required memory sizes in "too small lower memory" error.
2007-10-05 11:02:40 +00:00
robertmh
afcd2ef88b Adjust ChangeLog entry as recommended by Marco. 2007-10-03 21:33:11 +00:00
robertmh
5c58b791cc 2007-10-03 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/io.h: New file.
	* commands/i386/pc/play.c (inb): Removed.
	(outb): Removed.
	Include grub/cpu/io.h.  Replace inb() with grub_inb() and outb()
	with grub_outb().
	* term/i386/pc/serial.c: Likewise.
	* term/i386/pc/vga.c: Likewise.
2007-10-03 20:13:21 +00:00
robertmh
1a477ed638 2007-10-02 Robert Millan <rmh@aybabtu.com>
* conf/i386-efi.rmk (grub_emu_SOURCES): Add util/hostfs.c.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
	Reported by Marcin Kurek.
2007-10-02 21:38:44 +00:00
robertmh
6b5d80fa11 2007-09-07 Robert Millan <rmh@aybabtu.com>
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_test_flag): Detect
	SmartFirmware version updates (as released by Sven Luther), and avoid
	setting GRUB_IEEE1275_FLAG_NO_PARTITION_0 or
	GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS unless the running version is
	known broken.
2007-09-07 21:59:03 +00:00
okuji
5618afbf59 2007-09-03 Yoshinori K. Okuji <okuji@enbug.org>
From Hitoshi Ozeki:
    * kern/i386/pc/init.c (compact_mem_regions): Decrease NUM_REGIONS
    when merging two regions.
2007-09-03 20:33:20 +00:00
okuji
508e39ee41 2007-09-03 Yoshinori K. Okuji <okuji@enbug.org>
* kern/rescue.c (grub_enter_rescue_mode): Free ARGS.
    * normal/completion.c (grub_normal_do_completion): Likewise.
    Reported by Hitoshi Ozeki.
2007-09-03 20:28:24 +00:00
okuji
6139dcd953 2007-09-03 Yoshinori K. Okuji <okuji@enbug.org>
Do not use devices at boot in chainloading.

    * loader/i386/pc/chainloader.c (boot_drive): New variable.
    (boot_part_addr): Likewise.
    (grub_chainloader_boot): Simply call grub_chainloader_real_boot
    with BOOT_DRIVE and BOOT_PART_ADDR.
    (grub_chainloader_cmd): Set BOOT_DRIVE and BOOT_PART_ADDR.
    Reported by Hitoshi Ozeki <h-ozeki@ck2.so-net.ne.jp>.
2007-09-03 20:10:19 +00:00
robertmh
38da651643 2007-08-29 Robert Millan <rmh@aybabtu.com>
Patch from Simon Peter <dn.tlp@gmx.net>:
	* genmk.rb (Utility): Append $(#{src}_DEPENDENCIES) to #{obj} targets.
	* conf/i386-pc.rmk: Replace grub-probe_DEPENDENCIES with
	util/grub-probe.c_DEPENDENCIES.  Replace grub-setup_DEPENDENCIES with
	util/i386/pc/grub-setup.c_DEPENDENCIES.
	* conf/i386-efi.rmk: Replace grub-probe_DEPENDENCIES with
	util/grub-probe.c_DEPENDENCIES.
	* conf/powerpc-ieee1275.rmk: Likewise.
2007-08-29 10:39:42 +00:00
robertmh
29d0928cd7 2007-08-28 Robert Millan <rmh@aybabtu.com>
* util/i386/get_disk_name.c: New.  Implement grub_util_get_disk_name()
	to tell grub-mkdevicemap how to name devices.
	* util/ieee1275/get_disk_name.c: Likewise (using "ofpathname -a"
	feature).

	* conf/i386-efi.rmk (grub_mkdevicemap_SOURCES): Add
	util/i386/get_disk_name.c.
	* conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Likewise.
	* conf/powerpc-ieee1275.rmk (grub_mkdevicemap_SOURCES): Add
	util/ieee1275/get_disk_name.c.

	* include/grub/util/misc.h: grub_util_get_disk_name() declaration.

	* DISTLIST: Add util/i386/get_disk_name.c and
	util/ieee1275/get_disk_name.c.

	* util/grub-mkdevicemap.c: Replace device naming logic with
	grub_util_get_disk_name() calls.
2007-08-28 10:18:10 +00:00
robertmh
5a0d3cca6d 2007-08-20 Robert Millan <rmh@aybabtu.com>
* normal/menu.c (run_menu): Refer to seconds as "s" not "seconds"
	(so that it works for both plural and singular quantities).
2007-08-20 14:35:20 +00:00
robertmh
8b72db2f01 2007-08-05 Robert Millan <rmh@aybabtu.com>
* util/grub.d/10_linux.in (test_gt): Strip out vmlinu[xz]- prefix
	so that [xz] isn't taken into account when determining order.
2007-08-05 10:33:58 +00:00
marco_g
352466bf45 2007-08-02 Marco Gerards <marco@gnu.org>
* DISTLIST: Add `disk/host.c', `fs/ntfs.c', `include/multiboot.h',
	`include/multiboot2.h', `include/grub/elfload.h',
	`include/multiboot.h', `include/grub/multiboot.h',
	`include/grub/multiboot_loader.h', `include/grub/multiboot2.h',
	`include/grub/i386/pc/biosdisk.h', `include/grub/util/biosdisk.h',
	`kern/elf.c', `loader/multiboot_loader.c',
	`loader/multiboot_loader_normal.c', `loader/multiboot2.c',
	`loader/i386/pc/multiboot2.c',
	`loader/powerpc/ieee1275/multiboot2.c', `util/hostfs.c' and
	`util/i386/pc/grub-mkrescue.in'.  Remove
	`include/grub/biosdisk.h', `include/grub/i386/pc/multiboot.h',
	`include/grub/i386/pc/util/biosdisk.h' and
	`include/grub/powerpc/ieee1275/multiboot.h'.
2007-08-02 20:19:50 +00:00
marco_g
8f096014e4 2007-08-02 Bean <bean123ch@gmail.com>
* conf/common.rmk (pkgdata_MODULES): Add ntfs.mod.
	(ntfs_mod_SOURCES): New variable.
	(ntfs_mod_CFLAGS): Likewise.
	(ntfs_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ntfs.c.
	(grub_probe_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.

	* conf/i386-efi.rmk (grub_probe_SOURCES): Add fs/ntfs.c.
	(grub_emu_SOURCES): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add fs/ntfs.c.
	(grub_emu_SOURCES): Likewise.

	* conf/misc.c (grub_utf16_to_utf8): Fix unicode conversion bug.

	* fs/ntfs.c: New file.
2007-08-02 19:12:52 +00:00
marco_g
9959f7dbb5 2007-08-02 Bean <bean123ch@gmail.com>
* disk.h (grub_disk): Use NESTED_FUNC_ATTR.

	* file.h (grub_file): Likewise.

	* fshelp.h (grub_fshelp_read_file): Likewise.

	* util/i386/pc/grub-setup.c (setup): Likewise.
	(save_first_sector): Likewise.
	(save_blocklists): Likewise.

	* fs/affs.c (grub_affs_read_file): Likewise.

	* fs/ext2.c (grub_ext2_read_file): Likewise.

	* fs/fat.c (grub_fat_read_data): Likewise.

	* fs/fshelp.c (grub_fshelp_read_file): Likewise.

	* fs/hfs.c (grub_hfs_read_file): Likewise.

	* fs/hfsplus.c (grub_hfsplus_read_file): Likewise.

	* fs/jfs.c (grub_jfs_read_file): Likewise.

	* fs/minix.c (grub_minix_read_file): Likewise.

	* fs/sfs.c (grub_sfs_read_file): Likewise.

	* fs/ufs.c (grub_ufs_read_file): Likewise.

	* fs/xfs.c (grub_xfs_read_file): Likewise.

	* command/blocklist.c (read_blocklist): Likewise.
	(print_blocklist): Likewise.
2007-08-02 18:40:37 +00:00
marco_g
0a203f83ff 2007-08-02 Marco Gerards <marco@gnu.org>
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/host.c' and
	`util/hostfs.c'.

	* disk/host.c: New file.

	* util/hostfs.c: Likewise.

	* fs/hfsplus.c (grub_hfsplus_mount): When reading out of disk,
	return `GRUB_ERR_BAD_FS'.
	* fs/sfs.c (grub_sfs_mount): Likewise.
	* fs/xfs.c (grub_xfs_mount): Likewise.

	* include/grub/disk.h (enum grub_disk_dev_id): Add
	`GRUB_DISK_DEVICE_HOST_ID'.

	* util/grub-emu.c (main): Initialize and de-initialize hostfs.
2007-08-02 17:24:06 +00:00
jerone
e5dfe7775a This patch is to introduce multiboot 2 loading capabilities to grub2
for powerpc & i386-pc. This patch was more so started by Hollis
Blanchard getting multiboot 2 working for powerpc and I added to it
and cleaned it up.

One of the ideas with this patch is to keep everything under one
command for the user. So instead of having a "multiboot2" & "module2"
command, I created a proxy like mechanism so that you have only one
command for both multiboot 1 & 2 ... "multiboot". This is where
"loader/multiboot_loader.c" comes from. I could have integrated things
more but I figure the current approach will less likely break
anything.

So if your OS is multiboot 2 capable, the user would do the following
to load it up from a grub prompt:

grub> multiboot <location of kernel> <kernel args>
grub> module <some image> <multiboot tag> <image arguments>
grub> module <isome mage> <multiboot tag> <image arguments>
grub .....


The other thing that this patch does is it begins to make the
multiboot 1 code a bit more architecture agnostic so IF someone wanted
to implement it on another architecture they can.

A bit of file moving around and definition renaming is also apart of
this patch. I have also taken the time to make sure that it does not
break multiboot 1 loading on i386-pc. But mulitboot 2 may still need a
little more testing and work for i386-pc. Powerpc multiboot 2 has been
heavily tested and does work.
2007-07-25 00:44:03 +00:00
robertmh
daf0f0ba3e 2007-07-22 Robert Millan <rmh@aybabtu.com>
* geninitheader.sh: Process file specified in first parameter rather
	than hardcoding grub_modules_init.lst.
	* geninit.sh: Likewise.  Also, construct header name dynamicaly rather
	than hardcoding grub_modules_init.h.

	* conf/common.rmk: Rename grub_modules_init.[ch] files associated with
	grub-emu to grub_emu_init.[ch].  Add rules to build analogous
	grub_probe_init.[ch] and grub_setup_init.[ch].

	* conf/powerpc-ieee1275.rmk (grub_emu_DEPENDENCIES): Replace
	grub_modules_init.h with grub_emu_init.h.
	(grub_probe_DEPENDENCIES, grub_probe_SOURCES): Add new
	grub_probe_init.[ch] files.
	* conf/i386-efi.rmk: Likewise.
	* conf/i386-pc.rmk: Likewise.
	(grub_setup_DEPENDENCIES, grub_setup_SOURCES): Add new
	grub_setup_init.[ch] files.

	* util/grub-emu.c: Replace grub_modules_init.h with grub_emu_init.h.
	* util/grub-probe.c: Include grub_probe_init.h.  Use grub_init_all()
	to initialize modules rather than a list of hardcoded functions.
	* util/i386/pc/grub-setup.c: Include grub_setup_init.h.  Use
	grub_init_all() to initialize modules rather than a list of hardcoded
	functions.
2007-07-22 19:17:27 +00:00
robertmh
54cdc1cc1c 2007-07-22 Robert Millan <rmh@aybabtu.com>
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Set
	GRUB_IEEE1275_FLAG_NO_PARTITION_0 flag when running on SmartFirmware.
2007-07-22 09:16:51 +00:00
robertmh
ad0686cc6d 2007-07-22 Robert Millan <rmh@aybabtu.com>
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): Add
	GRUB_IEEE1275_FLAG_BROKEN_OUTPUT flag.
	* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Set this
	flag when running on SmartFirmware.
	* term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid running
	"output-device output" command when GRUB_IEEE1275_FLAG_BROKEN_OUTPUT
	was set.

	* kern/powerpc/ieee1275/openfw.c (grub_ieee1275_encode_devname):
	Increase partno when GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS flag is set,
	rather than decreasing it.

	* util/i386/pc/grub-setup.c (setup): When embedding is required, but
	there's not enough space to do it, fail in the same way as when it
	can't be done because there are no partitions.

	* util/powerpc/ieee1275/grub-install.in: Improve error message shown
	when nvsetenv failed.
2007-07-22 09:05:11 +00:00
okuji
969c02ec31 2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
* conf/i386-pc.rmk (CLEANFILES): Removed for grub-mkrescue,
    because this rule is automatically generated.
    (grub-mkrescue): Removed for the same reason as above.
2007-07-21 23:34:57 +00:00
okuji
5a79f472c7 2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
Migrate to GNU General Public License Version 3.

    * COPYING: Replaced with the plain text version of GPLv3.

    * config.guess: Updated from gnulib.
    * config.sub: Likewise.

    * geninit.sh: Output a GPLv3 copyright notice.
    * geninitheader.sh: Likewise.
    * genmodsrc.sh: Likewise.
    * gensymlist.sh.in: Likewise.

    * boot/i386/pc/boot.S: Upgraded to GPLv3.
    * boot/i386/pc/diskboot.S: Likewise.
    * boot/i386/pc/pxeboot.S: Likewise.
    * commands/blocklist.c: Likewise.
    * commands/boot.c: Likewise.
    * commands/cat.c: Likewise.
    * commands/cmp.c: Likewise.
    * commands/configfile.c: Likewise.
    * commands/echo.c: Likewise.
    * commands/help.c: Likewise.
    * commands/ls.c: Likewise.
    * commands/search.c: Likewise.
    * commands/terminal.c: Likewise.
    * commands/test.c: Likewise.
    * commands/videotest.c: Likewise.
    * commands/i386/cpuid.c: Likewise.
    * commands/i386/pc/halt.c: Likewise.
    * commands/i386/pc/play.c: Likewise.
    * commands/i386/pc/reboot.c: Likewise.
    * commands/i386/pc/vbeinfo.c: Likewise.
    * commands/i386/pc/vbetest.c: Likewise.
    * commands/ieee1275/halt.c: Likewise.
    * commands/ieee1275/reboot.c: Likewise.
    * commands/ieee1275/suspend.c: Likewise.
    * disk/loopback.c: Likewise.
    * disk/lvm.c: Likewise.
    * disk/raid.c: Likewise.
    * disk/efi/efidisk.c: Likewise.
    * disk/i386/pc/biosdisk.c: Likewise.
    * disk/ieee1275/ofdisk.c: Likewise.
    * font/manager.c: Likewise.
    * fs/affs.c: Likewise.
    * fs/ext2.c: Likewise.
    * fs/fat.c: Likewise.
    * fs/fshelp.c: Likewise.
    * fs/hfs.c: Likewise.
    * fs/hfsplus.c: Likewise.
    * fs/iso9660.c: Likewise.
    * fs/jfs.c: Likewise.
    * fs/minix.c: Likewise.
    * fs/sfs.c: Likewise.
    * fs/ufs.c: Likewise.
    * fs/xfs.c: Likewise.
    * hello/hello.c: Likewise.
    * include/grub/acorn_filecore.h: Likewise.
    * include/grub/arg.h: Likewise.
    * include/grub/bitmap.h: Likewise.
    * include/grub/boot.h: Likewise.
    * include/grub/cache.h: Likewise.
    * include/grub/device.h: Likewise.
    * include/grub/disk.h: Likewise.
    * include/grub/dl.h: Likewise.
    * include/grub/elfload.h: Likewise.
    * include/grub/env.h: Likewise.
    * include/grub/err.h: Likewise.
    * include/grub/file.h: Likewise.
    * include/grub/font.h: Likewise.
    * include/grub/fs.h: Likewise.
    * include/grub/fshelp.h: Likewise.
    * include/grub/gzio.h: Likewise.
    * include/grub/hfs.h: Likewise.
    * include/grub/kernel.h: Likewise.
    * include/grub/loader.h: Likewise.
    * include/grub/lvm.h: Likewise.
    * include/grub/misc.h: Likewise.
    * include/grub/mm.h: Likewise.
    * include/grub/net.h: Likewise.
    * include/grub/normal.h: Likewise.
    * include/grub/parser.h: Likewise.
    * include/grub/partition.h: Likewise.
    * include/grub/pc_partition.h: Likewise.
    * include/grub/raid.h: Likewise.
    * include/grub/rescue.h: Likewise.
    * include/grub/script.h: Likewise.
    * include/grub/setjmp.h: Likewise.
    * include/grub/symbol.h: Likewise.
    * include/grub/term.h: Likewise.
    * include/grub/terminfo.h: Likewise.
    * include/grub/tparm.h: Likewise.
    * include/grub/types.h: Likewise.
    * include/grub/video.h: Likewise.
    * include/grub/efi/api.h: Likewise.
    * include/grub/efi/chainloader.h: Likewise.
    * include/grub/efi/console.h: Likewise.
    * include/grub/efi/console_control.h: Likewise.
    * include/grub/efi/disk.h: Likewise.
    * include/grub/efi/efi.h: Likewise.
    * include/grub/efi/pe32.h: Likewise.
    * include/grub/efi/time.h: Likewise.
    * include/grub/i386/linux.h: Likewise.
    * include/grub/i386/setjmp.h: Likewise.
    * include/grub/i386/types.h: Likewise.
    * include/grub/i386/efi/kernel.h: Likewise.
    * include/grub/i386/efi/loader.h: Likewise.
    * include/grub/i386/efi/time.h: Likewise.
    * include/grub/i386/pc/biosdisk.h: Likewise.
    * include/grub/i386/pc/boot.h: Likewise.
    * include/grub/i386/pc/chainloader.h: Likewise.
    * include/grub/i386/pc/console.h: Likewise.
    * include/grub/i386/pc/init.h: Likewise.
    * include/grub/i386/pc/kernel.h: Likewise.
    * include/grub/i386/pc/loader.h: Likewise.
    * include/grub/i386/pc/memory.h: Likewise.
    * include/grub/i386/pc/multiboot.h: Likewise.
    * include/grub/i386/pc/serial.h: Likewise.
    * include/grub/i386/pc/time.h: Likewise.
    * include/grub/i386/pc/vbe.h: Likewise.
    * include/grub/i386/pc/vbeblit.h: Likewise.
    * include/grub/i386/pc/vbefill.h: Likewise.
    * include/grub/i386/pc/vbeutil.h: Likewise.
    * include/grub/i386/pc/vga.h: Likewise.
    * include/grub/ieee1275/ieee1275.h: Likewise.
    * include/grub/ieee1275/ofdisk.h: Likewise.
    * include/grub/powerpc/libgcc.h: Likewise.
    * include/grub/powerpc/setjmp.h: Likewise.
    * include/grub/powerpc/types.h: Likewise.
    * include/grub/powerpc/ieee1275/biosdisk.h: Likewise.
    * include/grub/powerpc/ieee1275/console.h: Likewise.
    * include/grub/powerpc/ieee1275/ieee1275.h: Likewise.
    * include/grub/powerpc/ieee1275/kernel.h: Likewise.
    * include/grub/powerpc/ieee1275/loader.h: Likewise.
    * include/grub/powerpc/ieee1275/multiboot.h: Likewise.
    * include/grub/powerpc/ieee1275/time.h: Likewise.
    * include/grub/powerpc/ieee1275/util/biosdisk.h: Likewise.
    * include/grub/sparc64/libgcc.h: Likewise.
    * include/grub/sparc64/setjmp.h: Likewise.
    * include/grub/sparc64/types.h: Likewise.
    * include/grub/sparc64/ieee1275/console.h: Likewise.
    * include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
    * include/grub/sparc64/ieee1275/kernel.h: Likewise.
    * include/grub/sparc64/ieee1275/time.h: Likewise.
    * include/grub/util/biosdisk.h: Likewise.
    * include/grub/util/getroot.h: Likewise.
    * include/grub/util/lvm.h: Likewise.
    * include/grub/util/misc.h: Likewise.
    * include/grub/util/raid.h: Likewise.
    * include/grub/util/resolve.h: Likewise.
    * io/gzio.c: Likewise.
    * kern/device.c: Likewise.
    * kern/disk.c: Likewise.
    * kern/dl.c: Likewise.
    * kern/elf.c: Likewise.
    * kern/env.c: Likewise.
    * kern/err.c: Likewise.
    * kern/file.c: Likewise.
    * kern/fs.c: Likewise.
    * kern/loader.c: Likewise.
    * kern/main.c: Likewise.
    * kern/misc.c: Likewise.
    * kern/mm.c: Likewise.
    * kern/parser.c: Likewise.
    * kern/partition.c: Likewise.
    * kern/rescue.c: Likewise.
    * kern/term.c: Likewise.
    * kern/efi/efi.c: Likewise.
    * kern/efi/init.c: Likewise.
    * kern/efi/mm.c: Likewise.
    * kern/i386/dl.c: Likewise.
    * kern/i386/efi/init.c: Likewise.
    * kern/i386/efi/startup.S: Likewise.
    * kern/i386/pc/init.c: Likewise.
    * kern/i386/pc/lzo1x.S: Likewise.
    * kern/i386/pc/startup.S: Likewise.
    * kern/ieee1275/ieee1275.c: Likewise.
    * kern/powerpc/cache.S: Likewise.
    * kern/powerpc/dl.c: Likewise.
    * kern/powerpc/ieee1275/cmain.c: Likewise.
    * kern/powerpc/ieee1275/crt0.S: Likewise.
    * kern/powerpc/ieee1275/init.c: Likewise.
    * kern/powerpc/ieee1275/openfw.c: Likewise.
    * kern/sparc64/cache.S: Likewise.
    * kern/sparc64/dl.c: Likewise.
    * kern/sparc64/ieee1275/init.c: Likewise.
    * kern/sparc64/ieee1275/openfw.c: Likewise.
    * loader/efi/chainloader.c: Likewise.
    * loader/efi/chainloader_normal.c: Likewise.
    * loader/i386/efi/linux.c: Likewise.
    * loader/i386/efi/linux_normal.c: Likewise.
    * loader/i386/pc/chainloader.c: Likewise.
    * loader/i386/pc/chainloader_normal.c: Likewise.
    * loader/i386/pc/linux.c: Likewise.
    * loader/i386/pc/linux_normal.c: Likewise.
    * loader/i386/pc/multiboot.c: Likewise.
    * loader/i386/pc/multiboot_normal.c: Likewise.
    * loader/powerpc/ieee1275/linux.c: Likewise.
    * loader/powerpc/ieee1275/linux_normal.c: Likewise.
    * normal/arg.c: Likewise.
    * normal/cmdline.c: Likewise.
    * normal/command.c: Likewise.
    * normal/completion.c: Likewise.
    * normal/execute.c: Likewise.
    * normal/function.c: Likewise.
    * normal/lexer.c: Likewise.
    * normal/main.c: Likewise.
    * normal/menu.c: Likewise.
    * normal/menu_entry.c: Likewise.
    * normal/misc.c: Likewise.
    * normal/parser.y: Likewise.
    * normal/script.c: Likewise.
    * normal/i386/setjmp.S: Likewise.
    * normal/powerpc/setjmp.S: Likewise.
    * normal/sparc64/setjmp.S: Likewise.
    * partmap/acorn.c: Likewise.
    * partmap/amiga.c: Likewise.
    * partmap/apple.c: Likewise.
    * partmap/gpt.c: Likewise.
    * partmap/pc.c: Likewise.
    * partmap/sun.c: Likewise.
    * term/gfxterm.c: Likewise.
    * term/terminfo.c: Likewise.
    * term/efi/console.c: Likewise.
    * term/i386/pc/console.c: Likewise.
    * term/i386/pc/serial.c: Likewise.
    * term/i386/pc/vesafb.c: Likewise.
    * term/i386/pc/vga.c: Likewise.
    * term/ieee1275/ofconsole.c: Likewise.
    * util/biosdisk.c: Likewise.
    * util/console.c: Likewise.
    * util/genmoddep.c: Likewise.
    * util/getroot.c: Likewise.
    * util/grub-emu.c: Likewise.
    * util/grub-mkdevicemap.c: Likewise.
    * util/grub-probe.c: Likewise.
    * util/lvm.c: Likewise.
    * util/misc.c: Likewise.
    * util/raid.c: Likewise.
    * util/resolve.c: Likewise.
    * util/update-grub.in: Likewise.
    * util/update-grub_lib.in: Likewise.
    * util/grub.d/00_header.in: Likewise.
    * util/grub.d/10_hurd.in: Likewise.
    * util/grub.d/10_linux.in: Likewise.
    * util/i386/efi/grub-install.in: Likewise.
    * util/i386/efi/grub-mkimage.c: Likewise.
    * util/i386/pc/grub-install.in: Likewise.
    * util/i386/pc/grub-mkimage.c: Likewise.
    * util/i386/pc/grub-mkrescue.in: Likewise.
    * util/i386/pc/grub-setup.c: Likewise.
    * util/i386/pc/misc.c: Likewise.
    * util/powerpc/ieee1275/grub-install.in: Likewise.
    * util/powerpc/ieee1275/grub-mkimage.c: Likewise.
    * util/powerpc/ieee1275/misc.c: Likewise.
    * video/bitmap.c: Likewise.
    * video/video.c: Likewise.
    * video/i386/pc/vbe.c: Likewise.
    * video/i386/pc/vbeblit.c: Likewise.
    * video/i386/pc/vbefill.c: Likewise.
    * video/i386/pc/vbeutil.c: Likewise.
    * video/readers/tga.c: Likewise.
2007-07-21 23:32:33 +00:00
robertmh
3572d015fd 2007-07-02 Robert Millan <rmh@aybabtu.com>
* conf/i386-efi.rmk: Replace obsolete reference to
	util/i386/pc/biosdisk.c with util/biosdisk.c, and util/i386/pc/getroot.c
	with util/getroot.c.
	* conf/powerpc-ieee1275.rmk: Likewise.
	* conf/sparc64-ieee1275.rmk: Likewise.

	* util/grub-emu.c (main): Fix unchecked pointer handling.
2007-07-02 20:38:01 +00:00
robertmh
2c2a681b39 2007-07-02 Robert Millan <rmh@aybabtu.com>
* util/i386/efi/grub-install.in: Allow `grub_probe --target=partmap'
	invocation to fail, in order to support partition-less media.

	* util/i386/pc/grub-install.in: Likewise.

	* util/powerpc/ieee1275/grub-install.in: Use grub-probe to determine
	which fs or partmap modules are needed (akin to its sister scripts).

	Also use grub-probe to get rid of unportable /proc/mounts check.

	Print the same informational message that the other scripts do, before
	exitting.
2007-07-02 13:58:03 +00:00
robertmh
6193defe9f 2007-06-23 Robert Millan <rmh@aybabtu.com>
* util/update-grub_lib.in (font_path): New function.  Determine wether
	a font file can be found and, if so, echo the GRUB path to it.

	* util/update-grub.in: Handle multiple terminals depending on user
	input, platform availability and font file presence.  Propagate
	variables of our findings to /etc/grub.d/ children.

	* util/grub.d/00_header.in: Handle multiple terminals, based on
	environment setup by update-grub.
2007-06-23 19:34:57 +00:00
robertmh
ba50d28f33 Fix syntax error. 2007-06-23 17:40:42 +00:00
robertmh
eface1dc8a 2007-06-23 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk: (pkgdata_MODULES): Add serial.mod.
2007-06-23 14:44:37 +00:00
robertmh
bf697e2831 2007-06-21 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/pc/kernel.h: Define GRUB_KERNEL_MACHINE_DATA_END to
	indicate end of data section in kernel image.
	* include/grub/i386/efi/kernel.h: Define GRUB_KERNEL_MACHINE_PREFIX and
	GRUB_KERNEL_MACHINE_DATA_END.

	* kern/i386/pc/startup.S: Do not initialize grub_prefix, only reserve
	space for it.
	* kern/i386/efi/startup.S: Likewise.

	* util/i386/pc/grub-mkimage.c: Initialize grub_prefix to /boot/grub
	during image generation.  Implement --prefix option to override this
	patch.
	* util/i386/efi/grub-mkimage.c: Likewise.

	* util/update-grub_lib.in (convert_system_path_to_grub_path): Split
	code to make path relative to its root into a separate function.

	* util/i386/pc/grub-install.in: Use newly provided
	make_system_path_relative_to_its_root() to convert ${grubdir}, then
	pass the result to grub-install --prefix.
2007-06-21 21:01:11 +00:00
robertmh
baa574b487 2007-06-13 Robert Millan <rmh@aybabtu.com>
* include/grub/util/misc.h: Define DEFAULT_DIRECTORY and
	DEFAULT_DEVICE_MAP.
	* util/grub-emu.c: Use above definitions from misc.h instead of
	defining them.
	* util/grub-mkdevicemap.c: Likewise.
	* util/i386/pc/grub-setup.c: Likewise.
	* util/grub-probe.c: Likewise.
	(probe): Abort with grub_util_error() when either
	grub_guess_root_device or grub_util_get_grub_dev fails.
2007-06-13 16:53:54 +00:00
robertmh
0215dcbfdc 2007-06-12 Robert Millan <rmh@aybabtu.com>
* normal/command.c (grub_command_execute): Use NULL rather than 0 for
	"pager" assignment.
	* util/biosdisk.c (grub_util_biosdisk_get_grub_dev): Likewise for
	"pcdata".
	* util/grub-probe.c (probe): Likewise for "drive_name".
2007-06-12 14:23:12 +00:00
robertmh
8af2ab7bad 2007-06-11 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-mkrescue.in: Pad both floppy images with zeroes,
	not just the cdrom one.
2007-06-11 20:01:09 +00:00
robertmh
59d31694f2 2007-06-11 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-mkrescue.in: Add "set -e".
	Add --pkglibdir=DIR option to override pkglibdir.
	Mention --image-type=TYPE in help output.
	Fix --grub-mkimage (it was a no-op).
	Abort gracefuly when no parameter is given.
2007-06-11 19:22:27 +00:00
robertmh
7ee367e49b 2007-06-11 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-mkrescue.in: New file.
	* conf/i386-pc.rmk: Add its build declarations.  Put it in bin_SCRIPTS.
	* Makefile.in: Handle bin_SCRIPTS.
2007-06-11 06:26:18 +00:00
chaac
29b0ed4617 2007-06-10 Vesa Jaaskelainen <chaac@nic.fi>
* term/gfxterm.c (grub_gfxterm_init): Added support for specifying
        list of video modes.
2007-06-10 17:31:03 +00:00
robertmh
c0f90770b8 2007-06-06 Robert Millan <rmh@aybabtu.com>
* util/update-grub_lib.in (convert_system_path_to_grub_path): Abort if
	file doesn't exist, or if it is in a filesystem grub can't read.

	* util/update-grub.in: Set fallback for GRUB_FS check to "unknown".  Do
	not abort if GRUB_DRIVE could not be defined.  Rearrange generated
	header comment to fit in 80 columns when the variables are resolved.

	* util/grub.d/00_header.in: Only set root variable when GRUB_DRIVE
	could be identified by update-grub.  Remove redundant check for
	unifont.pff existance (since convert_system_path_to_grub_path now
	handles that).
2007-06-06 18:08:56 +00:00
robertmh
fb36dc2693 2007-06-04 Robert Millan <rmh@aybabtu.com>
* conf/i386-efi.rmk (grub_probe_SOURCES): Add partmap/apple.c.

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

	* conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add partmap/pc.c.
2007-06-04 19:48:53 +00:00
robertmh
0c68c93e62 2007-06-04 Robert Millan <rmh@aybabtu.com>
* conf/powerpc-ieee1275.rmk: Enable grub-mkdevicemap and grub-probe.

	* include/grub/partition.h: Declare grub_apple_partition_map_init and
	grub_apple_partition_map_fini.

	* util/biosdisk.c
	(grub_util_biosdisk_open): Replace BLKGETSIZE with BLKGETSIZE64 (needed
	to access >2 TiB disks).

	Print disk->total_sectors with %llu instead of %lu, since this
	variable is always 64-bit (prevents wrong disk size from being displayed
	on either >2 TiB disk or big-endian CPU).

	(grub_util_biosdisk_get_grub_dev): Convert gpt_partition_map handling
	into a generic case that supports all (sane) partition maps.

	Stop using grub_cpu_to_le32() on dos_part / bsd_part since it actually
	breaks big-endian.

	* util/grub-probe.c: Call grub_apple_partition_map_init() before probe()
	and grub_apple_partition_map_fini() after that.
2007-06-04 18:58:17 +00:00
robertmh
0f23eb7460 2007-06-01 Robert Millan <rmh@aybabtu.com>
* util/update-grub.in: Export GRUB_CMDLINE_LINUX.

	* util/grub.d/00_header.in: Only enable gfxterm when
	convert_system_path_to_grub_path() succeeds.
2007-06-01 15:21:20 +00:00
robertmh
42c71976c6 2007-05-20 Robert Millan <rmh@aybabtu.com>
* util/update-grub_lib.in: New file.
	* DISTLIST: Add update-grub_lib.in.
	* conf/common.rmk: Generate update-grub_lib and install it in
	$(lib_DATA).
	* Makefile.in: Add install routine for $(lib_DATA).

	* util/grub.d/00_header.in: Use convert_system_path_to_grub_path()
	function provided by update-grub_lib to support arbitrary paths of
	unifont.pff.
	* util/update-grub.in: Use convert_system_path_to_grub_path() to
	initialize GRUB_DRIVE_BOOT and GRUB_DRIVE_BOOT_GRUB variables.
2007-05-20 09:10:06 +00:00
robertmh
5beb22914d 2007-05-19 Robert Millan <rmh@aybabtu.com>
* commands/i386/cpuid.c: New module.
	* DISTLIST: Add it.
	* conf/i386-efi.rmk: Enable cpuid.mod.
	* conf/i386-pc.rmk: Likewise.
2007-05-20 07:20:43 +00:00
jeroen
7262eca1e3 2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
* kern/disk.c (grub_disk_read): Check return value of
	grub_realloc().
2007-05-18 21:40:06 +00:00
jeroen
260ba823e6 2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
* util/getroot.c (grub_util_get_grub_dev): Support partitionable
	arrays.
	* disk/raid.c (grub_raid_open): Likewise.
2007-05-17 23:23:03 +00:00
jeroen
1ecb6cf2b4 2007-05-17 Jeroen Dekkers <jeroen@dekkers.cx>
* util/biosdisk.c (linux_find_partition): Allocate real_dev on the
	stack instead of on the heap.

	* kern/disk.c (grub_disk_read): Make sure tmp_buf is big enough
	before doing a read on it.

	* configure.ac: Only use -fno-stack-protector for the target
	environment.
2007-05-17 19:03:42 +00:00
jeroen
21c8cbb1ab 2007-05-17 Jeroen Dekkers <jeroen@dekkers.cx>
* video/i386/pc/vbe.c (grub_video_vbe_create_render_target): Add
	__attribute_ ((unused)) to mode_type argument.

	* util/getroot.c (grub_guess_root_device): Fix #endif.

	* kern/misc.c (memcmp): Fix prototype.

	* include/grub/partition.h [GRUB_UTIL]
	(grub_gpt_partition_map_init): Add prototype.
	(grub_gpt_partition_map_fini): Likewise.

	* fs/jfs.c (struct grub_jfs_inode): Put __attribute__ ((packed)
	at the right place.

	* fs/fat.c (grub_fat_mount): Replace ~0UL with ~0U.
	(grub_fat_read_data): Likewise.
	(grub_fat_find_dir): Likewise.

	* font/manager.c (find_glyph): Make table a const.
	(grub_font_get_glyph): Remove bitmap from if statement.
2007-05-17 15:43:32 +00:00
jeroen
849d55d3d1 2007-05-16 Jeroen Dekkers <jeroen@dekkers.cx>
* util/getroot.c (grub_guess_root_device): Remove RAID and LVM
	code, first search for device in /dev/mapper, then in /dev.
	(grub_util_get_grub_dev): New function.
	* include/grub/util/getroot.h (grub_util_get_grub_dev): Add
	prototype.
	* util/grub-probe.c (probe): Remove check for RAID, call
	grub_util_get_grub_dev() instead of
	grub_util_biosdisk_get_grub_dev().
	* util/grub-emu.c (main): Call grub_util_get_grub_dev() instead of
	grub_util_biosdisk_get_grub_dev().
	* util/i386/pc/grub-setup.c (main): Likewise.
2007-05-16 21:38:44 +00:00
robertmh
8fff7c2f2a 2007-05-16 Robert Millan <rmh@aybabtu.com>
* DISTLIST: Update for the latest changes.
	* conf/i386-pc.rmk: Use the new paths for util/getroot.c,
	util/grub-mkdevicemap.c, util/grub-probe.c and util/biosdisk.c.
	* util/grub-emu.c: Replace grub/i386/pc/util/biosdisk.h with
	grub/util/biosdisk.h.
	* util/i386/pc/grub-setup.c: Replace grub/machine/util/biosdisk.h with
	grub/util/biosdisk.h.
2007-05-16 15:19:38 +00:00
robertmh
48e12b52d3 2007-05-16 Robert Millan <rmh@aybabtu.com>
* util/grub.d/00_header.in: Set default gfxmode to `640x480'.
2007-05-16 15:06:45 +00:00
robertmh
46b9d12846 2007-05-16 Robert Millan <rmh@aybabtu.com>
* util/i386/efi/grub-install.in: New.
	* conf/i386-efi.rmk: Enable grub-mkdevicemap, grub-probe and the
	newly added grub-install.
	* util/biosdisk.c: Remove unnecessary grub/machine/biosdisk.h
	include.
	* util/getroot.c: Replace grub/i386/pc/util/biosdisk.h with
	grub/util/biosdisk.h.
	* util/grub-probe.c: Replace grub/machine/util/biosdisk.h with
	grub/util/biosdisk.h.
2007-05-16 15:05:02 +00:00
robertmh
2d1a40a90c 2007-05-16 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/pc/util/biosdisk.h: Moved to ...
	* include/grub/util/biosdisk.h: ... here.
	* util/i386/pc/biosdisk.c: Moved to ...
	* util/biosdisk.c: ... here.
	* util/i386/pc/getroot.c: Moved to ...
	* util/getroot.c: ... here.
	* util/i386/pc/grub-mkdevicemap.c: Moved to ...
	* util/grub-mkdevicemap.c: ... here.
	* util/i386/pc/grub-probe.c: Moved to ...
	* util/grub-probe.c: ... here.
2007-05-16 14:54:08 +00:00
robertmh
9e26e3bc68 2007-05-15 Robert Millan <rmh@aybabtu.com>
* util/update-grub.in: Remove duplicated line in grub.cfg header
	message.
2007-05-15 19:25:56 +00:00
robertmh
57f9639766 2007-05-13 Robert Millan <rmh@aybabtu.com>
* util/update-grub.in: Fix a few assumptions about the devices holding
	/, /boot and /boot/grub being the same.
	* util/grub.d/00_header.in: Likewise.
	* util/grub.d/10_hurd.in: Likewise.
	* util/grub.d/10_linux.in: Likewise.

	* util/grub.d/10_linux.in: Implement Linux image sorting with arbitrary
	patterns.  Use that to define the `.old' suffix as older than `'.

	* util/grub.d/00_header.in: Set default gfxmode to `800x600x16'.

	* util/update-grub.in: Add a reference to ${sysconfdir}/default/grub in
	the grub.cfg header message.
2007-05-13 19:28:54 +00:00
robertmh
2e610d6273 2007-05-11 Robert Millan <rmh@aybabtu.com>
* util/update-grub.in: Create device.map if it doesn't already exist,
	before attempting to run grub-probe.
	Check for grub-probe and grub-mkdevicemap with the same code
	grub-install is using.
	Remove test mode.
2007-05-11 15:53:02 +00:00
jeroen
3f6a10ef11 2007-05-09 Jeroen Dekkers <jeroen@dekkers.cx>
* Makefile.in: Add the datarootdir autoconf variable.
2007-05-09 21:24:33 +00:00
robertmh
02e7b75ee8 2007-05-09 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-probe.c (probe): When detecting partition map,
        fail gracefuly if dev->disk->partition == NULL.
2007-05-09 15:09:41 +00:00
robertmh
75f396ccfa 2007-05-07 Robert Millan <rmh@aybabtu.com>
* util/i386/pc/grub-probe.c: Add `grub-probe -t partmap' parameter to
	determine partition map module.
	* util/i386/pc/grub-install.in: Use this feature to decide which
	partition module to load, instead of hardcoding pc and gpt.
2007-05-07 19:54:46 +00:00
robertmh
da65cb3645 2007-05-07 Robert Millan <rmh@aybabtu.com>
* Makefile.in: Fix assumption that $(srcdir) has a trailing slash when
	source directory differs from build directory.
2007-05-07 09:25:23 +00:00
robertmh
b57d6a91c6 2007-05-05 Robert Millan <rmh@aybabtu.com>
* util/powerpc/ieee1275/grub-install.in: Fix syntax error in pkglibdir
	initialisation.
2007-05-05 11:55:20 +00:00
robertmh
509d00f1cc 2007-05-05 Robert Millan <rmh@aybabtu.com>
* util/update-grub.in: Create ${grub_prefix} if it doesn't exist.
2007-05-05 10:57:51 +00:00
robertmh
c48f23ef4b 2007-05-05 Robert Millan <rmh@aybabtu.com>
* util/grub.d/10_linux.in: Allow the administrator to insert Linux
	command-line arguments via ${GRUB_CMDLINE_LINUX}.
2007-05-05 10:34:05 +00:00
robertmh
20b976586e 2007-05-05 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (grub_setup_SOURCES): Add partmap/gpt.c.
	(grub_probe_SOURCES): Likewise.
	* util/i386/pc/biosdisk.c (grub_util_biosdisk_get_grub_dev): Detect
	GPT and initialize dos_part and bsd_part accordingly.
	* util/i386/pc/grub-setup.c (setup): Ditto for install_dos_part and
	install_bsd_part.
	(main): Activate gpt module for use during partition identification,
	and deactivate it afterwards.
	* util/i386/pc/grub-install.in: Add gpt module to core.img.
	* util/i386/pc/grub-probe.c (main): Activate gpt module for use during
	partition identification, and deactivate it afterwards.
2007-05-04 23:00:56 +00:00
robertmh
99123174c9 2007-05-05 Robert Millan <rmh@aybabtu.com>
* term/i386/pc/console.c (grub_console_fini): Call
	grub_term_set_current() before grub_term_unregister().
2007-05-04 22:28:31 +00:00
robertmh
ebd97f6e46 2007-05-04 Robert Millan <rmh@aybabtu.com>
* DISTLIST: Add util/update-grub.in, util/grub.d/00_header.in,
	util/grub.d/10_hurd.in, util/grub.d/10_linux.in and util/grub.d/README.
	* Makefile.in: Build update-grub_SCRIPTS.  Install update-grub_SCRIPTS
	and update-grub_DATA.
	* conf/common.rmk: Build and install update-grub components.
	* conf/common.mk: Regenerate.
	* util/update-grub.in: New.  Core of update-grub.
	* util/grub.d/00_header.in: New.  Generates grub.cfg header.
	* util/grub.d/10_hurd.in: New.  Generates boot entries for the Hurd.
	* util/grub.d/10_linux.in: New.  Generates boot entries for Linux.
	* util/grub.d/README: New.  Document grub.d directory layout.
2007-05-04 07:11:44 +00:00
robertmh
b06a264da4 2007-05-01 Robert Millan <rmh@aybabtu.com>
* util/grub-emu.c: Move initialization functions
	grub_util_biosdisk_init() and grub_init_all() before
	grub_util_biosdisk_get_grub_dev(), which relies on them.
2007-04-30 22:22:24 +00:00
robertmh
41f0050ea9 2007-04-19 Robert Millan <rmh@aybabtu.com>
* util/powerpc/ieee1275/grub-install.in: Initialize ${bindir}, since
	it is used later.
2007-04-19 12:24:47 +00:00
jerone
04582bb3bb Add missing parenthesis for conditional statement stanza. 2007-04-18 22:59:52 +00:00
jerone
49892fdf50 Add newline in change log. Where was missed before checked in. 2007-04-10 22:03:15 +00:00
jerone
08db463226 Fixes the situation with i386-pc where grub-probe & grub-setup are searching
for the root fs for grub files  and they happen to be on the same file system
as the root ("/") filesystem.
2007-04-10 22:00:24 +00:00
jerone
801b76be69 Add single extra space between name and email address in ChangeLog. 2007-04-10 21:49:47 +00:00
jerone
1d543c3ec0 Add the ability to transform Grub program names. For example, a user can easily launch
./configure --program-transform-name="s/grub/grub2/"

And the installed files (in this case for i386-pc) will be:

/usr/lib/grub2/i386-pc/*
/usr/local/sbin/grub2-emu
/usr/local/sbin/grub2-install
...etc

Also grub2-install place boot files in "/boot/grub2"

This allows easy integration into distributions as it allows grub2 to
sit side by side with a grub legacy install without.
2007-04-10 21:38:26 +00:00
okuji
6795c4e10b 2007-03-19 Yoshinori K. Okuji <okuji@enbug.org>
* fs/ext2.c (EXT2_GOOD_OLD_REVISION): New macro.
    (EXT2_GOOD_OLD_INODE_SIZE): Likewise.
    (EXT2_REVISION): Likewise.
    (EXT2_INODE_SIZE): Likewise.
    (struct grub_ext2_block_group): Added a missing member
    "used_dirs".
    (grub_ext2_read_inode): Divide by the inode size in a superblock
    instead of 128 to obtain INODES_PER_BLOCK.
    Use the macro EXT2_INODE_SIZE instead of directly using
    SBLOCK->INODE_SIZE.
2007-03-19 00:04:29 +00:00
okuji
d70af616c2 2007-03-18 Yoshinori K. Okuji <okuji@enbug.org>
* fs/ext2.c (grub_ext2_read_inode): Use the inode size in a
    superblock instead of the structure size to compute an
    offset. This fixes the problem that GRUB could not read a
    filesystem when inode size is different from 128-byte.
2007-03-18 01:18:39 +00:00
marco_g
3b801603d5 2007-03-05 Marco Gerards <marco@gnu.org>
* normal/main.c (read_config_file): When "menu" is not set, create
	an initial context.
2007-03-05 20:32:43 +00:00
hollisb
4785bfe460 2007-02-21 Hollis Blanchard <hollis@penguinppc.org>
* kern/powerpc/ieee1275/init.c (HEAP_SIZE): Removed.
	(HEAP_LIMIT): New macro.
	(grub_claim_heap): Claim memory up to `heaplimit'.
2007-02-21 23:25:09 +00:00
hollisb
a0cbb02386 2007-02-21 Hollis Blanchard <hollis@penguinppc.org>
* conf/powerpc-ieee1275.rmk (kernel_elf_LDFLAGS): Link at 64KB.
	* kern/powerpc/ieee1275/init.c (_end): Add declaration.
	(_start): Likewise.
	(grub_arch_modules_addr): Return address after `_end'.
	* util/powerpc/ieee1275/grub-mkimage.c: Include grub/misc.h.
	(load_modules): Use new parameter as `p_paddr' and `p_vaddr'.
	(add_segments): Calculate `_end' from phdr size and location.
	(ALIGN_UP): Moved to ...
	* include/grub/misc.h: here.
	* include/grub/powerpc/ieee1275/kernel.h (GRUB_IEEE1275_MOD_ALIGN):
	New macro.
	(GRUB_IEEE1275_MODULE_BASE): Removed.
2007-02-21 23:22:20 +00:00
hollisb
fd7d8ebae4 2007-02-20 Hollis Blanchard <hollis@penguinppc.org>
* kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Correct
	loop boundary.
2007-02-20 22:48:27 +00:00
hollisb
9b09e6fca0 2007-02-20 Hollis Blanchard <hollis@penguinppc.org>
* include/grub/elfload.h (grub_elf32_load_hook_t): Return grub_err_t.
	All users updated.
	(grub_elf64_load_hook_t): Likewise.
	* kern/elf.c: Call `grub_error_push' before `grub_error'. Improve
	debug output.
2007-02-20 22:46:12 +00:00
hollisb
3ce27299eb 2007-02-20 Hollis Blanchard <hollis@penguinppc.org>
* kern/mm.c: Update copyright.
	(grub_mm_debug): Correct syntax error.
	(grub_mm_dump_free): New function.
	(grub_debug_free): Call `grub_free'.
	* include/grub/mm.h: Update copyright.
	(grub_mm_dump_free): Add declaration.
2007-02-20 22:39:57 +00:00
hollisb
077d5fee0a 2007-02-12 Hollis Blanchard <hollis@penguinppc.org>
* include/grub/ieee1275/ieee1275.h: Update copyright.
	* kern/powerpc/ieee1275/init.c: Likewise.
	* kern/powerpc/ieee1275/openfw.c: Likewise.

	* loader/powerpc/ieee1275/linux.c: Likewise.
	* include/grub/elfload.h: Likewise.
	* kern/elf.c: Likewise.
	(grub_elf32_load): Pass `base' and `size' parameters.  Update all
	callers.
	(grub_elf64_load): Likewise.
	(grub_elf32_load_segment): Move to a nested function.
	(grub_elf64_load_segment): Likewise.
2007-02-13 03:49:43 +00:00
hollisb
dc94685009 2007-02-12 Hollis Blanchard <hollis@penguinppc.org>
* include/grub/ieee1275/ieee1275.h (grub_available_iterate): New
	prototype.
	* kern/powerpc/ieee1275/init.c (grub_heap_start): Removed.
	(grub_heap_len): Likewise.
	(HEAP_SIZE): New macro.
	(grub_claim_heap): New function.
	(grub_machine_init): Don't claim heap directly.  Call
	`grub_claim_heap'.
	* kern/powerpc/ieee1275/openfw.c: Include alloca.h.
	(grub_available_iterate): New function.
2007-02-13 03:20:16 +00:00
tschwinge
baa2a121e0 2007-02-03 Thomas Schwinge <tschwinge@gnu.org>
* aclocal.m4 (grub_CHECK_STACK_PROTECTOR): New definition.
	* configure.ac: Use it for testing the HOST and TARGET compilers.
2007-02-03 11:36:13 +00:00
tschwinge
4fe9862ebb 2006-12-13 Thomas Schwinge <tschwinge@gnu.org>
* Makefile.in (enable_grub_emu): New variable.
	* configure.ac (--enable-grub-emu): New option.
	Do the checks for (n)curses only if `--enable-grub-emu' is requested.
	* conf/i386-efi.rmk (sbin_UTILITIES): Add `grub-emu' only if requested.
	* conf/i386-pc.rmk: Likewise.
	* conf/powerpc-ieee1275.rmk: Likewise.
	* conf/sparc64-ieee1275.rmk (bin_UTILITIES): Likewise.
2006-12-13 22:30:19 +00:00