Commit graph

186 commits

Author SHA1 Message Date
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
marco_g
c0111d6e92 2006-04-30 Marco Gerards <marco@gnu.org>
* commands/configfile.c (grub_cmd_source): New function.
	(GRUB_MOD_INIT): Register the commands `source' and `.'.
	(GRUB_MOD_FINI): De-register the commands `source' and `.'.
2006-04-30 20:48:05 +00:00
marco_g
eaef05533f 2006-04-29 Marco Gerards <marco@gnu.org>
* commands/configfile.c (grub_cmd_configfile): Execute the
	configfile within its own context.

	* include/grub/env.h (grub_env_context_open): New prototype.
	(grub_env_context_close): Likewise.

	* kern/env.c (grub_env): Removed.
	(grub_env_sorted): Likewise.
	(grub_env_context): New variable.
	(grub_env_var_context): Likewise.
	(grub_env_find): Search both the active context and the global
	context.
	(grub_env_context_open): New function.
	(grub_env_context_close): Likewise.
	(grub_env_insert): Likewise.
	(grub_env_remove): Likewise.
	(grub_env_export): Likewise.
	(grub_env_set): Changed to use helper functions to avoid code
	duplication.
	(grub_env_iterate): Rewritten so both the current context and the
	global context are being used.

	* normal/command.c (export_command): New function.
	(grub_command_init): Register the `export' function.
2006-04-29 20:29:42 +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
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
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
hollisb
9046bcf0e6 2005-11-09 Hollis Blanchard <hollis@penguinppc.org>
* term/ieee1275/ofconsole.c (grub_ofconsole_cls): Use both the ANSI
	escape sequence and a literal ^L to clear the screen.

	* commands/ieee1275/suspend.c (grub_cmd_suspend): Clear the screen
	when returning from Open Firmware.
2005-11-10 01:57:52 +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
okuji
25fe6f0349 2005-10-28 Yoshinori K. Okuji <okuji@enbug.org>
From Timothy Baldwin:
        * commands/ls.c (grub_ls_list_files): Close FILE with
        grub_file_close.
        * kern/misc.c (grub_vsprintf): Terminate the string S with NUL.
2005-10-28 03:14:33 +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
0bd41162dd Update source to follow GCS more precisely. 2005-08-16 18:34:17 +00:00
chaac
6323696adf Added first version of the VBE terminal code. 2005-08-15 21:25:41 +00:00
hollisb
3be7266d92 2005-08-03 Hollis Blanchard <hollis@penguinppc.org>
* include/grub/powerpc/ieee1275/ieee1275.h: Move ...
	* include/grub/ieee1275/ieee1275.h: ... to here.  All users updated.
	Move `abort', `grub_reboot', and `grub_halt' prototypes ...
	* include/grub/powerpc/ieee1275/kernel.h: ... to here.
	* commands/ieee1275/halt.c: Include <grub/machine/kernel.h> instead
	of <grub/machine/ieee1275.h>.
	* commands/ieee1275/reboot.c: Likewise.
	* boot/powerpc/ieee1275/ieee1275.c: Move ...
	* kern/ieee1275.c: ... to here.  All users updated.  Change all
	parameter structs to use new type `grub_ieee1275_cell_t'.
	* term/powerpc/ieee1275/ofconsole.c: Move ...
	* term/ieee1275/ofconsole.c: ... to here.  All users updated.
	* disk/powerpc/ieee1275/ofdisk.c: Move ...
	* disk/ieee1275/ofdisk.c: ... to here.  All users updated.
	* boot/powerpc/ieee1275/cmain.c: Change `grub_ieee1275_entry_fn' type
	to return int.
	* include/grub/i386/pc/console.h: Move to include/grub/console.h.
	Remove unused prototypes.  All users updated.
	* include/grub/powerpc/ieee1275/console.h: Removed.
	* include/grub/powerpc/ieee1275/ieee1275.h: Define
	`grub_ieee1275_cell_t'.
	* kern/powerpc/ieee1275/openfw.c: Include <grub/machine/kernel.h>.
	Cast comparisons with -1 to the correct type.
	* loader/powerpc/ieee1275/linux.c (kernel_entry_t): Change parameter
	type to match `grub_ieee1275_entry_fn'.
2005-08-03 22:53:51 +00:00
okuji
ea4097134f 2005-07-31 Yoshinori K. Okuji <okuji@enbug.org>
* loader/i386/pc/multiboot.c (grub_multiboot_is_elf32): New
	function.
	(grub_multiboot_load_elf32): Likewise.
	(grub_multiboot_is_elf64): Likewise.
	(grub_multiboot_load_elf64): Likewise.
	(grub_multiboot_load_elf): Likewise.
	(grub_rescue_cmd_multiboot): Call grub_multiboot_load_elf to load
	an ELF32 or ELF64 file.
	This is based on a patch from Ruslan Nikolaev <nruslan@mail.com>.

	From Serbinenko Vladimir <serbinenko.vova@list.ru>:
	* kern/disk.c (grub_print_partinfo): Check if FS->LABEL is not
	NULL before calling FS->LABEL.
	* fs/fat.c (grub_fat_dir): Initialize DIRNAME to NULL.
	* commands/ls.c (grub_ls_list_files): Show labels, if possible.
	(grub_ls_list_disks): Check if FS and FS->LABEL are not NULL
	before calling FS->LABEL.
2005-07-31 16:12:29 +00:00
okuji
5f968e1e61 2005-07-20 Yoshinori K. Okuji <okuji@enbug.org>
Change the semantics of variable hooks. They now return	strings
	instead of error values.

	* util/i386/pc/grub-setup.c: Include grub/env.h.
	(setup): Use grub_device_set_root instead of grub_env_set.

	* kern/rescue.c (grub_rescue_cmd_root): Use grub_env_set and
	grub_env_get instead of grub_device_set_root and
	grub_device_get_root, respectively.

	* kern/main.c (grub_env_write_root): New function.
	(grub_set_root_dev): Register grub_env_write_hook for "root". Use
	grub_env_set instead of grub_device_set_root.

	* kern/env.c (HASHSZ): Reduced to 13, because GRUB does not need
	many variables.
	(grub_env_set): Set ENV->VALUE to the result of ENV->WRITE_HOOK
	rather than calling ENV->WRITE_HOOK afterwards.
	(grub_env_get): Return the result of ENV->READ_HOOK rather than
	passing a pointer of a pointer.
	(grub_register_variable_hook): Change the types of "read_hook" and
	"write_hook" to grub_env_read_hook_t and grub_env_write_hook_t,
	respectively.
	Allocate the default empty string on the heap, because this string
	may be freed later.

	* kern/device.c: Include grub/env.h.
	(grub_device_set_root): Removed.
	(grub_device_get_root): Likewise.
	(grub_device_open): Use grub_env_get instead of
	grub_device_get_root.

	* include/grub/env.h (grub_env_read_hook_t): New type.
	(grub_env_write_hook_t): Likewise.
	(grub_env_var): Change the types of "read_hook" and "write_hook"
	to grub_env_read_hook_t and grub_env_write_hook_t, respectively.
	(grub_register_variable_hook): Likewise.

	* include/grub/device.h (grub_device_set_root): Removed.
	(grub_device_set_root): Likewise.

	* fs/fat.c (grub_fat_dir): Make a copy of PATH in DIRNAME, and
	make sure that DIRNAME terminates with '/', so that
	grub_fat_find_dir will fail if PATH is not a directory.

	* commands/ls.c (grub_ls_list_files): Remove the qualifier const
	from DIRNAME.
	Use the qualifier auto for print_files and print_files_long.
	If FS->DIR sets GRUB_ERRNO to GRUB_ERR_BAD_FILE_TYPE, try DIRNAME
	as a regular file.
	Put a newline only if there is no error.
	(grub_cmd_ls): Remove grub_ls_print_files, because this is not
	used.
2005-07-20 20:30:46 +00:00
okuji
5f3607e09d 2005-07-18 Yoshinori K. Okuji <okuji@enbug.org>
* commands/ls.c (grub_ls_list_disks): Print the filesystem
	information on each device, if it does not have partitions. Print
	"Device" instead of "Disk", because this function is not specific
	to disk devices.

	* normal/main.c (grub_rescue_cmd_normal): Make the variable CONFIG
	static to ensure that it is put on the memory rather than a
	register.
2005-07-18 20:30:37 +00:00
okuji
502c87e80e 2005-07-17 Yoshinori Okuji <okuji@enbug.org>
* commands/cat.c (GRUB_MOD_INIT): Use better documentation.
	(grub_cat_init): Likewise.
	* loader/i386/pc/chainloader_normal.c (GRUB_MOD_INIT): Likewise.
	(options): Likewise.
	* commands/configfile.c (GRUB_MOD_INIT): Likewise.
	(grub_configfile_init): Likewise.
	* font/manager.c (GRUB_MOD_INIT): Likewise.
	* commands/help.c (GRUB_MOD_INIT): Likewise.
	(grub_help_init): Likewise.
	* normal/command.c (grub_command_init): Likewise.
	* loader/i386/pc/linux_normal.c (GRUB_MOD_INIT): Likewise.
	* disk/loopback.c (grub_loop_init): Likewise.
	(GRUB_MOD_INIT): Likewise.
	* commands/ls.c (grub_ls_init): Likewise.
	(GRUB_MOD_INIT): Likewise.
	(options): Likewise.
	* commands/boot.c (grub_boot_init): Likewise.
	(GRUB_MOD_INIT): Likewise.
	* loader/i386/pc/multiboot_normal.c (GRUB_MOD_INIT): Likewise.
	* commands/i386/pc/reboot.c (grub_reboot_init): Likewise.
	(GRUB_MOD_INIT): Likewise.
	* commands/cmp.c (grub_cmp_init): Likewise.
	(GRUB_MOD_INIT): Likewise.

	* normal/arg.c: Use <> instead of "" to include header files.
	(SHORT_ARG_HELP): New macro.
	(SHORT_ARG_USAGE): Likewise.
	(help_options): Specify SHORT_ARG_HELP and SHORT_ARG_USAGE instead
	of 'h' and 'u' for help and usage, respectively. Use more GNU-like
	descriptions.
	(find_short): Check if C is 'h' or 'u' explicitly.
	(grub_arg_show_help): Use space characters instead of tabs. Treat
	SHORT_ARG_HELP and SHORT_ARG_USAGE exceptionally so that -h and -u
	are shown with --help and --usage only if they are not used for
	the command itself.
	(parse_option): Use SHORT_ARG_HELP and SHORT_ARG_USAGE instead of
	'h' and 'u'.

	* include/grub/arg.h (struct grub_arg_option): Add the qualifier
	const into "longarg". Change the type of "shortarg" to int.
2005-07-17 20:26:07 +00:00
okuji
7224189a46 2005-07-10 Yoshinori Okuji <okuji@enbug.org>
* commands/ls.c (grub_ls_list_files): Check if *PATH is NUL
	instead of PATH is NULL.
2005-07-10 07:02:48 +00:00
subdino
68c864ebb6 2005-07-09 Vincent Pelletier <subdino2004@yahoo.fr>
* commands/cmp.c (BUFFER_SIZE): New macro.
	(grub_cmd_cmp): Close the right file at the right time.  Compare
	only data just read.  Don't report files of different  size as
	identical.  Dynamically allocate buffers.  Move variable
	declarations at the beginning of function.
2005-07-09 16:29:02 +00:00
hollisb
a5ce3a4a04 2005-03-26 Hollis Blanchard <hollis@penguinppc.org>
* commands/ieee1275/halt.c (grub_cmd_halt): Call grub_halt
	instead of grub_ieee1275_interpret.
	(grub_halt_init): New function.
	(grub_halt_fini): Likewise.
	(GRUB_MOD_INIT): Correct message grammar.
	* commands/ieee1275/reboot.c (grub_cmd_reboot): Call grub_reboot
	instead of grub_ieee1275_interpret.
	(grub_reboot_init): New function.
	(grub_reboot_fini): Likewise.
	* conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Replace
	commands/i386/pc/halt.c, commands/i386/pc/reboot.c, and
	util/i386/pc/misc.c with commands/ieee1275/halt.c,
	commands/ieee1275/reboot.c, and util/powerpc/ieee1275/misc.c.
	* disk/powerpc/ieee1275/ofdisk.c (grub_ofdisk_fini): New
	function.
	* include/grub/powerpc/ieee1275/console.h (grub_console_fini):
	Add prototype.
	* include/grub/powerpc/ieee1275/ieee1275.h (grub_reboot): Add
	prototype.
	(grub_halt): Likewise.
	* include/grub/powerpc/ieee1275/init.h: Remove inaccurate comment.
	(cmain): Remove __attribute__((unused)).
	* kern/powerpc/ieee1275/init.c (grub_heap_start): New variable.
	(grub_heap_len): Likewise.
	(grub_machine_fini): New function.
	* kern/powerpc/ieee1275/openfw.c (grub_reboot): New function.
	(grub_halt): Likewise.
	* term/powerpc/ieee1275/ofconsole.c (grub_console_fini): New
	function.
	* util/powerpc/ieee1275/misc.c: New file.
2005-03-26 17:34:50 +00:00
okuji
5822ff87a2 2005-03-08 Yoshinori Okuji <okuji@enbug.org>
Automatic loading of commands is supported.

  * normal/main.c (read_command_list): New function.
  (grub_normal_execute): Call read_command_list.

  * normal/command.c (grub_register_command): Return zero or CMD.
  Allocate CMD->NAME from the heap.
  Initialize CMD->MODULE_NAME to zero.
  Find the same name as well. If the same command is found and it is
  a dummy command, overwrite members. If it is not a dummy command,
  return zero.
  (grub_unregister_command): Free Q->NAME and Q->MODULE_NAME.
  (grub_command_find): If a dummy command is found, load a module
  and retry to find a command only once.

  * normal/cmdline.c (grub_tab_complete): Call grub_command_find to
  make sure that each command is loaded.

  * include/grub/normal.h (GRUB_COMMAND_FLAG_NOT_LOADED): New
  macro.
  (struct grub_command): Remove const from the member `name'.
  Add a new member `module_name'.
  (grub_register_command): Return grub_command_t.

  * commands/help.c (grub_cmd_help): Call grub_command_find to make
  sure that each command is loaded.

  * genmk.rb (PModule::rule): Specify a module name without the
  suffix ".mod" to gencmdlist.sh.
2005-03-08 01:01:06 +00:00
okuji
f56ed13487 Forgot to add configfile.c. 2005-03-02 20:13:20 +00:00
okuji
cee01aa683 2005-02-27 Yoshinori K. Okuji <okuji@enbug.org>
* normal/arg.c (grub_arg_show_help): Do not show the bug report
  address.

  * commands/help.c (grub_cmd_help): Do not print newlines after
  the last command in print_command_help.
2005-02-27 22:19:55 +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
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
0f79cdc1db 2005-01-30 Marco Gerards <metgerards@student.han.nl>
* boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_interpret): New
	function.
	* commands/ieee1275/halt.c: New file.
	* commands/ieee1275/reboot.c: Likewise.
	* commands/ieee1275/suspend.c (grub_cmd_suspend): Use
	`__attribute__ ((unused))'.  Some GCS related fixed.
	(grub_suspend_init) [GRUB_UTIL]: Function removed.
	(grub_suspend_fini): Likewise.
	* conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add `reboot.mod'
	and `halt.mod'.
	(reboot_mod_SOURCES, reboot_mod_CFLAGS, halt_mod_SOURCES)
	(halt_mod_CFLAGS): New variables.
	* include/grub/powerpc/ieee1275/ieee1275.h
	(grub_ieee1275_interpret): New prototype.
