Commit Graph

65 Commits

Author SHA1 Message Date
okuji b977bf01b3 2006-05-29 Yoshinori K. Okuji <okuji@enbug.org>
* util/powerpc/ieee1275/grub-install.in (host_cpu): Removed.
        (target_cpu): New variable.
        (pkglibdir): Use target_cpu instead of host_cpu.

        * util/i386/pc/grub-install.in (host_cpu): Removed.
        (target_cpu): New variable.
        (pkglibdir): Use target_cpu instead of host_cpu.

        * util/genmoddep.c: Removed.

        * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P
        instead of GRUB_HOST_SIZEOF_VOID_P.
        * kern/dl.c: Likewise.

        * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to
        ...
        (GRUB_TARGET_SIZEOF_VOID_P): ... this.
        (GRUB_HOST_SIZEOF_LONG): Renamed to ...
        (GRUB_TARGET_SIZEOF_LONG): ... this.
        (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
        (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
        * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
        to ...
        (GRUB_TARGET_SIZEOF_VOID_P): ... this.
        (GRUB_HOST_SIZEOF_LONG): Renamed to ...
        (GRUB_TARGET_SIZEOF_LONG): ... this.
        (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
        (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
        * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
        to ...
        (GRUB_TARGET_SIZEOF_VOID_P): ... this.
        (GRUB_HOST_SIZEOF_LONG): Renamed to ...
        (GRUB_TARGET_SIZEOF_LONG): ... this.
        (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
        (GRUB_TARGET_WORDS_BIGENDIAN): ... this.

        * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use
        GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P.
        [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG
        instead of GRUB_HOST_SIZEOF_LONG.
        [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of
        GRUB_HOST_WORDS_BIGENDIAN to define or undefine
        GRUB_CPU_WORDS_BIGENDIAN.
        Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to
        define grub_host_addr_t, grub_host_off_t, grub_host_size_t and
        grub_host_ssize_t.

        * conf/i386-efi.rmk (noinst_UTILITIES): Removed.
        (genmoddep_SOURCES): Likewise.
        * conf/i386-pc.rmk (noinst_UTILITIES): Likewise.
        (genmoddep_SOURCES): Likewise.
        * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise.
        (genmoddep_SOURCES): Likewise.
        * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES):
        Likewise.
        (genmoddep_SOURCES): Likewise.

        * genmoddep.awk: New file.

        * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS,
        TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC,
        CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively.
        (PModule::rule): Likewise.
        (Program::rule): Likewise.
        (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of
        BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS,
        respectively.

        * configure.ac: Rewritten intensively to use host and target
        instead of build and host, respectively.

        * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu.
        (host_cpu): Removed.
        (target_cpu): New variable.
        (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\".
        (BUILD_CC): Removed.
        (BUILD_CFLAGS): Likewise.
        (BUILD_CPPFLAGS): Likewise.
        (TARGET_CC): New variable.
        (TARGET_CFLAGS): Likewise.
        (TARGET_CPPFLAGS): Likewise.
        (TARGET_LDFLAGS): Likewise.
        (AWK): Likewise.
        (include): Use target_cpu instead of host_cpu.
        (moddep.lst:): Use genmoddep.awk instead of genmoddep.

        * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
2006-05-28 23:01:43 +00:00
okuji 89a7d726f9 2006-05-27 Yoshinori K. Okuji <okuji@enbug.org>
* commands/blocklist.c: New file.

        * DISTLIST: Added commands/blocklist.c.

        * term/efi/console.c (grub_console_highlight_color): Use a lighter
        color for the background, and a daker color for the foreground.
        (grub_console_checkkey): Return READ_KEY.
        (grub_console_cls): Set the background to
        GRUB_EFI_BACKGROUND_BLACK temporarily to clean out the screen.

        * kern/efi/efi.c (grub_efi_exit_boot_services): New function.

        * include/grub/i386/linux.h (struct linux_kernel_params): Fixed
        the size of "padding5", "hd0_drive_info" and "hd1_drive_info".

        * include/grub/efi/efi.h (grub_efi_exit_boot_services): New
        prototype.

        * include/grub/efi/api.h (GRUB_EFI_TEXT_ATTR): Do not shift
        BG. The spec is wrong again.

        * include/grub/normal.h [GRUB_UTIL] (grub_blocklist_init): New
        prototype.
        [GRUB_UTIL] (grub_blocklist_fini): Likewise.

        * conf/i386-pc.rmk (grub_emu_SOURCES): Added
        commands/blocklist.c.
        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.

        * conf/common.rmk (pkgdata_MODULES): Added blocklist.mod.
        (blocklist_mod_SOURCES): New variable.
        (blocklist_mod_CFLAGS): Likewise.
        (blocklist_mod_LDFLAGS): Likewise.
2006-05-27 21:09:25 +00:00
okuji 4e93851c0f 2006-05-07 Yoshinori K. Okuji <okuji@enbug.org>
Use the environment context in the menu. Remove the commands
        "default" and "timeout", and use variables instead.

        * normal/menu.c: Include grub/env.h.
        (print_entry): Cast TITLE to silence gcc.
        (get_timeout): New function.
        (set_timeout): Likewise.
        (get_entry_number): Likewise.
        (run_menu): Use a default entry, a fallback entry and a timeout
        in the environment variables "default", "fallback" and
        "timeout". Also, tweak the default entry if it is not within the
        current menu entries.
        (grub_menu_run): Use a fallback entry in the environment variable
        "fallback".

        * normal/main.c (read_config_file): Do not initialize
        NEWMENU->DEFAULT_ENTRY, NEWMENU->FALLBACK_ENTRY or
        NEWMENU->TIMEOUT.
        (grub_normal_execute): Use a data slot to store the menu.

        * include/grub/normal.h (struct grub_menu): Removed default_entry,
        fallback_entry and timeout.
        (struct grub_menu_list): Removed.
        (grub_menu_list_t): Likewise.
        (struct grub_context): Likewise.
        (grub_context_t): Likewise.
        (grub_context_get): Likewise.
        (grub_context_get_current_menu): Likewise.
        (grub_context_push_menu): Likewise.
        (grub_context_pop_menu): Likewise.
        (grub_default_init): Likewise.
        (grub_default_fini): Likewise.
        (grub_timeout_init): Likewise.
        (grub_timeout_fini): Likewise.

        * conf/sparc64-ieee1275.rmk (pkgdata_MODULES): Removed default.mod
        and timeout.mod.
        (normal_mod_SOURCES): Removed normal/context.c.

        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Removed
        commands/default.c, commands/timeout.c and normal/context.c.
        (normal_mod_SOURCES): Removed normal/context.c.

        * conf/i386-pc.rmk (grub_emu_SOURCES): Removed commands/default.c,
        commands/timeout.c and normal/context.c.
        (normal_mod_SOURCES): Removed normal/context.c.

        * conf/i386-efi.rmk (grub_emu_SOURCES): Removed
        commands/default.c, commands/timeout.c and normal/context.c.
        (normal_mod_SOURCES): Removed normal/context.c.

        * conf/common.rmk (pkgdata_MODULES): Removed default.mod and
        timeout.mod.
        (default_mod_SOURCES): Removed.
        (default_mod_CFLAGS): Likewise.
        (default_mod_LDFLAGS): Likewise.
        (timeout_mod_SOURCES): Removed.
        (timeout_mod_CFLAGS): Likewise.
        (timeout_mod_LDFLAGS): Likewise.

        * DISTLIST: Removed commands/default.c, commands/timeout.c and
        normal/context.c.

        * commands/default.c: Removed.
        * commands/timeout.c: Likewise.
        * normal/context.c: Likewise.
2006-05-07 18:28:24 +00:00
okuji 7b455f4dd3 2006-04-26 Yoshinori K. Okuji <okuji@enbug.org>
* util/i386/pc/grub-mkimage.c (compress_kernel): Cast arguments
        explicitly to suppress gcc's warnings.
        * fs/fat.c (grub_fat_find_dir): Likewise.
        (grub_fat_label): Likewise.
        * fs/xfs.c (grub_xfs_read_inode): Likewise.
        (grub_xfs_mount): Likewise.
        (grub_xfs_label): Likewise.
        * fs/affs.c (grub_affs_mount): Likewise.
        (grub_affs_label): Likewise.
        (grub_affs_iterate_dir): Likewise.
        * fs/sfs.c (grub_sfs_mount): Likewise.
        (grub_sfs_iterate_dir): Likewise.
        * fs/ufs.c (grub_ufs_lookup_symlink): Likewise.
        * fs/hfs.c (grub_hfs_mount): Likewise.
        (grub_hfs_cmp_catkeys): Likewise.
        (grub_hfs_find_dir): Likewise.
        (grub_hfs_dir): Likewise.
        (grub_hfs_label): Likewise.
        * fs/jfs.c (grub_jfs_mount): Likewise.
        (grub_jfs_opendir): Likewise.
        (grub_jfs_getent): Likewise.
        (grub_jfs_lookup_symlink): Likewise.
        (grub_jfs_label): Likewise.
        * fs/hfsplus.c (grub_hfsplus_cmp_catkey): Likewise.
        (grub_hfsplus_iterate_dir): Likewise.
        (grub_hfsplus_btree_iterate_node): Made static.

        * util/grub-emu.c (prefix): New variable.
        (grub_machine_set_prefix): New function.
        (main): Do not set the environment variable "prefix" here. Only
        set PREFIX, which is used later by grub_machine_set_prefix.

        * include/grub/video.h: Do not include grub/symbol.h.
        (grub_video_register): Not exported. This symbol is not defined in
        the kernel.
        (grub_video_unregister): Likewise.
        (grub_video_iterate): Likewise.
        (grub_video_setup): Likewise.
        (grub_video_restore): Likewise.
        (grub_video_get_info): Likewise.
        (grub_video_get_blit_format): Likewise.
        (grub_video_set_palette): Likewise.
        (grub_video_get_palette): Likewise.
        (grub_video_set_viewport): Likewise.
        (grub_video_get_viewport): Likewise.
        (grub_video_map_color): Likewise.
        (grub_video_map_rgb): Likewise.
        (grub_video_map_rgba): Likewise.
        (grub_video_fill_rect): Likewise.
        (grub_video_blit_glyph): Likewise.
        (grub_video_blit_bitmap): Likewise.
        (grub_video_blit_render_target): Likewise.
        (grub_video_scroll): Likewise.
        (grub_video_swap_buffers): Likewise.
        (grub_video_create_render_target): Likewise.
        (grub_video_delete_render_target): Likewise.
        (grub_video_set_active_render_target): Likewise.

        * include/grub/symbol.h [GRUB_SYMBOL_GENERATOR] (EXPORT_FUNC):
        Undefined.
        [GRUB_SYMBOL_GENERATOR] (EXPORT_VAR): Likewise.

        * conf/sparc64-ieee1275.rmk (grubof_symlist.c): Depended on
        config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh.
        (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
        instead of $(srcdir)/genkernsyms.sh.

        * conf/powerpc-ieee1275.rmk (grubof_symlist.c): Depended on
        config.h. Use gensymlist.sh instead of $(srcdir)/gensymlist.sh.
        (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
        instead of $(srcdir)/genkernsyms.sh.

        * conf/i386-pc.rmk (symlist.c): Depended on config.h. Use
        gensymlist.sh instead of $(srcdir)/gensymlist.sh.
        (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
        instead of $(srcdir)/genkernsyms.sh.

        * conf/i386-efi.rmk (symlist.c): Depended on config.h. Use
        gensymlist.sh instead of $(srcdir)/gensymlist.sh.
        (kernel_syms.lst): Depended on config.h. Use genkernsyms.sh
        instead of $(srcdir)/genkernsyms.sh.

        * configure.ac (AC_CONFIG_FILES): Added gensymlist.sh and
        genkernsyms.sh.

        * Makefile.in (DISTCLEANFILES): Added gensymlist.sh and
        genkernsyms.sh.
        (gensymlist.sh): New target.
        (genkernsyms.sh): Likewise.

        * DISTLIST: Removed genkernsyms.sh and gensymlist.sh. Added
        genkernsyms.sh.in and gensymlist.sh.in.

        * genkernsyms.sh: Removed.
        * gensymlist.sh: Likewise.

        * genkernsyms.sh.in: New file.
        * gensymlist.sh.in: Likewise.
2006-04-26 21:58:36 +00:00
hollisb ff04ec24e9 2006-04-20 Hollis Blanchard <hollis@penguinppc.org>
* Makefile.in (LDFLAGS): Add variable.
	(LD): Remove variable.
	* configure.ac: Add -m32 to LDFLAGS.
	* genmk.rb (PModule#rule): Use $(CC) instead of $(LD).
	* conf/powerpc-ieee1275.rmk (COMMON_LDFLAGS): Add variable.
	(grubof_LDFLAGS): Use $(COMMON_LDFLAGS).
	(_linux_mod_LDFLAGS, linux_mod_LDFLAGS, normal_mod_LDFLAGS,
	suspend_mod_LDFLAGS, reboot_mod_LDFLAGS, halt_mod_LDFLAGS): New
	variables.
	* conf/sparc64-ieee1275.rmk (COMMON_LDFLAGS): Add -nostdlib.
	* conf/i386-pc.rmk (COMMON_LDFLAGS): Add -nostdlib.
	* conf/i386-efi.rmk (COMMON_LDFLAGS): Add -nostdlib.
2006-04-21 00:47:11 +00:00
chaac b4b9367408 2006-03-31 Vesa Jaaskelainen <chaac@nic.fi>
* DISTLIST: Added include/grub/i386/pc/vbeblit.h,
        include/grub/i386/pc/vbefill.h, video/i386/pc/vbeblit.c,
        video/i386/pc/vbefill.c.

        * conf/i386-pc.rmk (vbe_mod_SOURCES): Added video/i386/pc/vbeblit.c,
        video/i386/pc/vbefill.c.

        * include/grub/video.h (grub_video_blit_format): New enum.
        (grub_video_mode_info): Added new member blit_format.
        (grub_video_get_blit_format): New function prototype.

        * include/grub/i386/pc/vbe.h (grub_video_vbe_get_video_ptr): New
        function prototype.
        (grub_video_vbe_map_rgb): Likewise.
        (grub_video_vbe_unmap_color): Likewise.

        * include/grub/i386/pc/vbeblit.h: New file.

        * include/grub/i386/pc/vbefill.h: New file.

        * video/video.c (grub_video_get_blit_format): New function.
        (grub_video_vbe_get_video_ptr): Re-declared as non-static.
        (grub_video_vbe_map_rgb): Likewise.
        (grub_video_vbe_unmap_color): Likewise.

        * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Changed to use more
        optimized fills.
        (grub_video_vbe_blit_render_target): Changed to use more optimized
        blits.
        (grub_video_vbe_setup): Added detection for optimized settings.
        (grub_video_vbe_create_render_target): Likewise.

        * video/i386/pc/vbeblit.c: New file.

        * video/i386/pc/vbefill.c: New file.
2006-03-31 14:26:34 +00:00
chaac bd0d7896cf 2006-03-14 Vesa Jaaskelainen <chaac@nic.fi>
* DISTLIST: Added include/grub/video.h, term/gfxterm.c,
        video/video.c, commands/videotest.c.  Removed term/i386/pc/vesafb.c.

        * conf/i386-pc.rmk (pkgdata_MODULES): Added video.mod,
        gfxterm.mod, videotest.mod.  Removed vga.mod, vesafb.mod.
        (video_mod_SOURCES): Added.
        (video_mod_CFLAGS): Likewise.
        (video_mod_LDFLAGS): Likewise.
        (gfxterm_mod_SOURCES): Likewise.
        (gfxterm_mod_CFLAGS): Likewise.
        (gfxterm_mod_LDFLAGS): Likewise.
        (videotest_mod_SOURCES): Likewise.
        (videotest_mod_CFLAGS): Likewise.
        (videotest_mod_LDFLAGS): Likewise.
        (vesafb_mod_SOURCES): Removed.
        (vesafb_mod_CFLAGS): Likewise.
        (vesafb_mod_LDFLAGS): Likewise.
        (vga_mod_SOURCES): Likewise.
        (vga_mod_CFLAGS): Likewise.
        (vga_mod_LDFLAGS): Likewise.

        * commands/videotest.c: New file.

        * font/manager.c (fill_with_default_glyph): Modified to use
        grub_font_glyph.
        (grub_font_get_glyph): Likewise.
        (fontmanager): Renamed from this...
        (font_manager): ... to this.

        * include/grub/font.h (grub_font_glyph): Added new structure.
        (grub_font_get_glyph): Modified to use grub_font_glyph.

        * include/grub/misc.h (grub_abs): Added as inline function.

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

        * include/grub/i386/pc/vbe.h (GRUB_VBE_STATUS_OK): New macro.
        (GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL): Likewise.
        (GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR): Likewise.
        (grub_vbe_get_controller_info): Renamed from this...
        (grub_vbe_bios_get_controller_info): ... to this.
        (grub_vbe_get_mode_info): Renamed from this...
        (grub_vbe_bios_get_mode_info): ... to this.
        (grub_vbe_set_mode): Renamed from this...
        (grub_vbe_bios_set_mode): ... to this.
        (grub_vbe_get_mode): Renamed from this...
        (grub_vbe_bios_get_mode): ... to this.
        (grub_vbe_set_memory_window): Renamed from this...
        (grub_vbe_bios_set_memory_window): ... to this.
        (grub_vbe_get_memory_window): Renamed from this...
        (grub_vbe_bios_get_memory_window): ... to this.
        (grub_vbe_set_scanline_length): Renamed from this...
        (grub_vbe_set_scanline_length): ... to this.
        (grub_vbe_get_scanline_length): Renamed from this...
        (grub_vbe_bios_get_scanline_length): ... to this.
        (grub_vbe_set_display_start): Renamed from this...
        (grub_vbe_bios_set_display_start): ... to this.
        (grub_vbe_get_display_start): Renamed from this...
        (grub_vbe_bios_get_display_start): ... to this.
        (grub_vbe_set_palette_data): Renamed from this...
        (grub_vbe_bios_set_palette_data): ... to this.
        (grub_vbe_set_pixel_rgb): Removed.
        (grub_vbe_set_pixel_index): Likewise.

        * kern/i386/pc/startup.S (grub_vbe_get_controller_info): Renamed
        from this...
        (grub_vbe_bios_get_controller_info): ... to this.
        (grub_vbe_get_mode_info): Renamed from this...
        (grub_vbe_bios_get_mode_info): ... to this.
        (grub_vbe_set_mode): Renamed from this...
        (grub_vbe_bios_set_mode): ... to this.
        (grub_vbe_get_mode): Renamed from this...
        (grub_vbe_bios_get_mode): ... to this.
        (grub_vbe_set_memory_window): Renamed from this...
        (grub_vbe_bios_set_memory_window): ... to this.
        (grub_vbe_get_memory_window): Renamed from this...
        (grub_vbe_bios_get_memory_window): ... to this.
        (grub_vbe_set_scanline_length): Renamed from this...
        (grub_vbe_set_scanline_length): ... to this.
        (grub_vbe_get_scanline_length): Renamed from this...
        (grub_vbe_bios_get_scanline_length): ... to this.
        (grub_vbe_set_display_start): Renamed from this...
        (grub_vbe_bios_set_display_start): ... to this.
        (grub_vbe_get_display_start): Renamed from this...
        (grub_vbe_bios_get_display_start): ... to this.
        (grub_vbe_set_palette_data): Renamed from this...
        (grub_vbe_bios_set_palette_data): ... to this.
        (grub_vbe_bios_get_controller_info): Fixed problem with registers
        getting corrupted after calling it.  Added more pushes and pops.
        (grub_vbe_bios_set_mode): Likewise.
        (grub_vbe_bios_get_mode): Likewise.
        (grub_vbe_bios_get_memory_window): Likewise.
        (grub_vbe_bios_set_scanline_length): Likewise.
        (grub_vbe_bios_get_scanline_length): Likewise.
        (grub_vbe_bios_get_display_start): Likewise.
        (grub_vbe_bios_set_palette_data): Likewise.

        * normal/cmdline.c (cl_set_pos): Refresh the screen.
        (cl_insert): Likewise.
        (cl_delete): Likewise.

        * term/gfxterm.c: New file.

        * term/i386/pc/vesafb.c: Removed file.

        * video/video.c: New file.

        * video/i386/pc/vbe.c (real2pm): Added new function.
        (grub_video_vbe_draw_pixel): Likewise.
        (grub_video_vbe_get_video_ptr): Likewise.
        (grub_video_vbe_get_pixel): Likewise
        (grub_video_vbe_init): Likewise.
        (grub_video_vbe_fini): Likewise.
        (grub_video_vbe_setup): Likewise.
        (grub_video_vbe_get_info): Likewise.
        (grub_video_vbe_set_palette): Likewise.
        (grub_video_vbe_get_palette): Likewise.
        (grub_video_vbe_set_viewport): Likewise.
        (grub_video_vbe_get_viewport): Likewise.
        (grub_video_vbe_map_color): Likewise.
        (grub_video_vbe_map_rgb): Likewise.
        (grub_video_vbe_map_rgba): Likewise.
        (grub_video_vbe_unmap_color): Likewise.
        (grub_video_vbe_fill_rect): Likewise.
        (grub_video_vbe_blit_glyph): Likewise.
        (grub_video_vbe_blit_bitmap): Likewise.
        (grub_video_vbe_blit_render_target): Likewise.
        (grub_video_vbe_scroll): Likewise.
        (grub_video_vbe_swap_buffers): Likewise.
        (grub_video_vbe_create_render_target): Likewise.
        (grub_video_vbe_delete_render_target): Likewise.
        (grub_video_vbe_set_active_render_target): Likewise.
        (grub_vbe_set_pixel_rgb): Remove function.
        (grub_vbe_set_pixel_index): Likewise.
        (index_color_mode): Remove static variable.
        (active_mode): Likewise.
        (framebuffer): Likewise.
        (bytes_per_scan_line): Likewise.
        (grub_video_vbe_adapter): Added new static variable.
        (framebuffer): Likewise.
        (render_target): Likewise.
        (initial_mode): Likewise.
        (mode_in_use): Likewise.
        (mode_list): Likewise.
2006-03-14 19:08:34 +00:00
marco_g 502141992c 2005-12-25 Marco Gerards <marco@gnu.org>
Add support for Apple HFS+ filesystems.

	* fs/hfsplus.c: New file.

	* DISTLIST: Added `fs/hfsplus.c'.

	* conf/common.rmk (pkgdata_MODULES): Add `hfsplus.mod'.
	(hfsplus_mod_SOURCES): New variable.
	(hfsplus_mod_CFLAGS): Likewise.
	(hfsplus_mod_LDFLAGS): Likewise.
	* conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/hfsplus.c'.
	(grub_setup_SOURCES): Likewise.
	(grub_mkdevicemap_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.

	* fs/fshelp.c (grub_fshelp_log2blksize): New function.

	* include/grub/fshelp.h (grub_fshelp_log2blksize): new prototype.
2005-12-25 15:59:50 +00:00
marco_g b04216abba 2005-12-03 Marco Gerards <mgerards@xs4all.nl>
* conf/common.rmk (grub_modules_init.lst): Use `-printf "%P\n"'
	and `cd' to make sure the filename is not prefixed with a
	directory name.
	(pkgdata_MODULES): Add `gpt.mod'.
	(gpt_mod_SOURCES): New variable.
	(gpt_mod_CFLAGS): Likewise.
	(gpt_mod_LDFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `partmap/gpt.c'.

	* include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_GPT_DISK):
	New macro.

	* partmap/gpt.c: New file.

	* partmap/pc.c (pc_partition_map_iterate): Don't continue when a
	GPT partition map is detected.
2005-12-03 17:54:55 +00:00
subdino 41730ed990 2005-12-03 Vincent Pelletier <subdino2004@yahoo.fr>
* commands/i386/pc/play.c: New file.
        * conf/i386-pc.rmk (pkgdata_MODULES): Added play.mod.
        (play_mod_SOURCES, play_mod_CFLAGS, play_mod_LDFLAGS): New
        macros.
2005-12-03 16:18:27 +00:00
marco_g 233b16284c 2005-11-18 Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
* genmk.rb: Fixed list rules moved to Makefile.in.  Recognise
	appending to variables with "+=".
	(PModule): Use full pathname to generate *.lst filenames.

	* Makefile.in: Fixed list rules moved from genmk.rb.
	(.DELETE_ON_ERROR): New special target.
	(RMKFILES): Add common.rmk and sparc64-ieee1275.rmk.

	* conf/i386-pc.rmk: Include conf/common.mk.
	(pkgdata_MODULES): Removed fshelp.mod, fat.mod, ext2.mod, ufs.mod,
	minux.mod, hfs.mod, jfs.mod, xfs.mod, affs.mod, sfs.mod,
	hello.mod, boot.mod, terminal.mod, ls.mod, cmp.mod, cat.mod,
	help.mod, font.mod, terminfo.mod, amiga.mod, apple.mod, pc.mod,
	sun.mod, acorn.mod, loopback.mod, default.mod, timeout.mod,
	configfile.mod, search.mod, gzio.mod and test.mod.
	(symlist.c, grub_script.tab.c, grub_script.tab.h, kernel_syms.lst)
	(grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c)
	(fshelp_mod_SOURCES, fshelp_mod_CFLAGS, fshelp_mod_LDFLAGS)
	(fat_mod_SOURCES, fat_mod_CFLAGS, fat_mod_LDFLAGS)
	(ext2_mod_SOURCES, ext2_mod_CFLAGS, ext2_mod_LDFLAGS)
	(ufs_mod_SOURCES, ufs_mod_CFLAGS, ufs_mod_LDFLAGS)
	(minix_mod_SOURCES, minix_mod_CFLAGS, minix_mod_LDFLAGS)
	(hfs_mod_SOURCES, hfs_mod_CFLAGS, hfs_mod_LDFLAGS, jfs_mod_SOURCES)
	(jfs_mod_CFLAGS, jfs_mod_LDFLAGS, iso9660_mod_SOURCES)
	(iso9660_mod_CFLAGS, iso9660_mod_LDFLAGS, xfs_mod_SOURCES)
	(xfs_mod_CFLAGS, xfs_mod_LDFLAGS, affs_mod_SOURCES)
	(affs_mod_CFLAGS, affs_mod_LDFLAGS, sfs_mod_SOURCES)
	(sfs_mod_CFLAGS, sfs_mod_LDFLAGS, hello_mod_SOURCES)
	(hello_mod_CFLAGS, hello_mod_LDFLAGS, boot_mod_SOURCES)
	(boot_mod_CFLAGS, boot_mod_LDFLAGS, terminal_mod_SOURCES)
	(terminal_mod_CFLAGS, terminal_mod_LDFLAGS, ls_mod_SOURCES)
	(ls_mod_CFLAGS, ls_mod_LDFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS)
	(cmp_mod_LDFLAGS, cat_mod_SOURCES, cat_mod_CFLAGS, cat_mod_LDFLAGS)
	(help_mod_SOURCES, help_mod_CFLAGS, help_mod_LDFLAGS)
	(font_mod_SOURCES, font_mod_CFLAGS, font_mod_LDFLAGS)
	(terminfo_mod_SOURCES, terminfo_mod_CFLAGS, terminfo_mod_LDFLAGS)
	(amiga_mod_SOURCES, amiga_mod_CFLAGS, amiga_mod_LDFLAGS)
	(apple_mod_SOURCES, apple_mod_CFLAGS, apple_mod_LDFLAG): Move from
	here...
	* conf/common.rmk: ... to here.  New file.

	* conf/common.mk: New file.
2005-11-18 14:56:55 +00:00
okuji 16f820c8c5 2005-11-18 Yoshinori K. Okuji <okuji@enbug.org>
* conf/powerpc-ieee1275.rmk (grub_script.tab.h): Unified to ...
        (grub_script.tab.c): ... here.

        * conf/sparc64-ieee1275.rmk (grub_script.tab.h): Unified to ...
        (grub_script.tab.c): ... here.

        * conf/i386-pc.rmk (grub_script.tab.h): Unified to ...
        (grub_script.tab.c): ... here.

        * normal/command.c (grub_command_find): Fixed a memory leak of
        MODULE_NAME. Reported by Mike Small <smallm@panix.com>.
2005-11-18 10:51:00 +00:00
marco_g 7f67dc13e5 2005-11-13 Timothy Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Add support for Linux/ADFS partition tables.

	* partmap/acorn.c: New file.

	* include/grub/acorn_filecore.h: Likewise.

	* DISTLIST: Added `partmap/acorn.c' and
	`include/grub/acorn_filecore.h'.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
	`partmap/acorn.c'.
	(pkgdata_MODULES): Add `acorn.mod'.
	(acorn_mod_SOURCES): New variable.
	(acorn_mod_CFLAGS): Likewise.

	* conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add
	`partmap/acorn.c'.
	(pkgdata_MODULES): Add `acorn.mod'.
	(acorn_mod_SOURCES): New variable.
	(acorn_mod_CFLAGS): Likewise.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `partmap/acorn.c'.
	(pkgdata_MODULES): Add `acorn.mod'.
	(acorn_mod_SOURCES): New variable.
	(acorn_mod_CFLAGS): Likewise.
	(acorn_mod_LDFLAGS): Likewise.

	* include/types.h (grub_disk_addr_t): New typedef.
2005-11-13 19:45:12 +00:00
marco_g 6d099807fa 2005-11-13 Marco Gerards <mgerards@xs4all.nl>
* geninit.sh: New file.

	* geninitheader.sh: Likewise.

	* commands/boot.c (grub_boot_init, grub_boot_fini): Removed.
	* commands/cat.c (grub_cat_init, grub_cat_fini): Likewise.
	* commands/cmp.c (grub_cmp_init, grub_cmp_fini): Likewise.
	* commands/configfile.c (grub_configfile_init)
	(grub_configfile_fini): Likewise.
	* commands/default.c (grub_default_init, grub_default_fini):
	Likewise.
	* commands/help.c (grub_help_init, grub_help_fini): Likewise.
	* commands/ls.c (grub_ls_init, grub_ls_fini): Likewise.
	* commands/search.c (grub_search_init, grub_search_fini): Likewise.
	* commands/terminal.c (grub_terminal_init, grub_terminal_fini):
	Likewise.
	* commands/test.c (grub_test_init, grub_test_fini): Likewise.
	* commands/timeout.c (grub_timeout_init, grub_timeout_fini):
	Likewise.
	* commands/i386/pc/halt.c (grub_halt_init, grub_halt_fini): Likewise.
	* commands/iee1275/halt.c (grub_halt_init, grub_halt_fini):
	Likewise.
	* commands/i386/pc/reboot.c (grub_reboot_init, grub_reboot_fini):
	Likewise.
	* commands/iee1275/reboot.c (grub_reboot_init, grub_reboot_fini):
	Likewise.
	* disk/loopback.c (grub_loop_init, grub_loop_fini): Likewise.
	* fs/affs.c (grub_affs_init, grub_affs_fini): Likewise.
	* fs/ext2.c (grub_ext2_init, grub_ext2_fini): Likewise.
	* fs/fat.c (grub_fat_init, grub_fat_fini): Likewise.
	* fs/hfs.c (grub_hfs_init, grub_hfs_fini): Likewise.
	* fs/iso9660.c (grub_iso9660_init, grub_iso9660_fini): Likewise.
	* fs/jfs.c (grub_jfs_init, grub_jfs_fini): Likewise.
	* fs/minix.c (grub_minix_init, grub_minix_fini): Likewise.
	* fs/sfs.c (grub_sfs_init, grub_sfs_fini): Likewise.
	* fs/ufs.c (grub_ufs_init, grub_ufs_fini): Likewise.
	* fs/xfs.c (grub_xfs_init, grub_xfs_fini): Likewise.
	* normal/main.c (grub_normal_init, grub_normal_fini): Likewise.
	* partmap/amiga.c (grub_amiga_partition_map_init)
	(grub_amiga_partition_map_fini): Likewise.
	* partmap/apple.c (grub_apple_partition_map_init)
	(grub_apple_partition_map_fini): Likewise.
	* partmap/pc.c (grub_pc_partition_map_init)
	(grub_pc_partition_map_fini): Likewise.
	* partmap/sun.c (grub_sun_partition_map_init,
	grub_sun_partition_map_fini): Likewise.
	* term/terminfo.c (grub_terminal_init, grub_terminal_fini):
	Likewise.

	* util/grub-emu.c: Include <grub_modules_init.h>.
	(main): Don't initialize and de-initialize any modules directly,
	use `grub_init_all' and `grub_fini_all' instead.

	* term/i386/pc/vesafb.c (grub_vesafb_init): Renamed to
	`grub_vesafb_mod_init'.
	(grub_vesafb_fini): Renamed to `grub_vesafb_mod_fini'.  Updated
	all users.
	* term/i386/pc/vga.c (grub_vga_init): Renamed to
	`grub_vga_mod_init'.  Updated all users.
	(grub_vga_fini): Renamed to `grub_vga_mod_fini'.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `grub_emu_init.c'.
	(grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c): New
	rules.

	* include/grub/dl.h (GRUB_MOD_INIT): Add argument `name'.
	Generate a function to initialize the module in utilities.
	Updated all callers.
	(GRUB_MOD_FINI): Add argument `name'.  Generate a function to
	initialize the module in utilities.  Updated all callers.
2005-11-13 15:47:09 +00:00
marco_g daac212ae3 2005-11-06 Marco Gerards <mgerards@xs4all.nl>
Add initial scripting support.

	* commands/test.c: New file.
	* include/grub/script.h: Likewise.
	* normal/execute.c: Likewise.
	* normal/function.c: Likewise.
	* normal/lexer.c: Likewise.
	* normal/parser.y: Likewise.
	* normal/script.c: Likewise.

	* configure.ac: Add `AC_PROG_YACC' test.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/test.c',
	`normal/execute.c', `normal/lexer.c', `grub_script.tab.c',
	`normal/function.c' and `normal/script.c'.
	(normal_mod_SOURCES): `normal/execute.c', `normal/lexer.c',
	`grub_script.tab.c', `normal/function.c' and `normal/script.c'.
	(test_mod_SOURCES, test_mod_CFLAGS, test_mod_LDFLAGS): New variables.
	(pkgdata_MODULES): Add `test.mod'.
	(grub_script.tab.c): New rule.
	(grub_script.tab.h): Likewise.

	* include/grub/err.h (grub_err_t): Add `GRUB_ERR_TEST_FAILURE'.

	* include/grub/normal.h (grub_test_init): New prototype.
	(grub_test_fini): Likewise.

	* normal/command.c: Include <grub/script.h>.
	(grub_command_execute): Rewritten.

	* util/grub-emu.c (main): Call `grub_test_init' and
	`grub_test_fini'.
2005-11-06 22:19:59 +00:00
marco_g 04ccf3ec6f 2005-10-24 Marco Gerards <mgerards@xs4all.nl>
* include/grub/parser.h: New file.

	* kern/parser.c: Likewise.

	* conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/parser.c'.
	(grub_setup_SOURCES): Likewise.
	(grub_probefs_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	(kernel_img_HEADERS): Add `parser.h'.

	* conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
	(grub_emu_SOURCES): Add `kern/parser.c'.
	(grubof_SOURCES): Likewise.

	* conf/sparc64-ieee1275.rmk (grubof_HEADERS): Add `parser.h'.
	(grubof_SOURCES): Add `kern/parser.c'.

	* include/grub/misc.h (grub_split_cmdline): Removed prototype.

	* kern/misc.c (grub_split_cmdline): Removed function.

	* kern/rescue.c: Include <grub/parser.h>.
	(grub_enter_rescue_mode): Use `grub_parser_split_cmdline' instead
	of `grub_split_cmdline'.

	* normal/command.c: Include <grub/parser.h>.
	(grub_command_execute):  Use `grub_parser_split_cmdline' instead
	of `grub_split_cmdline'.

	* normal/completion.c: Include <grub/parser.h>.
	(cmdline_state): New variable.
	(iterate_dir): End the filename with a quote depending on the
	command line state.
	(get_state): new function.
	(grub_normal_do_completion): Use `grub_parser_split_cmdline' to
	split the arguments and determine the current argument.  When the
	argument string is not quoted, escape all spaces.
2005-10-24 10:23:46 +00:00
marco_g 9a90987706 2005-10-09 Marco Gerards <mgerards@xs4all.nl>
Add support for the SFS filesystem.

	* fs/sfs.c: New file.

	* DISTLIST: Added `fs/sfs.c'.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/sfs.c'.
	(grub_probefs_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add `sfs.mod'.
	(sfs_mod_SOURCES): New variable.
	(sfs_mod_CFLAGS): Likewise.
	(sfs_mod_LDFLAGS): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `fs/sfs.c'.
	(pkgdata_MODULES): Add `sfs.mod'.
	(sfs_mod_SOURCES): New variable.
	(sfs_mod_CFLAGS): Likewise.

	* util/grub-emu.c (main): Call `grub_sfs_init' and
	`grub_sfs_fini'.

	* include/grub/fs.h (grub_sfs_init): New prototype.
	(grub_sfs_fini): Likewise.
2005-10-09 13:03:53 +00:00
marco_g 57bdbde34e 2005-10-07 Marco Gerards <mgerards@xs4all.nl>
Add support for the AFFS filesystem.

	* fs/affs.c: New file.

	* DISTLIST: Added `fs/affs.c'.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/affs.c'.
	(grub_probefs_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add `affs.mod'.
	(affs_mod_SOURCES): New variable.
	(affs_mod_CFLAGS): Likewise.
	(affs_mod_LDFLAGS): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `fs/affs.c'.
	(pkgdata_MODULES): Add `affs.mod'.
	(affs_mod_SOURCES): New variable.
	(affs_mod_CFLAGS): Likewise.

	* util/grub-emu.c (main): Call `grub_affs_init' and
	`grub_affs_fini'.

	* include/grub/fs.h (grub_affs_init): New prototype.
	(grub_affs_fini): Likewise.
2005-10-07 19:25:46 +00:00
marco_g 59b8208ace 2005-10-01 Marco Gerards <mgerards@xs4all.nl>
* configure.ac: Accept `x86_64' as host_cpu.  In that case add
	`-m32' to CFLAGS.

	* genmk.rb (class PModule): Always use `$(#{prefix}_LDFLAGS)' when
	linking.

	* conf/i386-pc.rmk (COMMON_CFLAGS): Add `-m32'.
	(COMMON_LDFLAGS): New variable.
	(kernel_img_LDFLAGS): Include `COMMON_FLAGS'.
	(_chain_mod_LDFLAGS, fshelp_mod_LDFLAGS, fat_mod_LDFLAGS)
	(ext2_mod_LDFLAGS, ufs_mod_LDFLAGS, minix_mod_LDFLAGS)
	(hfs_mod_LDFLAGS, jfs_mod_LDFLAGS, iso9660_mod_LDFLAGS)
	(xfs_mod_LDFLAGS, _linux_mod_LDFLAGS, linux_mod_LDFLAGS)
	(normal_mod_LDFLAGS, hello_mod_LDFLAGS, boot_mod_LDFLAGS)
	(terminal_mod_LDFLAGS, ls_mod_LDFLAGS, cmp_mod_LDFLAGS)
	(cat_mod_LDFLAGS, help_mod_LDFLAGS, reboot_mod_LDFLAGS)
	(halt_mod_LDFLAGS, vga_mod_LDFLAGS, font_mod_LDFLAGS)
	(terminfo_mod_LDFLAGS, serial_mod_LDFLAGS, _multiboot_mod_LDFLAGS)
	(multiboot_mod_LDFLAGS, amiga_mod_LDFLAGS, apple_mod_LDFLAGS)
	(pc_mod_LDFLAGS, sun_mod_LDFLAGS, loopback_mod_LDFLAGS)
	(default_mod_LDFLAGS, timeout_mod_LDFLAGS, configfile_mod_LDFLAGS)
	(vbe_mod_LDFLAGS, vesafb_mod_LDFLAGS, vbeinfo_mod_LDFLAGS)
	(vbetest_mod_LDFLAGS, search_mod_LDFLAGS, gzio_mod_LDFLAGS): New
	variables.
	(normal_mod_ASFLAGS): Add `-m32'.

	* include/grub/types.h (grub_host_addr_t, grub_host_off_t)
	(grub_host_size_t, grub_host_ssize_t): New types.
	(grub_addr_t, grub_off_t, grub_size_t, grub_ssize_t): Make type
	dependant of `GRUB_CPU_SIZEOF_VOID_P' instead on
	`GRUB_HOST_SIZEOF_VOID_P'.

	* include/grub/kernel.h (struct grub_module_header): Type of
	member offset changed to `grub_host_off_t'.  Type of member size
	changed to `grub_host_size_t'.
	(struct grub_module_info): Type of member offset changed to
	`grub_host_off_t'.  Type of member size changed to
	`grub_host_size_t'.
2005-10-01 19:49:55 +00:00
marco_g b2499b29cd 2005-09-28 Marco Gerards <metgerards@student.han.nl>
Adds support for the XFS filesystem.  Btrees are not supported
	yet.

	* fs/xfs.c: New file.

	* DISTLIST: Added `fs/xfs.c'.

	* conf/i386-pc.rmk (grub_setup_SOURCES): Add `fs/xfs.c'.
	(grub_probefs_SOURCES): Likewise.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add `xfs.mod'.
	(xfs_mod_SOURCES): New variable.
	(xfs_mod_CFLAGS): Likewise.

	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `fs/xfs.c'.
	(pkgdata_MODULES): Add `xfs.mod'.
	(xfs_mod_SOURCES): New variable.
	(xfs_mod_CFLAGS): Likewise.

	* util/grub-emu.c (main): Call `grub_xfs_init' and
	`grub_xfs_fini'.

	* include/grub/fs.h (grub_xfs_init): New prototype.
	(grub_xfs_fini): Likewise.
2005-09-28 10:07:22 +00:00
okuji 47d2d65e33 2005-09-03 Yoshinori K. Okuji <okuji@enbug.org>
* normal/completion.c (complete_arguments): Add the qualifier
        const into OPTIONS.

        From Omniflux <omniflux+lists@omniflux.com>:
        * include/grub/terminfo.h: New file.
        * include/grub/tparm.h: Likewise.
        * include/grub/i386/pc/serial.h: Likewise.
        * term/terminfo.c: Likewise.
        * term/tparm.c: Likewise.
        * term/i386/pc/serial.c: Likewise.
        * conf/i386-pc.rmk (pkgdata_MODULES): Added terminfo.mod and
        serial.mod.
        (terminfo_mod_SOURCES): New variable.
        (terminfo_mod_CFLAGS): Likewise.
        (serial_mod_SOURCES): Likewise.
        (serial_mod_CFLAGS): Likewise.
2005-09-03 16:54:27 +00:00
okuji d9864ee11a 2005-08-22 Yoshinori K. Okuji <okuji@enbug.org>
* gendistlist.sh (EXTRA_DISTFILES): Added genfslist.sh.
        (DISTDIRS): Added io and video.
        Rewrite the search routine to make an output consistently.

        * DISTLIST: Added conf/sparc64-ieee1275.mk,
        conf/sparc64-ieee1275.rmk, include/grub/gzio.h,
        include/grub/ieee1275/ieee1275.h, include/grub/ieee1275/ofdisk.h,
        io/gzio.c, kern/sparc64/cache.c, kern/sparc64/dl.c,
        kern/sparc64/ieee1275/init.c, kern/sparc64/ieee1275/openfw.c and
        util/powerpc/ieee1275/misc.c.

        * include/grub/gzio.h: New file.
        * io/gzio.c: Likewise.

        * kern/file.c (grub_file_close): Call grub_device_close only if
        FILE->DEVICE is not NULL.

        * include/grub/mm.h [!NULL] (NULL): New macro.

        * include/grub/err.h (GRUB_ERR_BAD_GZIP_DATA): New constant.

        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added io/gzip.c.
        (pkgdata_MODULES): Added gzio.mod.
        (gzio_mod_SOURCES): New variable.
        (gzio_mod_CFLAGS): Likewise.

        * conf/i386-pc.rmk (grub_emu_SOURCES): Added io/gzip.c.
        (pkgdata_MODULES): Added gzio.mod.
        (gzio_mod_SOURCES): New variable.
        (gzio_mod_CFLAGS): Likewise.

        * commands/cat.c: Include grub/gzio.h.
        (grub_cmd_cat): Use grub_gzfile_open instead of
        grub_file_open.

        * commands/cmp.c: Include grub/gzio.h.
        (grub_cmd_cmp): Use grub_gzfile_open instead of
        grub_file_open.

        * loader/i386/pc/multiboot.c: Include grub/gzio.h.
        (grub_rescue_cmd_multiboot): Use grub_gzfile_open instead of
        grub_file_open.
        (grub_rescue_cmd_module): Likewise.
2005-08-22 17:28:59 +00:00
okuji 6a85ce7953 2005-08-20 Yoshinori K. Okuji <okuji@enbug.org>
* partmap/pc.c (pc_partition_map_iterate): Include the value of an
        invalid magic in thre error.

        * commands/search.c: New file.

        * util/grub-emu.c (main): Call grub_search_init and
        grub_search_fini.

        * kern/rescue.c (grub_rescue_print_disks): Removed.
        (grub_rescue_print_devices): New function.
        (grub_rescue_cmd_ls): Use grub_device_iterate with
        grub_rescue_print_devices instead of grub_disk_dev_iterate with
        grub_rescue_print_disks.

        * kern/partition.c (grub_partition_iterate): Return the result of
        PARTMAP->ITERATE instead of GRUB_ERRNO.

        * kern/device.c: Include grub/partition.h.
        (grub_device_iterate): New function.

        * include/grub/partition.h (grub_partition_iterate): Return int
        instead of grub_err_t.

        * include/grub/normal.h [GRUB_UTIL] (grub_search_init): New
        prototype.
        [GRUB_UTIL] (grub_search_fini): Likewise.

        * include/grub/device.h (grub_device_iterate): New prototype.

        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added
        commands/search.c.
        (pkgdata_MODULES): Added search.mod.
        (search_mod_SOURCES): New variable.
        (search_mod_CFLAGS): Likewise.

        * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/search.c.
        (pkgdata_MODULES): Added search.mod.
        (search_mod_SOURCES): New variable.
        (search_mod_CFLAGS): Likewise.

        * commands/ls.c (grub_ls_list_disks): Renamed to ...
        (grub_ls_list_devices): ... this, and use grub_device_iterate.
        All callers changed.

        * DISTLIST: Added commands/search.c.
2005-08-20 07:49:02 +00:00
okuji 1f0a95e481 2005-08-19 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Replace commands/i386/pc/vbe_list_modes.c and
        commands/i386/pc/vbe_test.c with commands/i386/pc/vbeinfo.c and
        commands/i386/pc/vbetest.c.

        * video/i386/pc/vbe.c (grub_vbe_probe): If INFOBLOCK is not NULL,
        call grub_vbe_get_controller_info again, because the returned
        information is volatile.
        (grub_vbe_set_video_mode): Mostly rewritten.
        (grub_vbe_get_video_mode): Use grub_vbe_probe and use
        grub_vbe_status_t correctly.
        (grub_vbe_get_video_mode_info): Likewise.
        (grub_vbe_set_pixel_rgb): Use a switch statement rather than
        several if statements.

        * commands/i386/pc/vbe_list_modes.c: Renamed to ...
        * commands/i386/pc/vbeinfo.c: ... this.

        * commands/i386/pc/vbe_test.c: Renamed to ...
        * commands/i386/pc/vbetest.c: ... this.

        * commands/i386/pc/vbeinfo.c (grub_cmd_vbe_list_modes): Renamed to
        ...
        (grub_cmd_vbeinfo): ... this. Save video modes before
        iterating. Skip a video mode, if it is not available, not enough
        information is given or it is monochrome. Show the memory
        model. Leave the interpretation of MODEVAR to grub_strtoul
        completely.
        (GRUB_MOD_INIT): Rename vbe_list_modes to vbeinfo.
        (GRUB_MOD_FINI): Likewise.

        * commands/i386/pc/vbetest.c (grub_cmd_vbe_test): Renamed to ...
        (grub_cmd_vbetest): ... this. Don't print unnecessarily. Use
        grub_err_t instead of grub_uint32_t. Don't use SPTR. Remove a
        duplicated grub_env_get. Leave the interpretation of MODEVAR to
        grub_strtoul completely.
        (real2pm): Removed.
        (GRUB_MOD_INIT): Rename vbe_test to vbetest.
        (GRUB_MOD_FINI): Likewise.

        * normal/misc.c: Include grub/mm.h.

        * conf/i386-pc.rmk (pkgdata_MODULES): Replaced vbe_test.mod and
        vbe_list_modes with vbetest.mod and vbeinfo.mod.
        (vbe_list_modes_mod_SOURCES): Removed.
        (vbe_list_modes_mod_CFLAGS): Likewise.
        (vbe_test_mod_SOURCES): Likewise.
        (vbe_test_mod_CFLAGS): Likewise.
        (vbeinfo_mod_SOURCES): New variable.
        (vbeinfo_mod_CFLAGS): Likewise.
        (vbetest_mod_SOURCES): Likewise.
        (vbetest_mod_CFLAGS): Likewise.
2005-08-19 00:32:01 +00:00
okuji 992ffbbebb 2005-08-18 Yoshinori K. Okuji <okuji@enbug.org>
* normal/misc.c: New file.

        * DISTLIST: Added normal/misc.c.

        * partmap/amiga.c (amiga_partition_map_iterate): Add an argument
        DISK to HOOK. Call HOOK with DISK.
        * partmap/apple.c (apple_partition_map_iterate): Likewise.
        * partmap/pc.c (pc_partition_map_iterate): Likewise.
        * partmap/sun.c (sun_partition_map_iterate): Likewise.

        * normal/menu_entry.c (struct screen): Added a new member
        "completion_shown".
        (completion_buffer): New global variable.
        (make_screen): Set SCREEN->COMPLETION_SHOWN to zero.
        (store_completion): New function.
        (complete): Likewise.
        (clear_completions): Likewise.
        (grub_menu_entry_run): If SCREEN->COMPLETION_SHOWN is non-zero,
        call clear_completions and reset SCREEN->COMPLETION_SHOWN. If C is
        a tab, call complete.

        * normal/completion.c (disk_dev): Removed.
        (print_simple_completion): Likewise.
        (print_partition_completion): Likewise.
        (print_func): New global variable.
        (add_completion): Do not take the arguments WHAT or PRINT any
        longer. Added a new argument TYPE. Instead of printing directly,
        call PRINT_FUNC if not NULL.
        All callers changed.
        (complete_device): Use a local variable DEV instead of
        DISK_DEV. Do not move CURRENT_WORD to the end of a device name.
        (grub_normal_do_completion): Take a new argument HOOK. Do not
        initialize DISK_DEV. Initialize PRINT_FUNC to HOOK. If RET is an
        empty string, return NULL instead.
        All callers changed.

        * normal/cmdline.c (print_completion): New function.

        * kern/partition.c (grub_partition_iterate): Add an argument DISK
        to HOOK.
        All callers changed.

        * kern/disk.c (grub_print_partinfo): Removed.

        * include/grub/partition.h (struct grub_partition_map): Add a new
        argument DISK into HOOK of ITERATE.
        (grub_partition_iterate): Add a new argument DISK to HOOK.

        * include/grub/normal.h (enum grub_completion_type): New enum.
        (grub_completion_type_t): New type.
        (GRUB_COMPLETION_TYPE_COMMAND): New constant.
        (GRUB_COMPLETION_TYPE_DEVICE): Likewise.
        (GRUB_COMPLETION_TYPE_PARTITION): Likewise.
        (GRUB_COMPLETION_TYPE_FILE): Likewise.
        (grub_normal_do_completion): Added a new argument HOOK.
        (grub_normal_print_device_info): New prototype.

        * include/grub/disk.h (grub_print_partinfo): Removed.

        * conf/i386-pc.rmk (grub_emu_SOURCES): Added normal/misc.c.
        (normal_mod_SOURCES): Likewise.
        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
        (normal_mod_SOURCES): Likewise.

        * commands/ls.c (grub_ls_list_disks): Use
        grub_normal_print_device_info instead of grub_print_partinfo. Free
        PNAME.
        (grub_ls_list_files): Use grub_normal_print_device_info instead of
        duplicating the code.
2005-08-18 03:14:39 +00:00
chaac 6323696adf Added first version of the VBE terminal code. 2005-08-15 21:25:41 +00:00
okuji 8de3495c7b 2005-08-12 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Added normal/completion.c.

        * normal/completion.c: New file.

        * term/i386/pc/console.c (grub_console_getwh): New function.
        (grub_console_term): Assign grub_console_getwh to getwh.

        * normal/cmdline.c (grub_tab_complete): Removed. Now the same
        function is defined in normal/completion.c as
        grub_normal_do_completion.
        (grub_cmdline_get): Use grub_normal_do_completion instead of
        grub_tab_complete.

        * kern/partition.c (grub_partition_map_iterate): Return 1 if HOOK
        returns non-zero, otherwise return 0.
        (grub_partition_iterate): First, probe the partition map. Then,
        call ITERATE only for this partition map.

        * kern/misc.c (grub_strncmp): Rewritten.

        * kern/disk.c (grub_disk_dev_iterate): Return 1 if P->ITERATE
        returns non-zero. Otherwise return 0.

        * include/grub/partition.h (grub_partition_map_iterate): Return
        int instead of void.

        * include/grub/normal.h (grub_normal_do_completion): New prototype.

        * include/grub/misc.h (grub_strncmp): Change the type of N to
        grub_size_t.

        * include/grub/disk.h (grub_disk_dev_iterate): Return int instead
        of void.

        * normal/menu.c (draw_border): Cast GRUB_TERM_BORDER_WIDTH to
        unsigned explictly before comparing it with I.

        * kern/main.c (grub_env_write_root): Add the attribute unused into
        VAR.

        * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added
        normal/completion.c.
        (normal_mod_SOURCES): Likewise.
        * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise.
        (normal_mod_SOURCES): Likewise.

        * normal/command.c (grub_iterate_commands): If ITERATE returns
        non-zero, return one immediately.
2005-08-12 19:53:33 +00:00
chaac e85e144bfc Added support for VESA Bios Extension to i386 kernel. 2005-08-09 14:39:50 +00:00
okuji 4ac9bd0438 2005-08-08 Yoshinori K. Okuji <okuji@enbug.org>
* Makefile.in (LIBLZO): New variable.

        * configure.ac: Check for LZO version 2.

        * util/i386/pc/grub-mkimage.c [HAVE_LZO_LZO1X_H]: Include
        lzo/lzo1x.h instead of lzo1x.h.

        * conf/i386-pc.rmk (grub_mkimage_LDFLAGS): Use $(LIBLZO) instead
        of -llzo.

        * util/i386/pc/grub-setup.c (main): Do not free PREFIX
        twice. Reported by Vladimir Serbinenko <phcoder@gmail.com>.

        * partmap/pc.c (pc_partition_map_probe): Restore P->DATA after
        copying the data from PARTITION to P.
2005-08-08 23:15:21 +00:00
okuji f4917dfdd6 2005-08-07 Yoshinori K. Okuji <okuji@enbug.org>
* kern/rescue.c (grub_rescue_cmd_rmmod): If the reference count is
        negative, unload the module.

        * util/i386/pc/grub-setup.c (setup): The name of the PC partition
        map is "pc_partition_map" but not "pc".
        (usage): Fix the description. The options are --boot-image and
        --core-image but not --boot-file or --core-file.
        (main): If not specified explicitly, make BOOT_FILE and CORE_FILE
        based on DEFAULT_BOOT_FILE and DEFAULT_CORE_FILE with DIR or
        DEFAULT_DIRECTORY.

        * util/i386/pc/grub-install.in: Do not specify --boot-file or
        --core-file. Specify INSTALL_DEVICE as an argument.

        * util/console.c: Include config.h.
        [HAVE_NCURSeS_CURSES_H]: Include ncurses/curses.h.
        [HAVE_NCURSES_H]: Include ncurses.h.
        [HAVE_CURSES_H]: Include curses.h.
        [!A_NORMAL] (A_NORMAL): Defined as zero.
        [!A_STANDOUT] (A_STANDOUT): Likewise.

        * conf/i386-pc.rmk (grub_emu_LDFLAGS): Use $(LIBCURSES) instead of
        -lncurses.
        * conf/powerpc-ieee1275.rmk (grub_emu_LDFLAGS): Likewise.

        * configure.ac: Check for curses libraries and headers.

        * Makefile.in (LIBCURSES): New variable.

        * genmk.rb (Script::rule): Set the executable bits.

        * util/i386/pc/biosdisk.c (grub_util_biosdisk_get_grub_dev): The
        name of the PC partition map is "pc_partition_map" but not "pc".
2005-08-07 17:12:52 +00:00
okuji 8ceafda2a8 2005-08-06 Yoshinori K. Okuji <okuji@enbug.org>
* conf/i386-pc.rmk (kernel_img_HEADERS): Reordered for
        readablity.

        * config.guess: Updated to the latest version from gnulib.
        * config.sub: Likewise.
        * install.sh: Likewise.
        * mkinstalldirs: Likewise.

        * include/grub/console.h: Removed. This file is arch-specific. Do
        not put this in include/grub.

        * include/grub/i386/pc/console.h: Resurrected.

        * util/console.c: Include grub/machine/console.h instead of
        grub/console.h.
        * util/grub-emu.c: Likewise.
2005-08-06 15:50:07 +00:00
okuji 8b5f393852 2005-08-01 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Added util/i386/pc/grub-probefs.c.

	* conf/i386-pc.rmk (sbin_UTILITIES): Added grub-probefs.
	(grub_setup_SOURCES): Removed partmap/amiga.c, partmap/apple.c and
	partmap/sun.c.
	(grub_probefs_SOURCES): New variable.

	* util/i386/pc/grub-probefs.c: New file.

	* util/i386/pc/grub-setup.c (main): Call
	grub_pc_partition_map_init, grub_ufs_init, grub_minix_init,
	grub_hfs_init and grub_jfs_init to initialize the system. Call
	grub_ufs_fini, grub_minix_fini, grub_hfs_fini, grub_jfs_init and
	grub_pc_partition_map_fini to finish the system.
2005-08-01 20:38:46 +00:00
okuji 075a165076 2005-07-24 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Added util/i386/pc/grub-install.in.

	* util/i386/pc/grub-install.in: New file.

	* conf/i386-pc.rmk (sbin_SCRIPTS): New variable.
	(grub_install_SOURCES): Likewise.

	* genmk.rb: Added support for scripts.
	(Script): New class.
	(scripts): New variable.

	* Makefile.in (install-local): Install sbin_SCRIPTS by
	INSTALL_SCRIPT.
	(uninstall): Remove sbin_SCRIPTS.

	* util/i386/pc/grub-setup.c (main): If the argument is not a GRUB
	device, try to get a GRUB device by
	grub_util_biosdisk_get_grub_dev.
	Free DEST_DEV.

	* util/i386/pc/grub-mkdevicemap.c (usage): Remove a duplicated
	description for --device-map.
2005-07-24 18:16:26 +00:00
okuji ebedfd0003 2005-07-17 Yoshinori Okuji <okuji@enbug.org>
* conf/i386-pc.rmk (pxeboot_img_LDFLAGS): The text address should
	be 0x7C00 instead of 0x8000.

	* boot/i386/pc/pxeboot.S: Rewritten.

	* kern/i386/pc/startup.S (gate_a20_try_bios): No need to specify
	EXT_C.
	(gate_a20_check_state): Read a byte from 0x108000. Invert the
	result.
2005-07-16 22:06:33 +00:00
okuji e0f050c2e4 2005-07-10 Yoshinori Okuji <okuji@enbug.org>
* DISTLIST: Added util/i386/pc/grub-mkimage.c.

	* conf/i386-pc.rmk (sbin_UTILITIES): Added grub-mkdevicemap.
	(grub_mkdevicemap_SOURCES): New variable.

	* util/i386/pc/grub-mkdevicemap.c: New file. Mostly copied from
	lib/device.c of GRUB Legacy.
2005-07-10 07:57:49 +00:00
okuji 062aaf39bc 2005-03-02 Yoshinori K. Okuji <okuji@enbug.org>
* term/i386/pc/vga.c (debug_command): Removed.
  (GRUB_MOD_INIT): Do not register the command "debug".

  From Hollis Blanchard:
  * commands/configfile.c: New file.
  * conf/i386-pc.rmk (grub_emu_SOURCES): Added
  commands/configfile.c.
  (pkgdata_MODULES): Added configfile.mod.
  (configfile_mod_SOURCES): New variable.
  (configfile_mod_CFLAGS): Likewise.
  * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Added
  commands/configfile.c.
  (pkgdata_MODULES): Added configfile.mod.
  (configfile_mod_SOURCES): New variable.
  (configfile_mod_CFLAGS): Likewise.
  * util/grub-emu.c (main): Call grub_configfile_init and
  grub_configfile_fini.
  * include/grub/normal.h [GRUB_UTIL] (grub_configfile_init): New
  prototype.
  [GRUB_UTIL] (grub_configfile_fini): Likewise.
2005-03-02 20:12:46 +00:00
okuji 93f3a1d868 2005-02-27 Yoshinori K. Okuji <okuji@enbug.org>
* commands/default.h: New file.
  * commands/timeout.h: Likewise.
  * normal/context.c: Likewise.

  * util/misc.c: Do not include sys/times.h.
  Include sys/time.h and grub/machine/time.h.
  (grub_get_rtc): Rewritten with gettimeofday.

  * util/grub-emu.c (main): Call grub_default_init and
  grub_timeout_init before grub_normal_init, and call
  grub_timeout_fini and grub_default_fini after grub_main.

  * util/console.c (grub_ncurses_checkkey): Return the read
  character or -1.

  * normal/menu.c (run_menu): Set MENU->TIMEOUT to -1 once it
  timeouts.

  * normal/main.c (read_config_file): Push MENU. If this fails,
  print an error and wait for a user input.
  Print an error only if GRUB_ERRNO is not GRUB_ERR_NONE.
  If a menu is empty or an error occurs, pop MENU.
  (grub_normal_execute): Pop and free MENU after grub_menu_run
  returns.

  * kern/loader.c (grub_loader_boot): Call grub_machine_fini.

  * include/grub/powerpc/ieee1275/time.h [GRUB_UTIL]: Do not
  include time.h.
  [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as
  without GRUB_UTIL.
  * include/grub/i386/pc/time.h [GRUB_UTIL]: Do not include
  time.h.
  [GRUB_UTIL] (GRUB_TICKS_PER_SECOND): Use the same definition as
  without GRUB_UTIL.

  * include/grub/normal.h (struct grub_menu_list): New struct.
  (grub_menu_list_t): New type.
  (struct grub_context): New struct.
  (grub_context_t): New type.
  (grub_register_command): Got rid of EXPORT_FUNC.
  (grub_unregister_command): Likewise.
  (grub_context_get): New prototype.
  (grub_context_get_current_menu): Likewise.
  (grub_context_push_menu): Likewise.
  (grub_context_pop_menu): Likewise.
  [GRUB_UTIL] (grub_default_init): Likewise.
  [GRUB_UTIL] (grub_default_fini): Likewise.
  [GRUB_UTIL] (grub_timeout_init): Likewise.
  [GRUB_UTIL] (grub_timeout_fini): Likewise.

  * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/default.c,
  commands/timeout.c and normal/context.c.
  (pkgdata_MODULES): Added default.mod and timeout.mod.
  (normal_mod_SOURCES): Added normal/context.c.
  (default_mod_SOURCES): New variable.
  (default_mod_CFLAGS): Likewise.
  (timeout_mod_SOURCES): Likewise.
  (timeout_mod_CFLAGS): Likewise.
  * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Copied from
  conf/i386-pc.rmk.
  (pkgdata_MODULES): Added default.mod and timeout.mod.
  (normal_mod_SOURCES): Added normal/context.c.
  (default_mod_SOURCES): New variable.
  (default_mod_CFLAGS): Likewise.
  (timeout_mod_SOURCES): Likewise.
  (timeout_mod_CFLAGS): Likewise.

  * Makefile.in (all-local): Added $(MKFILES).
2005-02-27 21:19:06 +00:00
marco_g 4ed2e1dd1c 2005-02-21 Vincent Pelletier <subdino2004@yahoo.fr>
* conf/i386-pc.rmk (grub_setup_SOURCES): Add `partmap/sun.c'.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add `sun.mod'.
	(sun_mod_SOURCES, sun_mod_CFLAGS): New variables.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
	`partmap/sun.c'.
	(pkgdata_MODULES): Add `sun.mod'.
	(sun_mod_SOURCES, sun_mod_CFLAGS): New variables.
	* include/grub/partition.h (grub_sun_partition_map_init): New
	prototype.
	(grub_sun_partition_map_fini): Likewise.
	* partmap/sun.c: New file.
	* util/grub-emu.c (main): Initialize and de-initialize the sun
	partitionmap support.
2005-02-21 22:00:32 +00:00
okuji 4d4e372ebd 2005-02-19 Yoshinori K. Okuji <okuji@enbug.org>
This implements an Emacs-like menu entry editor.

  * normal/menu_entry.c: New file.

  * util/console.c (grub_ncurses_putchar): Translate some Unicode
  characters to ASCII.
  (saved_char): New variable.
  (grub_ncurses_checkkey): Rewritten completely.
  (grub_ncurses_getkey): Likewise.
  (grub_ncurses_init): Call raw instead of cbreak.

  * normal/menu.c (print_entry): Do not put a space.
  (init_page): Renamed to ...
  (grub_menu_init_page): ... this. All callers changed.
  (edit_menu_entry): Removed.
  (run_menu): Call grub_menu_entry_run instead of edit_menu_entry.

  * normal/cmdline.c (grub_cmdline_run): Call grub_setcursor.

  * kern/misc.c (grub_vprintf): Call grub_refresh.

  * normal/menu.c (DISP_LEFT): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_LEFT): ... this.
  * normal/menu.c (DISP_UP): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_UP): ... this.
  * normal/menu.c (DISP_RIGHT): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_RIGHT): ... this.
  * normal/menu.c (DISP_DOWN): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_DOWN): ... this.
  * normal/menu.c (DISP_HLINE): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_HLINE): ... this.
  * normal/menu.c (DISP_VLINE): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_VLINE): ... this.
  * normal/menu.c (DISP_UL): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_UL): ... this.
  * normal/menu.c (DISP_UR): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_UR): ... this.
  * normal/menu.c (DISP_LL): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_LL): ... this.
  * normal/menu.c (DISP_LR): Renamed to ...
  * include/grub/term.h (GRUB_TERM_DISP_LR): ... this.
  * normal/menu.c (TERM_WIDTH): Renamed to ...
  * include/grub/term.h (GRUB_TERM_WIDTH): ... this.
  * normal/menu.c (TERM_HEIGHT): Renamed to ...
  * include/grub/term.h (GRUB_TERM_HEIGHT): ... this.
  * normal/menu.c (TERM_INFO_HEIGHT): Renamed to ...
  * include/grub/term.h (GRUB_TERM_INFO_HEIGHT): ... this.
  * normal/menu.c (TERM_MARGIN): Renamed to ...
  * include/grub/term.h (GRUB_TERM_MARGIN): ... this.
  * normal/menu.c (TERM_SCROLL_WIDTH): Renamed to ...
  * include/grub/term.h (GRUB_TERM_SCROLL_WIDTH): ... this.
  * normal/menu.c (TERM_TOP_BORDER_Y): Renamed to ...
  * include/grub/term.h (GRUB_TERM_TOP_BORDER_Y): ... this.
  * normal/menu.c (TERM_LEFT_BORDER_X): Renamed to ...
  * include/grub/term.h (GRUB_TERM_LEFT_BORDER_X): ... this.
  * normal/menu.c (TERM_BORDER_WIDTH): Renamed to ...
  * include/grub/term.h (GRUB_TERM_BORDER_WIDTH): ... this.
  * normal/menu.c (TERM_MESSAGE_HEIGHT): Renamed to ...
  * include/grub/term.h (GRUB_TERM_MESSAGE_HEIGHT): ... this.
  * normal/menu.c (TERM_BORDER_HEIGHT): Renamed to ...
  * include/grub/term.h (GRUB_TERM_BORDER_HEIGHT): ... this.
  * normal/menu.c (TERM_NUM_ENTRIES): Renamed to ...
  * include/grub/term.h (GRUB_TERM_NUM_ENTRIES): ... this.
  * normal/menu.c (TERM_FIRST_ENTRY_Y): Renamed to ...
  * include/grub/term.h (GRUB_TERM_FIRST_ENTRY_Y): ... this.
  * normal/menu.c (TERM_ENTRY_WIDTH): Renamed to ...
  * include/grub/term.h (GRUB_TERM_ENTRY_WIDTH): ... this.
  * normal/menu.c (TERM_CURSOR_X): Renamed to ...
  * include/grub/term.h (GRUB_TERM_CURSOR_X): ... this.
  All callers changed.

  * include/grub/normal.h: New prototype.

  * conf/i386-pc.rmk (grub_emu_SOURCES): Added
  normal/menu_entry.c.
  (normal_mod_SOURCES): Likewise.
  * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.
  (normal_mod_SOURCES): Likewise.

2005-02-15  Yoshinori K. Okuji  <okuji@enbug.org>

  * include/grub/normal.h (grub_halt_init): New prototype.
  (grub_halt_fini): Likewise.
  (grub_reboot_init): Likewise.
  (grub_reboot_fini): Likewise.

  * util/grub-emu.c: Include signal.h.
  (main_env): New global variable.
  (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot
  catch C-c.
  (grub_machine_fini): New function.
  (main): Call grub_halt_init and grub_reboot_init before
  grub_main, and grub_reboot_fini and grub_halt_fini after it.
  Call setjmp with MAIN_ENV to go back afterwards.
  Call grub_machine_fini right before return.

  * include/grub/util/misc.h: Include setjmp.h.
  (main_env): New prototype.

  * include/grub/kernel.h (grub_machine_fini): New prototype.
  * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise.
  * include/grub/i386/pc/console.h (grub_console_fini): Likewise.

  * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function.
  * kern/i386/pc/init.c (grub_machine_fini): Likewise.
  * term/i386/pc/console.c (grub_console_fini): Likewise.

  * util/i386/pc/misc.c: New file.

  * conf/i386-pc.rmk (grub_emu_SOURCES): Added
  util/i386/pc/misc.c, commands/i386/pc/halt.c and
  commands/i386/pc/reboot.c.
2005-02-19 20:56:07 +00:00
okuji e6b92c8afb 2005-02-15 Yoshinori K. Okuji <okuji@enbug.org>
* include/grub/normal.h (grub_halt_init): New prototype.
  (grub_halt_fini): Likewise.
  (grub_reboot_init): Likewise.
  (grub_reboot_fini): Likewise.

  * util/grub-emu.c: Include signal.h.
  (main_env): New global variable.
  (grub_machine_init): Ignore SIGINT. Otherwise grub-emu cannot
  catch C-c.
  (grub_machine_fini): New function.
  (main): Call grub_halt_init and grub_reboot_init before
  grub_main, and grub_reboot_fini and grub_halt_fini after it.
  Call setjmp with MAIN_ENV to go back afterwards.
  Call grub_machine_fini right before return.

  * include/grub/util/misc.h: Include setjmp.h.
  (main_env): New prototype.

  * include/grub/kernel.h (grub_machine_fini): New prototype.
  * include/grub/i386/pc/biosdisk.h (grub_biosdisk_fini): Likewise.
  * include/grub/i386/pc/console.h (grub_console_fini): Likewise.

  * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function.
  * kern/i386/pc/init.c (grub_machine_fini): Likewise.
  * term/i386/pc/console.c (grub_console_fini): Likewise.

  * util/i386/pc/misc.c: New file.

  * conf/i386-pc.rmk (grub_emu_SOURCES): Added
  util/i386/pc/misc.c, commands/i386/pc/halt.c and
  commands/i386/pc/reboot.c.
2005-02-15 00:07:01 +00:00
marco_g 990cf3aa8a 2005-01-31 Marco Gerards <metgerards@student.han.nl>
* commands/help.c: New file.
	* normal/arg.c (show_help): Renamed to...
	(grub_arg_show_help): ... this.
	* commands/i386/pc/halt.c: New file.
	* commands/i386/pc/reboot.c: Likewise.
	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/help.c'.
	(pkgdata_MODULES): Add `reboot.mod', `halt.mod' and `help.mod'.
	(help_mod_SOURCES, help_mod_CFLAGS, reboot_mod_SOURCES)
	(reboot_mod_CFLAGS, halt_mod_SOURCES, halt_mod_CFLAGS): New
	variables.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
	`commands/help.c'.
	(pkgdata_MODULES): Add `help.mod'.
	(help_mod_SOURCES, help_mod_CFLAGS): New variables.
	* grub/i386/pc/init.h (grub_reboot): New prototype.
	(grub_halt): Likewise.
	* include/grub/normal.h (grub_arg_show_help): New prototype.
	(grub_help_init): Likewise.
	(grub_help_fini): Likewise.
	* util/grub-emu.c (main): Initialize and deinitialize the help
	command.

	* normal/cmdline.c (grub_cmdline_get): Doc fix.

	* normal/command.c (grub_command_init): Fixed the description of
	the `set' and `unset' commands.
2005-01-31 21:40:25 +00:00
marco_g 67bbaf0f38 2005-01-21 Marco Gerards <metgerards@student.han.nl>
Add the loopback device, a device via which files can be accessed
	as devices.

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/loopback.c'.
	(pkgdata_MODULES): Add loopback.mod.
	(loopback_mod_SOURCES): New variable.
	(loopback_mod_CFLAGS): Likewise.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add
	`disk/loopback.c'.
	(pkgdata_MODULES): Add loopback.mod.
	(loopback_mod_SOURCES): New variable.
	(loopback_mod_CFLAGS): Likewise.
	* disk/loopback.c: new file.
	* include/grub/normal.h (grub_loop_init): New prototype.
	(grub_loop_fini): New prototype.
	* util/grub-emu.c (main): Initialize and de-initialize loopback
	support.
	* include/grub/disk.h (grub_disk_dev_id): Add
	`GRUB_DISK_DEVICE_LOOPBACK_ID'.
2005-01-21 21:32:03 +00:00
marco_g 3f1578fe4a 2004-12-04 Marco Gerards <metgerards@student.han.nl>
Modulize the partition map support and add support for the amiga
	partition map.

	* commands/ls.c: Include <grub/partition.h> instead of
	<grub/machine/partition.h>.
	* kern/disk.c: Likewise.
	* kern/rescue.c: Likewise.
	* loader/i386/pc/chainloader.c: Likewise.
	* normal/cmdline.c: Likewise.
	* kern/powerpc/ieee1275/init.c: Likewise.
	(grub_machine_init): Call `grub_pc_partition_map_init',
	`grub_amiga_partition_map_init' and
	`grub_apple_partition_map_init'.
	* conf/i386-pc.rmk (kernel_img_SOURCES): Remove
	`disk/i386/pc/partition.c'.  Add `kern/partition.c'.
	(kernel_img_HEADERS): Remove `machine/partition.h'.  Add
	`partition.h' and `pc_partition.h'.
	(grub_setup_SOURCES): Remove
	`disk/i386/pc/partition.c'.  Add `kern/partition.c',
	`partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add `amiga.mod', `apple.mod' and `pc.mod'.
	(amiga_mod_SOURCES, amiga_mod_CFLAGS, apple_mod_SOURCES)
	(apple_mod_CFLAGS, pc_mod_SOURCES, pc_mod_CFLAGS): New variables.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove
	`disk/powerpc/ieee1275/partition.c'.  Add `kern/partition.c',
	`partmap/amiga.c', `partmap/apple.c' and `partmap/pc.c'.
	(grubof_SOURCES): Likewise.
	* disk/i386/pc/partition.c: File removed.
	* disk/powerpc/ieee1275/partition.c: Likewise.
	* include/grub/powerpc/ieee1275/partition.h: Likewise.
	* include/grub/i386/pc/partition.h: Likewise.
	* kern/partition.c: New file.
	* partmap/amiga.c: Likewise.
	* partmap/apple.c: Likewise.
	* partmap/pc.c: Likewise.
	* include/grub/partition.h: Likewise..
	* include/grub/pc_partition.h: Likewise.
	* util/grub-emu.c: Include <grub/partition.h> instead of
	<grub/machine/partition.h>.
	(main): Call `grub_pc_partition_map_init',
	`grub_amiga_partition_map_init' and
	`grub_apple_partition_map_init' and deinitialize afterwards.
	* util/i386/pc/biosdisk.c: Include `#include
	<grub/partition.h>' and `include <grub/pc_partition.h>' instead of
	`<grub/machine/partition.h>'.
	* util/i386/pc/grub-setup.c: Likewise.
	* util/i386/pc/biosdisk.c: Likewise.
	(grub_util_biosdisk_get_grub_dev): Only access the PC specific
	partition information in case of a PC partition.
	* util/i386/pc/grub-setup.c: Include `#include
	<grub/partition.h>' and `include <grub/pc_partition.h>' instead of
	`<grub/machine/partition.h>'.
	(setup): Only access the PC specific partition information in case
	of a PC partition.
2004-12-04 18:45:46 +00:00
marco_g ad0bd20b79 2004-11-01 Marco Gerards <metgerards@student.han.nl>
Add support for iso9660 (including rockridge).

	* conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
	(iso9660_mod_SOURCES): New variable.
	(iso9660_mod_CFLAGS): Likewise.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/iso9660.c.
	* include/grub/fs.h (grub_iso9660_init): New prototype.
	* util/grub-emu.c (main): Call `grub_iso9660_init'.
	* fs/iso9660.c: New file.

	* include/grub/misc.h (grub_strncat): New prototype.
	* kern/misc.c (grub_strncat): New function.

	* fs/hfs.c (grub_hfs_mount): Translate the error
	`GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'.
	* fs/jfs.c (grub_jfs_mount): Likewise.
	* fs/ufs.c (grub_ufs_mount): Likewise.
2004-11-01 16:14:16 +00:00
marco_g b47efe305a 2004-09-17 Marco Gerards <metgerards@student.han.nl>
Add `linux.mod' and `multiboot.mod' so linux and multiboot kernels
	can be loaded from normal mode.

	* conf/i386-pc.rmk (pkgdata_MODULES): Add `linux.mod' and
	`multiboot.mod'.
	(linux_mod_SOURCES, linux_mod_CFLAGS, multiboot_mod_SOURCES)
	(multiboot_mod_CFLAGS): New variables.
	* loader/i386/pc/linux_normal.c: New file.
	* loader/i386/pc/multiboot_normal.c: Likewise.

	* loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the
	attribute `unused'.

	* fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type.  Use
	`fdiro' to read the mode information from instead of `diro'.

	* fs/fshelp.c (grub_fshelp_find_file): Set type to foundtype after
	looking up a symlink.

	* include/grub/normal.h (GRUB_COMMAND_FLAG_NO_ARG_PARSE): New
	macro.
	* normal/command.c (grub_command_execute): Don't parse the
	arguments when `GRUB_COMMAND_FLAG_NO_ARG_PARSE' is set in the
	flags of the command.

	* normal/menu.c (grub_menu_run): Fix typo.
2004-09-17 09:36:52 +00:00
marco_g 8ddad8453b 2004-09-12 Tomas Ebenlendr <ebik@ucw.cz>
Added normal mode command `chainloader' as module chain.mod, which
	depends on normal.mod and _chain.mod.

	* conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'.
	(chain_mod_SOURCES, chain_mod_CFLAGS): Variables added.
	* include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader):
	Deleted prototype.
	* loader/i386/pc/chainloader.c (grub_rescue_cmd_chainloader): All
	but arguments parsing moved to ...
	(grub_chainloader_cmd): ... here.  New function.
	* include/grub/i386/pc/chainloader.h: New file.
	* loader/i386/pc/chainloader_normal.c: Likewise.
2004-09-12 12:20:52 +00:00
marco_g 2c1f4ce368 2004-09-11 Marco Gerards <metgerards@student.han.nl>
* conf/i386-pc.rmk (kernel_img_SOURCES): Added kern/fshelp.c.
	(grub_mkimage_LDFLAGS): Likewise.
	(grub_emu_SOURCES): Likewise.
	(kernel_img_HEADERS): Added fshelp.h.
	* fs/ext2.c: Include <grub/fshelp.h>.
	(FILETYPE_REG): New macro.
	(FILETYPE_INO_REG): Likewise.
	(grub_ext_sblock): Renamed to `grub_ext2_sblock'.
	Changed all users.
	(ext2_block_group): Renamed to `grub_ext2_block_group'.  Changed
	all users.
	(grub_fshelp_node): New struct.
	(grub_ext2_data): Added member `diropen'.  Changed member `inode'
	to a pointer.
	(grub_ext2_get_file_block): Removed function.
	(grub_ext2_read_block): New function.
	(grub_ext2_read_file): Replaced parameter `data' by `node'.
	This function was written.
	(grub_ext2_mount): Read the root inode.  Create a diropen struct.
	(grub_ext2_find_file): Removed function.
	(grub_ext2_read_symlink): New function.
	(grub_ext2_iterate_dir): Likewise.
	(grub_ext2_open): Rewritten.
	(grub_ext2_dir): Rewritten.
	* include/grub/fshelp.h: New file.
	* fs/fshelp.c: Likewise.
2004-09-11 11:42:43 +00:00
okuji 3c52136a94 2004-09-10 Yoshinori K. Okuji <okuji@enbug.org>
* normal/menu.c: Include grub/loader.h and grub/machine/time.h.
  (print_message): Add a missing newline.
  (run_menu): Added timeout support.
  (run_menu_entry): New local function.
  (grub_menu_run): Added support for booting.

  * kern/loader.c (grub_loader_is_loaded): New function.

  * include/grub/powerpc/ieee1275/time.h: Include grub/symbol.h.
  (grub_get_rtc): Exported.

  * include/grub/i386/pc/time.h: Include grub/symbol.h.
  (grub_get_rtc): Exported.

  * include/grub/normal.h (struct grub_command_list): Remove
  constant from the member `command'.

  * include/grub/loader.h (grub_loader_is_loaded): Declared.

  * include/grub/err.h (GRUB_ERR_INVALID_COMMAND): New constant.

  * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/time.h.
2004-09-10 20:31:55 +00:00
marco_g aa0335603c 2004-08-28 Marco Gerards <metgerards@student.han.nl>
Add support for the JFS filesystem.

	* fs/jfs.c: New file.
	* include/grub/fs.h (grub_jfs_init): New prototype.
	(grub_jfs_fini): New prototype.
	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/jfs.c.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add jfs.mod.
	(jfs_mod_SOURCES): New variable.
	(jfs_mod_CFLAGS): Likewise.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs.jfs.c.
	(grubof_SOURCES): Likewise.
	* util/grub-emu.c (main): Initialize and deinitialize JFS support.

	* fs/fat.c (grub_fat_find_dir): Convert the filename little
	endian to the host endian.
	(grub_fat_utf16_to_utf8): Move function from there...
	* kern/misc.c (grub_utf16_to_utf8): ...to here.  Do not convert
	the endianess of the source string anymore.
	* include/grub/misc.h (grub_utf16_to_utf8): New prototype.
2004-08-28 13:14:29 +00:00
marco_g 64372eb442 2004-08-18 Marco Gerards <metgerards@student.han.nl>
* fs/hfs.c: New file.
	* conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/hfs.c.
	(grub_emu_SOURCES): Likewise.
	(pkgdata_MODULES): Add hfs.mod.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add fs/hfs.c.
	(grubof_SOURCES): Likewise.
	* util/grub-emu.c (main): Initialize and deinitialize HFS support.

	* include/grub/misc.h (grub_strncasecmp): Add prototype.
	* kern/misc.c (grub_strncasecmp): Add function.
2004-08-18 09:00:01 +00:00