2005-01-31 21:28:34 +00:00
hollisb
6f1c18bd82 2005-01-20 Hollis Blanchard <hollis@penguinppc.org>
* boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_enter): New
	function.
	* conf/powerpc-ieee1275.rmk (pkgdata_MODULES): Add suspend.mod.
	(suspend_mod_SOURCES): New variable.
	(suspend_mod_CFLAGS): Likewise.
	* include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_enter):
	New prototype.
	* commands/ieee1275/suspend.c: New file.
2005-01-21 02:45: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
8a572cd742 2004-09-22 Hollis Blanchard <hollis@penguinppc.org>
* commands/ls.c (grub_ls_list_files): Use the string following the
	initial ')', if present, as the filesystem path.
	* kern/rescue.c (grub_rescue_cmd_ls): Likewise.

	* conf/powerpc-ieee1275.rmk (grubof_SOURCES): List crt0.S first.
2004-09-22 18:26:16 +00:00
marco_g
94bc45af05 2004-08-24 Marco Gerards <metgerards@student.han.nl>
* commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional.
	(grub_boot_fini) [GRUB_UTIL]: Likewise.
	(GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise.
	(GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise.

	* fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'.
	(grub_hfs_iterate_dir): Make the function static.  Add prototypes
	for `node_found' and `it_dir'.
	(grub_hfs_dir): Add prototype for `dir_hook'.

	* fs/minix.c (grub_minix_get_file_block): Add prototype for
	`grub_get_indir'.  Rename `indir' in two blocks to `indir16'
	and `indir32' to silence a gcc warning.

	* include/grub/fs.h (grub_hfs_init): New prototype.
	(grub_hfs_fini): Likewise.
2004-08-24 20:32:47 +00:00
marco_g
a447c5dfb2 2004-07-27 Marco Gerards <metgerards@student.han.nl>
* boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_release): New
	function.
	* commands/boot.c: Remove the check for `GRUB_UTIL'.
	* conf/powerpc-ieee1275.rmk (grubof_SOURCES): Add
	`loader/powerpc/ieee1275/linux.c',
	`loader/powerpc/ieee1275/linux_normal.c' and `commands/boot.c'.
	* include/grub/powerpc/ieee1275/ieee1275.h
	(grub_ieee1275_release): New prototype.
	* include/grub/powerpc/ieee1275/loader.h: Rewritten.
	* kern/powerpc/ieee1275/init.c (grub_machine_init): Initialize
	normal, boot, linux and linux_normal.
	* loader/powerpc/ieee1275/linux.c: New file.
	* loader/powerpc/ieee1275/linux_normal.c: Likewise.
2004-07-27 17:47:37 +00:00
okuji
4b13b216f4 2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
All symbols prefixed with PUPA_ and pupa_ are renamed to GRUB_
	and grub_, respectively. Because the conversion is trivial and
	mechanical, I omit the details here. Please refer to the CVS
	if you need more information.
2004-04-04 13:46:03 +00:00
marco_g
db1771cfbe 2004-03-14 Marco Gerards <metgerards@student.han.nl>
* commands/boot.c: New file.
	* commands/cat.c: Likewise.
	* commands/cmp.c: Likewise.
	* commands/ls.c: Likewise.
	* commands/terminal.c: Likewise.
	* normal/command.c: Include <pupa/env.h> and <pupa/dl.h>.
	(pupa_register_command): Changed interface to match the new
	argument parser.
	(pupa_command_execute): Changed (almost rewritten) so it uses
	pupa_split_command.  Added support for setting variables using the
	syntax `foo=bar'.
	(rescue_command): Changed to work with the new argument parser.
	(terminal_command): Moved from here to commands/terminal.c.
	(set_command): New function.
	(unset_command): New function.
	(insmod_command): New function.
	(rmmod_command): New function.
	(lsmod_command): New function.
	(pupa_command_init): Don't initialize the command terminal
	anymore.  Initialize the commands set, unset, insmod, rmmod and
	lsmod.
	* conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/env.c.
	(kernel_img_HEADERS): Add arg.h and env.h.
	(pupa_mkimage_LDFLAGS): Add kern/env.c.
	(pupa_emu_SOURCES): Add kern/env.c, commands/ls.c,
	commands/terminal.c commands/boot.c commands/cmp.c commands/cat.c,
	normal/arg.c.
	(pkgdata_MODULES): Add ls.mod, boot.mod, cmp.mod, cat.mod and
	terminal.mod.
	(normal_mod_SOURCES): Add normal/arg.c and normal/arg.c.
	(boot_mod_SOURCES): New variable.
	(terminal_mod_SOURCES): Likewise.
	(ls_mod_SOURCES): Likewise.
	(cmp_mod_SOURCES): Likewise.
	(cat_mod_SOURCES): Likewise.

	* normal/arg.c: New file.
	* kern/env.c: Likewise.
	* include/pupa/arg.h: Likewise.
	* include/pupa/env.h: Likewise.
	* font/manager.c (font_command): Changed to match argument parsing
	interface changes.
	(PUPA_MOD_INIT): Likewise.
	* hello/hello.c (pupa_cmd_hello): Likewise.
	(PUPA_MOD_INIT): Likewise.
	* include/pupa/disk.h: Include <pupa/device.h>.
	(pupa_print_partinfo): New prototype.
	* include/pupa/dl.h (pupa_dl_set_prefix): Prototype removed.
	(pupa_dl_get_prefix): Likewise.
	* include/pupa/misc.h: Include <pupa/err.h>.
	(pupa_isgraph): New prototype.
	(pupa_isdigit): Likewise.
	(pupa_split_cmdline): Likewise.
	* include/pupa/normal.h: Include <pupa/arg.h>.
	(pupa_command): Changed the prototype of the member `func' to
	match the argument parsing interface.  Added member `options'.
	(pupa_register_command): Updated to match function.
	(pupa_arg_parse): New prototype.
	(pupa_hello_init) [PUPA_UTIL]: New prototype.
	(pupa_hello_fini) [PUPA_UTIL]: Likewise.
	(pupa_ls_init) [PUPA_UTIL]: Likewise.
	(pupa_ls_fini) [PUPA_UTIL]: Likewise.
	(pupa_cat_init) [PUPA_UTIL]: Likewise.
	(pupa_cat_fini) [PUPA_UTIL]: Likewise.
	(pupa_boot_init) [PUPA_UTIL]: Likewise.
	(pupa_boot_fini) [PUPA_UTIL]: Likewise.
	(pupa_cmp_init) [PUPA_UTIL]: Likewise.
	(pupa_cmp_fini) [PUPA_UTIL]: Likewise.
	(pupa_terminal_init) [PUPA_UTIL]: Likewise.
	(pupa_terminal_fini) [PUPA_UTIL]: Likewise.
	* kern/disk.c: Include <pupa/file.h>.
	(pupa_print_partinfo): New function.
	* kern/dl.c: Include <pupa/env.h>.
	(pupa_dl_dir): Variable removed.
	(pupa_dl_load): Use the environment variable `prefix' instead of
	the variable pupa_dl_dir.
	(pupa_dl_set_prefix): Function removed.
	(pupa_dl_get_prefix): Likewise.
	* kern/i386/pc/init.c: Include <pupa/env.h>.
	(pupa_machine_init): Use the environment variable `prefix' instead of
	using pupa_dl_set_prefix to set the prefix.
	* kern/main.c: Include <pupa/env.h>.
	(pupa_set_root_dev): Use the environment variable `prefix' instead of
	using pupa_dl_get_prefix to get the prefix.
	* kern/misc.c: Include <pupa/env.h>.
	(pupa_isdigit): New function.
	(pupa_isgraph): Likewise.
	(pupa_ftoa): Likewise.
	(pupa_vsprintf): Added support for printing values of the type
	`double'.  Make it possible to format variable output when using
	formatting like `%1.2%f'.
	(pupa_split_cmdline): New function.
	* kern/rescue.c: Include <pupa/env.h>.
	(next_word): Removed function.
	(pupa_rescue_cmd_prefix): Likewise.
	(pupa_rescue_cmd_set): New function.
	(pupa_rescue_cmd_unset): New function.
	(pupa_enter_rescue_mode): Use the `pupa_split_cmdline' function to
	split the command line instead of splitting it here.  Added
	support for setting variables using the syntax `foo=bar'.  Don't
	initialize the prefix command anymore.  Initialized the set and
	unset commands.
	* normal/cmdline.c: Include <pupa/env.h>.
	(pupa_tab_complete): Added prototypes for print_simple_completion,
	print_partition_completion, add_completion, iterate_commands,
	iterate_dev, iterate_part and iterate_dir. Moved code to print
	partition information from here to kern/disk.c.
	(pupa_cmdline_run): Don't check if the funtion exists anymore.
	* normal/main.c: Include <pupa/env.h>.
	(pupa_rescue_cmd_normal): Use the environment variable `prefix'
	instead of using pupa_dl_get_prefix to get the prefix.
	* term/i386/pc/vga.c: Include <pupa/arg.h>.
	(check_vga_mem): Cast pointers to `void *' to silence a gcc
	warning.
	(pupa_vga_putchar) [! DEBUG_VGA]: Removed for this case.
	(pupa_vga_setcolor): Declare unused variables with `__attribute__
	((unused))' to silence a gcc warning.
	(pupa_vga_setcolor): Likewise.
	(debug_command): Changed to match argument parsing
	interface changes.
	* util/pupa-emu.c: Include <pupa/env.h>.
	(options): Added 0's for unused fields to silence a gcc warning.
	(argp): Likewise.
	(main): Use the environment variable `prefix' instead of using
	pupa_dl_set_prefix to set the prefix.  Initialize the commands ls,
	boot, cmp, cat and terminal.  Finish the commands boot, cmp, cat
	and terminal.

	* util/i386/pc/getroot.c: Include <pupa/i386/pc/util/biosdisk.h>.
	* util/misc.c: Include <malloc.h>.
	(pupa_malloc): Rewritten so errors are correctly reported.
	(pupa_realloc): Likewise.
	(pupa_memalign): Likewise.
	(pupa_mm_init_region): Declare unused variables with
	`__attribute__ ((unused))' to silence a gcc warning.
	* normal/i386/setjmp.S: Remove tab at the end of the file to
	silence a gcc warning.
	* loader/i386/pc/linux.c (pupa_rescue_cmd_initrd): Declare unused
	variables with `__attribute__ ((unused))' to silence a gcc
	warning.
	* loader/i386/pc/multiboot.c (pupa_multiboot_unload): Make the
	local variable i unsigned to silence a gcc warning.

	* kern/term.c: Include <pupa/misc.h>.
	(pupa_more_lines): New variable.
	(pupa_more): Likewise.
	(pupa_putcode): When the pager is active pause at the end of every
	screen.
	(pupa_set_more): New function.
	* include/pupa/term.h (pupa_set_more): New prototype.
2004-03-13 13:59:25 +00:00