Commit Graph

48 Commits

Author SHA1 Message Date
okuji 5a79f472c7 2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
Migrate to GNU General Public License Version 3.

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

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

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

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

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

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

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

	* util/i386/pc/grub-install.in: Use newly provided
	make_system_path_relative_to_its_root() to convert ${grubdir}, then
	pass the result to grub-install --prefix.
2007-06-21 21:01:11 +00:00
robertmh 2d1a40a90c 2007-05-16 Robert Millan <rmh@aybabtu.com>
* include/grub/i386/pc/util/biosdisk.h: Moved to ...
	* include/grub/util/biosdisk.h: ... here.
	* util/i386/pc/biosdisk.c: Moved to ...
	* util/biosdisk.c: ... here.
	* util/i386/pc/getroot.c: Moved to ...
	* util/getroot.c: ... here.
	* util/i386/pc/grub-mkdevicemap.c: Moved to ...
	* util/grub-mkdevicemap.c: ... here.
	* util/i386/pc/grub-probe.c: Moved to ...
	* util/grub-probe.c: ... here.
2007-05-16 14:54:08 +00:00
okuji 1064790dc6 2006-08-04 Yoshinori K. Okuji <okuji@enbug.org>
Move the prototypes of grub_setjmp and grub_longjmp to
        cpu/setjmp.h, so that each architecture may specify different
        attributes.

        * include/grub/i386/setjmp.h (grub_setjmp): New prototype.
        (grub_longjmp): Likewise.
        * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise..
        (grub_longjmp): Likewise.
        * include/grub/sparc64/setjmp.h (grub_setjmp): Likewise..
        (grub_longjmp): Likewise.

        * include/grub/setjmp.h [!GRUB_UTIL] (grub_setjmp): Removed.
        [!GRUB_UTIL] (grub_longjmp): Removed.
2006-08-04 19:23:28 +00:00
chaac ad2a06edba 2006-07-29 Vesa Jaaskelainen <chaac@nic.fi>
* include/grub/bitmap.h: New file.

	* include/grub/i386/pc/vbeutil.h: Likewise.

	* video/bitmap.c: Likewise.

	* video/readers/tga.c: Likewise.

	* video/i386/pc/vbeutil.c: Likewise.

	* commands/videotest.c: Code cleanup and updated to reflect to new
	video API.

	* term/gfxterm.c: Likewise.

	* video/video.c: Likewise.

	* conf/i386-pc.rmk (pkgdata_MODULES): Added tga.mod and bitmap.mod.
	(vbe_mod_SOURCES): Added video/i386/pc/vbeutil.c.
	(bitmap_mod_SOURCES): New entry.
	(bitmap_mod_CFLAGS): Likewise.
	(bitmap_mod_LDFLAGS): Likewise.
	(tga_mod_SOURCES): Likewise.
	(tga_mod_CFLAGS): Likewise.
	(tga_mod_LDFLAGS): Likewise.

	* include/grub/video.h (grub_video_blit_operators): New enum type.
	(grub_video_render_target): Changed as forward declaration and moved
	actual definition to be video driver specific.
	(grub_video_adapter.blit_bitmap): Added blitting operator.
	(grub_video_adapter.blit_render_target): Likewise.
	(grub_video_blit_bitmap): Likewise.
	(grub_video_blit_render_target): Likewise.

	* include/grub/i386/pc/vbe.h (grub_video_render_target): Added
	driver specific render target definition.
	(grub_video_vbe_map_rgba): Added driver internal helper.
	(grub_video_vbe_unmap_color): Updated to use
	grub_video_i386_vbeblit_info.
	(grub_video_vbe_get_video_ptr): Likewise.

	* include/grub/i386/pc/vbeblit.h
	(grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Updated to use
	grub_video_i386_vbeblit_info.
	(grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise.
	(grub_video_i386_vbeblit_index_R8G8B8A8): Likewise.
	(grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise.
	(grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise.
	(grub_video_i386_vbeblit_index_R8G8B8): Likewise.
	(grub_video_i386_vbeblit_index_index): Likewise.
	(grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): New blitter function.
	(grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise.
	(grub_video_i386_vbeblit_index_R8G8B8X8): Likewise.
	(grub_video_i386_vbeblit_blend): Added generic blitter for blend
	operator.
	(grub_video_i386_vbeblit_replace): Added generic blitter for replace
	operator.

	* video/i386/pc/vbeblit.c: Updated to reflect changes on
	include/grub/i386/pc/vbeblit.h.

	* include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8):
	Updated to use grub_video_i386_vbeblit_info.
	(grub_video_i386_vbefill_R8G8B8): Likewise.
	(grub_video_i386_vbefill_index): Likewise.
	(grub_video_i386_vbefill): Added generic filler.

	* video/i386/pc/vbefill.c: Updated to reflect changes on
	include/grub/i386/pc/vbefill.h.

	* video/i386/pc/vbe.c (grub_video_vbe_get_video_ptr): Updated to use
	grub_video_i386_vbeblit_info.
	(grub_video_vbe_unmap_color): Likewise.
	(grub_video_vbe_blit_glyph): Likewise.
	(grub_video_vbe_scroll): Likewise.
	(grub_video_vbe_draw_pixel): Removed function.
	(grub_video_vbe_get_pixel): Likewise.
	(grub_video_vbe_fill_rect): Moved all blitters to vbefill.c and
	updated code to use it.
	(common_blitter): Added common blitter for render target and bitmap.
	(grub_video_vbe_blit_bitmap): Updated to use common_blitter.
	(grub_video_vbe_blit_render_target): Likewise.
2006-07-31 14:21:36 +00:00
chaac 684a8eff89 2006-07-29 Vesa Jaaskelainen <chaac@nic.fi>
* include/grub/video.h: Code cleanup.

        * include/grub/i386/pc/vbe.h: Likewise.

        * video/i386/pc/vbe.c: Likewise.

        * video/i386/pc/vbeblit.c: Likewise.

        * video/i386/pc/vbefill.c: Likewise.

        * video/video.c: Likewise.  Also added more comments.
2006-07-29 11:22:52 +00:00
chaac 5915059b61 2006-07-29 Vesa Jaaskelainen <chaac@nic.fi>
* disk/i386/pc/biosdisk.c (struct grub_biosdisk_drp): Moved to ...
        (struct grub_biosdisk_dap): Likewise.

        * include/grub/i386/pc/biosdisk.h: ... to here.  Also corrected
        linkage settings for all functions.
2006-07-29 10:11:01 +00:00
okuji 524a1e6a40 2006-06-04 Yoshinori K. Okuji <okuji@enbug.org>
Clean up the code to support 64-bit addressing in disks and
        files. This change is not enough for filesystems yet.

        * util/i386/pc/grub-setup.c (struct boot_blocklist): Change the
        type of "start" to grub_uint64_t.
        (setup): Change the types of KERNEL_SECTOR and FIRST_SECTOR to
        grub_disk_addr_t * and grub_disk_addr_t. Fix the format string in
        save_first_sector and save_blocklists. Use grub_le_to_cpu64 to
        convert addresses.

        * util/i386/pc/biosdisk.c (open_device): Change the type of SECTOR
        to grub_disk_addr_t.

        * partmap/gpt.c (gpt_partition_map_iterate): Fix the format
        string.

        * partmap/pc.c (pc_partition_map_iterate): Likewise.

        * partmap/amiga.c (amiga_partition_map_iterate): Cast RDSK.MAGIC
        to char *.

        * normal/script.c (grub_script_parse): Remove unused MEMFREE.

        * normal/parser.y (YYLTYPE_IS_TRIVIAL): New macro.

        * normal/lexer.c (grub_script_yyerror): Specify unused to LEX.

        * loader/i386/pc/multiboot.c (grub_multiboot_load_elf64): Cast -1
        to grub_off_t, to detect an error from grub_file_seek.
        (grub_multiboot_load_elf32): Likewise.

        * kern/misc.c (grub_strtoul): Use grub_strtoull. Return the
        maximum unsigned long value when an overflow is detected.
        (grub_strtoull): New function.
        (grub_divmod64): Likewise.
        (grub_lltoa): use grub_divmod64.

        * kern/fs.c (struct grub_fs_block): Change the type of "offset" to
        grub_disk_addr_t.
        (grub_fs_blocklist_open): Increase P if P is not NULL to advance
        the pointer to next character. Use grub_strtoull instead of
        grub_strtoul.
        (grub_fs_blocklist_read): Change the types of SECTOR, OFFSET and
        SIZE to grub_disk_addr_t, grub_off_t and grub_size_t,
        respectively.

        * kern/file.c (grub_file_read): Prevent an oveflow of LEN, as the
        return value is signed.
        (grub_file_seek): Change the type of OLD to grub_off_t. Do not
        test if OFFSET is less than zero, as OFFSET is unsigned now.

        * kern/disk.c (struct grub_disk_cache): Change the type of
        "sector" to grub_disk_addr_t.
        (grub_disk_cache_get_index): Change the type of SECTOR to
        grub_disk_addr_t. Calculate the hash with SECTOR casted to
        unsigned after shifting.
        (grub_disk_cache_invalidate): Change the type of SECTOR to
        grub_disk_addr_t.
        (grub_disk_cache_unlock): Likewise.
        (grub_disk_cache_store): Likewise.
        (grub_disk_check_range): Change the types of SECTOR, OFFSET, SIZE,
        START and LEN to grub_disk_addr_t *, grub_off_t *, grub_size_t,
        grub_disk_addr_t and grub_uint64_t, respectively.
        (grub_disk_read): Use an unsigned variable REAL_OFFSET for the
        body, as the value of OFFSET is tweaked by
        grub_disk_check_range. Change the types of START_SECTOR, LEN and
        POS to grub_disk_addr_t, grub_size_t and grub_size_t,
        respectively.
        (grub_disk_write): Use an unsigned variable REAL_OFFSET for the
        body, as the value of OFFSET is tweaked by
        grub_disk_check_range. Change the types of LEN and N to
        grub_size_t.

        * io/gzio.c (struct grub_gzio): Change the types of "data_offset"
        and "saved_offset" to grub_off_t.
        (test_header): Cast BUF to char *.
        (get_byte): Cast GZIO->DATA_OFFSET to grub_off_t. Cast GZIO->INBUF
        to char *.
        (grub_gzio_read): Change the types of OFFSET and SIZE to
        grub_off_t and grub_size_t, respectively.

        * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_FORCE_LBA):
        Removed.
        (GRUB_BOOT_MACHINE_BOOT_DRIVE): Changed to 0x4c.
        (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Changed to 0x40.
        (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Changed to 0x42.
        (GRUB_BOOT_MACHINE_DRIVE_CHECK): Changed to 0x4e.
        (GRUB_BOOT_MACHINE_LIST_SIZE): Increased to 12.

        * include/grub/types.h (grub_off_t): Unconditionally set to
        grub_uint64_t.
        (grub_disk_addr_t): Changed to grub_uint64_t.

        * include/grub/partition.h (struct grub_partition): Change the
        types of "start", "len" and "offset" to grub_disk_addr_t,
        grub_uint64_t and grub_disk_addr_t, respectively.
        (grub_partition_get_start): Return grub_disk_addr_t.
        (grub_partition_get_len): Return grub_uint64_t.

        * include/grub/misc.h (grub_strtoull): New prototype.
        (grub_divmod64): Likewise.

        * include/grub/fshelp.h (grub_fshelp_read_file): Change the types
        of SECTOR, LEN and FILESIZE to grub_disk_addr_t, grub_size_t and
        grub_off_t, respectively.
        All callers and references changed.

        * include/grub/fs.h (struct grub_fs): Change the type of LEN to
        grub_size_t in "read".
        All callers and references changed.

        * include/grub/file.h (struct grub_file): Change the types of
        "offset" and "size" to grub_off_t and grub_off_t,
        respectively. Change the type of SECTOR to grub_disk_addr_t in
        "read_hook".
        (grub_file_read): Change the type of LEN to grub_size_t.
        (grub_file_seek): Return grub_off_t. Change the type of OFFSET to
        grub_off_t.
        (grub_file_size): Return grub_off_t.
        (grub_file_tell): Likewise.
        All callers and references changed.

        * include/grub/disk.h (struct grub_disk_dev): Change the types of
        SECTOR and SIZE to grub_disk_addr_t and grub_size_t in "read" and
        "write".
        (struct grub_disk): Change the type of "total_sectors" to
        grub_uint64_t. Change the type of SECTOR to grub_disk_addr_t in
        "read_hook".
        (grub_disk_read): Change the types of SECTOR, OFFSET and SIZE to
        grub_disk_addr_t, grub_off_t and grub_size_t, respectively.
        (grub_disk_write): Likewise.
        All callers and references changed.

        * fs/iso9660.c (grub_iso9660_susp_iterate): Cast parameters to
        char * for grub_strncmp to silence gcc.
        (grub_iso9660_mount): Likewise.
        (grub_iso9660_mount): Likewise.
        (grub_iso9660_read_symlink): Likewise. Also, remove the nonsense
        return statement.
        (grub_iso9660_iterate_dir): Likewise.
        (grub_iso9660_label): Cast DATA->VOLDESC.VOLNAME to char *.

        * fs/hfs.c (grub_hfs_read_file): Change the types of SECTOR and
        LEN to grub_disk_addr_t and grub_size_t, respectively.

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

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

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

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

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

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

        * fs/fat.c (grub_fat_read_data): Change the types of SECTOR, LEN
        and SIZE to grub_disk_addr_t, grub_size_t and grub_size_t,
        respectively.

        * fs/ext2.c (grub_ext2_read_block): When an error happens, set
        BLKNR to -1 instead of returning GRUB_ERRNO.
        (grub_ext2_read_file): Change the types of SECTOR and
        LEN to grub_disk_addr_t and grub_size_t, respectively.

        * fs/affs.c (grub_affs_read_file): Change the types of SECTOR and
        LEN to grub_disk_addr_t and grub_size_t, respectively.

        * font/manager.c (grub_font_get_glyph): Cast BITMAP to char * for
        grub_file_read.

        * disk/ieee1275/ofdisk.c (grub_ofdisk_read): Fix the format
        string. Do not cast SECTOR explicitly.

        * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Change the type of
        TOTAL_SECTORS to grub_uint64_t. Do not mask DRP->TOTAL_SECTORS.
        (grub_biosdisk_rw): Change the types of SECTOR and SIZE to
        grub_disk_addr_t and grub_size_t, respectively. If the sector is
        over 2TB and LBA mode is not supported, raise an error.
        (get_safe_sectors): New function.
        (grub_biosdisk_read): Use get_safe_sectors.
        (grub_biosdisk_write): Likewise.

        * disk/efi/efidisk.c (grub_efidisk_read): Fix the format string.
        (grub_efidisk_write): Likewise.

        * disk/loopback.c (delete_loopback): Cosmetic changes.
        (grub_cmd_loopback): Likewise. Also, test NEWDEV->FILENAME
        correctly.
        (grub_loopback_open): Likewise.
        (grub_loopback_read): Likewise. Also, change the type of POS to
        grub_off_t, and fix the usage of grub_memset.

        * commands/i386/pc/play.c: Include grub/machine/time.h.

        * commands/ls.c (grub_ls_list_files): Use "llu" instead of "d" to
        print FILE->SIZE.

        * commands/configfile.c: Include grub/env.h.

        * commands/cmp.c (grub_cmd_cmp): Do not use ERR, but use
        GRUB_ERRNO directly instead. Change the type of POS to
        grub_off_t. Follow the coding standard.

        * commands/blocklist.c: Include grub/partition.h.
        (grub_cmd_blocklist): Return an error if the underlying device is
        not a disk. Take the starting sector of a partition into account,
        if a partition is used.

        * boot/i386/pc/diskboot.S (bootloop): Adapted to the new offset of
        a length field.
        (lba_mode): Support 64-bit addresses.
        (chs_mode): Likewise.
        (copy_buffer): Adapted to the new offsets of a length field and a
        segment field.
        (blocklist_default_start): Allocate 64-bit space.

        * boot/i386/pc/boot.S (force_lba): Removed.
        (boot_drive): Moved to under KERNEL_SECTOR.
        (kernel_sector): Moved to under KENREL_SEGMENT. Allocate 64-bit
        space.
        (real_start): Set %si earlier. Remove code for FORCE_LBA, since it
        is useless.
        (lba_mode): Refactored to support a 64-bit address. More size
        optimization.
        (setup_sectors): Likewise.
2006-06-04 15:56:55 +00:00
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 118f4fb31e 2006-05-28 Yoshinori K. Okuji <okuji@enbug.org>
* fs/hfsplus.c (grub_hfsplus_btree_recoffset): Moved to near the
        top.
        (grub_hfsplus_btree_recptr): Likewise.
        (grub_hfsplus_find_block): Do not take RETRY any longer. Use
        FILEBLOCK both to pass a block number and store next block
        number.
        (grub_hfsplus_read_block): Rewritten heavily to support an extent
        overflow file correctly. Specify errors appropriately, because
        fshelp expects that GRUB_ERRNO is set when fails. Reuse
        grub_hfsplus_btree_recptr to get the pointer to a found key.
        (grub_hfsplus_btree_search): Return 1 instead of 0 when no match
        is found.

        * conf/i386-efi.rmk (pkgdata_MODULES): Added _linux.mod and
        linux.mod.
        (_linux_mod_SOURCES): New variable.
        (_linux_mod_CFLAGS): Likewise.
        (_linux_mod_LDFLAGS): Likewise.
        (linux_mod_SOURCES): Likewise.
        (linux_mod_CFLAGS): Likewise.
        (linux_mod_LDFLAGS): Likewise.

        * DISTLIST: Added loader/i386/efi/linux.c,
        loader/i386/efi/linux_normal.c and
        include/grub/i386/efi/loader.h.

        * loader/i386/efi/linux.c: New file.
        * loader/i386/efi/linux_normal.c: Likewise.
        * include/grub/i386/efi/loader.h: Likewise.
2006-05-28 03:20:18 +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 0d6e118925 2006-05-14 Yoshinori K. Okuji <okuji@enbug.org>
* kern/i386/pc/startup.S: Include grub/cpu/linux.h instead of
        grub/machine/linux.h
        * loader/i386/pc/linux.c: Likewise.

        * include/grub/i386/pc/linux.h: Moved to ...
        * include/grub/i386/linux.h: ... here.

        * include/grub/i386/linux.h (struct linux_kernel_params): New
        struct.
2006-05-14 21:16:20 +00:00
okuji 976a4ea036 2006-04-19 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Added include/grub/efi/console.h,
        include/grub/efi/time.h, include/grub/i386/efi/kernel.h,
        kern/efi/init.c, kern/efi/mm.c, and term/efi/console.c.

        * include/grub/efi/console.h: New file.
        * include/grub/efi/time.h: Likewise.
        * include/grub/i386/efi/kernel.h: Likewise.
        * kern/efi/init.c: Likewise.
        * kern/efi/mm.c: Likewise.
        * term/efi/console.c: Likewise.

        * kern/i386/efi/init.c: Do not include grub/machine/time.h.
        (grub_stop): Removed.
        (grub_get_rtc): Likewise.
        (grub_machine_init): Simply call grub_efi_init.
        (grub_machine_fini): Call grub_efi_fini.

        * kern/efi/efi.c: Include grub/machine/time.h and grub/term.h.
        (grub_efi_output_string): Removed.
        (grub_efi_stall): New function.
        (grub_stop): Likewise.
        (grub_get_rtc): Likewise.

        * include/grub/efi/efi.h (grub_efi_output_string): Removed.
        (grub_efi_stall): New prototype.
        (grub_efi_allocate_pages): Likewise.
        (grub_efi_free_pages): Likewise.
        (grub_efi_get_memory_map): Likewise.
        (grub_efi_mm_init): Likewise.
        (grub_efi_mm_fini): Likewise.
        (grub_efi_init): Likewise.
        (grub_efi_fini): Likewise.

        * include/grub/i386/efi/time.h: Do not include
        grub/symbol.h. Include grub/efi/time.h.
        (GRUB_TICKS_PER_SECOND): Removed.
        (grub_get_rtc): Likewise.

        * include/grub/efi/api.h (struct grub_efi_memory_descriptor):
        Added padding. The EFI spec is buggy.
        (GRUB_EFI_BLACK): New macro.
        (GRUB_EFI_BLUE): Likewise.
        (GRUB_EFI_GREEN): Likewise.
        (GRUB_EFI_CYAN): Likewise.
        (GRUB_EFI_RED): Likewise.
        (GRUB_EFI_MAGENTA): Likewise.
        (GRUB_EFI_BROWN): Likewise.
        (GRUB_EFI_LIGHTGRAY): Likewise.
        (GRUB_EFI_BRIGHT): Likewise.
        (GRUB_EFI_DARKGRAY): Likewise.
        (GRUB_EFI_LIGHTBLUE): Likewise.
        (GRUB_EFI_LIGHTGREEN): Likewise.
        (GRUB_EFI_LIGHTCYAN): Likewise.
        (GRUB_EFI_LIGHTRED): Likewise.
        (GRUB_EFI_LIGHTMAGENTA): Likewise.
        (GRUB_EFI_YELLOW): Likewise.
        (GRUB_EFI_WHITE): Likewise.
        (GRUB_EFI_BACKGROUND_BLACK): Likewise.
        (GRUB_EFI_BACKGROUND_BLUE): Likewise.
        (GRUB_EFI_BACKGROUND_GREEN): Likewise.
        (GRUB_EFI_BACKGROUND_CYAN): Likewise.
        (GRUB_EFI_BACKGROUND_RED): Likewise.
        (GRUB_EFI_BACKGROUND_MAGENTA): Likewise.
        (GRUB_EFI_BACKGROUND_BROWN): Likewise.
        (GRUB_EFI_BACKGROUND_LIGHTGRAY): Likewise.
        (GRUB_EFI_TEXT_ATTR): Likewise.

        * conf/i386-efi.rmk (kernel_mod_SOURCES): Added kern/efi/efi.c,
        kern/efi/init.c, kern/efi/mm.c, and term/efi/console.c.
        (kernel_mod_HEADERS): Added efi/time.h.
2006-04-19 08:59:44 +00:00
okuji 837091258d 2006-04-18 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Added conf/i386-efi.mk, conf/i386-efi.rmk,
        include/grub/efi/api.h, include/grub/efi/console_control.h,
        include/grub/efi/efi.h, include/grub/efi/pe32.h,
        include/grub/i386/efi/time.h, kern/efi/efi.c,
        kern/i386/efi/init.c, kern/i386/efi/startup.S,
        and util/i386/efi/grub-mkimage.c.

        * Makefile.in (RMKFILES): Added i386-efi.rmk.

        * genmk.rb (PModule#rule): Do not export symbols if
        #{prefix}_EXPORTS is set to "no".

        * conf/i386-efi.mk: New file.
        * conf/i386-efi.rmk: Likewise.
        * include/grub/efi/api.h: Likewise.
        * include/grub/efi/console_control.h: Likewise.
        * include/grub/efi/efi.h: Likewise.
        * include/grub/efi/pe32.h: Likewise.
        * include/grub/i386/efi/time.h: Likewise.
        * kern/efi/efi.c: Likewise.
        * kern/i386/efi/init.c: Likewise.
        * kern/i386/efi/startup.S: Likewise.
        * util/i386/efi/grub-mkimage.c: Likewise.
2006-04-18 06:18:15 +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
okuji a3c5c6f8f6 2006-02-01 Yoshinori K. Okuji <okuji@enbug.org>
* boot/i386/pc/boot.S (general_error): Before looping, try INT
        18H, which might help the BIOS falling back to next boot media.
2006-02-01 06:12:58 +00:00
okuji 8899bc3e58 2005-12-25 Yoshinori K. Okuji <okuji@enbug.org>
* include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_DRP_ADDR):
        Removed.
        (GRUB_BOOT_MACHINE_DRP_SIZE): Likewise.
2005-12-25 19:40:31 +00:00
okuji 713092ae8a Add an additional comment for GRUB_MEMORY_MACHINE_RESERVED_START and GRUB_MEMORY_MACHINE_RESERVED_END. 2005-12-25 19:31:31 +00:00
okuji b4093103f8 2005-09-29 Yoshinori K. Okuji <okuji@enbug.org>
Make GRUB's kernel compliant to Multiboot Specification.

        * kern/i386/pc/startup.S (multiboot_header): New label.
        (multiboot_entry): Likewise.
        (multiboot_trampoline): Likewise.

        * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
        Increased to 0x4A0.

        * fs/xfs.c (grub_xfs_iterate_dir): Fix a syntax error. You may not
        put parentheses after a question mark.
        [!GRUB_UTIL] (my_mod): New variable.

        * util/grub-emu.c (main): Call grub_xfs_init and grub_xfs_fini.
2005-09-28 23:04:26 +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
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
chaac e85e144bfc Added support for VESA Bios Extension to i386 kernel. 2005-08-09 14:39:50 +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
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 f806d18efd 2005-07-17 Yoshinori Okuji <okuji@enbug.org>
* boot/i386/pc/boot.S (boot_drive_check): New label.

	* include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_DRIVE_CHECK): New
	macro.

	* util/i386/pc/grub-setup.c (setup): Added a workaround for BIOSes
	which do not pass a boot drive correctly. Copied from GRUB Legacy.
2005-07-17 14:57:07 +00:00
okuji 654fc59fe4 2005-07-16 Yoshinori K. Okuji <okuji@enbug.org>
* kern/i386/pc/startup.S (grub_gate_a20): Rewritten for
	robustness. This routine now supports a BIOS call and System
	Control Port A to modify the gate A20.

	* include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
	Increased to 0x440.
2005-07-16 09:32:52 +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
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 0b412211b3 2005-01-04 Hollis Blanchard <hollis@penguinppc.org>
* TODO: Add note about endianness in grub-mkimage.
	* boot/powerpc/ieee1275/crt0.S (note): Remove unused .note
	section.
	* conf/powerpc-ieee1275.rmk (bin_UTILITIES): Add grub-mkimage.
	(grub_mkimage_SOURCES): New target.
	* include/grub/kernel.h (grub_start_addr): Remove variable.
	(grub_end_addr): Likewise.
	(grub_total_module_size): Likewise.
	(grub_kernel_image_size): Likewise.
	(GRUB_MODULE_MAGIC): New constant.
	(grub_module_info): New structure.
	(grub_arch_modules_addr): New prototype.
	(grub_get_end_addr): Remove prototype.
	* include/grub/i386/pc/kernel.h (grub_end_addr): New prototype.
	* include/grub/powerpc/ieee1275/kernel.h: New file.
	* include/grub/util/misc.h (grub_util_get_fp_size): New
	prototype.
	(grub_util_read_at): Likewise.
	(grub_util_write_image_at): Likewise.
	* kern/main.c (grub_get_end_addr): Remove function.
	(grub_load_modules): Call grub_arch_modules_addr instead of using
	grub_end_addr.  Look for a grub_module_info struct in memory.  Use
	the grub_module_info fields instead of calling grub_get_end_addr
	as loop conditions.  Move grub_add_unused_region code here.
	(grub_add_unused_region): Remove function.
	* kern/i386/pc/init.c: Include grub/cache.h.
	(grub_machine_init): Remove call to grub_get_end_addr.  Remove
	one call to add_mem_region.
	(grub_arch_modules_addr): New function.
	* kern/powerpc/ieee1275/init.c (grub_end_addr): Remove variable.
	(grub_total_module_size): Likewise.
	Include grub/machine/kernel.h.
	(grub_arch_modules_addr): New function.
	* util/grub-emu.c (grub_end_addr): Remove variable.
	(grub_total_module_size): Likewise.
	(grub_arch_modules_addr): New function.
	* util/misc.c: Include unistd.h.
	(grub_util_get_fp_size): New function.
	(grub_util_read_at): Likewise.
	(grub_util_write_image_at): Likewise.
	(grub_util_read_image): Call grub_util_read_at.
	(grub_util_write_image): Call grub_util_write_image_at.
	* util/i386/pc/grub-mkimage.c (generate_image): Allocate
	additional memory in kernel_img for a struct grub_module_info.
	Fill in that grub_module_info.
	* util/powerpc/ieee1275/grub-mkimage.c: New file.
2005-01-04 14:01:45 +00:00
marco_g 924b6140a1 2004-12-27 Marco Gerards <metgerards@student.han.nl>
* genmk.rb: Handle the `Program' class in the main loop.  Written
	by Johan Rydberg <jrydberg@gnu.org>.
	(Program): New class.
	(programs): New variable.
	* boot/powerpc/ieee1275/cmain.c: Include <grub/machine/ieee1275.h>
	instead of "grub/machine/ieee1275.h".  Include <grub/kernel.h>
	instead of "grub/kernel.h".  Include <grub/machine/init.h>.
	(help_arch): Function removed.
	* conf/powerpc-ieee1275.rmk (grubof_HEADERS): Add
	`powerpc/libgcc.h' and `loader.h'.
	(pkgdata_PROGRAMS): New variable.
	(sbin_UTILITIES): Variable removed.
	(grub_emu_SOURCES): Added kern/powerpc/cache.S.
	(grubof_SOURCES): Variable re-defined so it only includes the
	core functionality.
	(grubof_CFLAGS): Remove `-DGRUBOF'.
	(pkgdata_MODULES, fshelp_mod_SOURCES, fshelp_mod_CFLAGS,
	(fat_mod_SOURCES, fat_mod_CFLAGS, ext2_mod_SOURCES)
	(ext2_mod_CFLAGS, ufs_mod_SOURCES, ufs_mod_CFLAGS)
	(minix_mod_SOURCES, minix_mod_CFLAGS, hfs_mod_SOURCES)
	(hfs_mod_CFLAGS, jfs_mod_SOURCES, jfs_mod_CFLAGS)
	(iso9660_mod_SOURCES, iso9660_mod_CFLAGS, _linux_mod_SOURCES)
	(_linux_mod_CFLAGS, linux_mod_SOURCES, linux_mod_CFLAGS)
	(normal_mod_SOURCES, normal_mod_CFLAGS, normal_mod_ASFLAGS)
	(hello_mod_SOURCES, hello_mod_CFLAGS, boot_mod_SOURCES)
	(boot_mod_CFLAGS, terminal_mod_SOURCES, terminal_mod_CFLAGS)
	(ls_mod_SOURCES, ls_mod_CFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS)
	(cat_mod_SOURCES, cat_mod_CFLAGS, font_mod_SOURCES)
	(font_mod_CFLAGS, amiga_mod_SOURCES, amiga_mod_CFLAGS)
	(apple_mod_SOURCES, apple_mod_CFLAGS, pc_mod_SOURCES)
	(pc_mod_CFLAGS): New variables.
	* disk/powerpc/ieee1275/ofdisk.c: Include <grub/machine/init.h>.
	(grub_ofdisk_iterate): Add a prototype for `dev_iterate'.
	* include/grub/dl.h (grub_arch_dl_sync_caches): New prototype.
	* include/grub/loader.h (grub_os_area_addr, grub_os_area_size):
	Moved from here...
	* include/grub/i386/pc/init.h (grub_os_area_addr)
	(rub_os_area_size): ... to here.
	* include/grub/powerpc/ieee1275/ieee1275.h
	(grub_ieee1275_entry_fn): Export symbol.
	* include/grub/powerpc/ieee1275/init.h: New file.
	* include/grub/powerpc/libgcc.h: Likewise.
	* include/grub/cache.h: Likewise.
	* kern/powerpc/cache.S: Likewise.  Written by Hollis Blanchard
	<hollis@penguinppc.org>.
	* kern/dl.c: Include <grub/cache.h>.
	(grub_dl_flush_cache): New function.
	(grub_dl_load_core): Call `grub_dl_flush_cache' to flush the cache
	for this module.
	* kern/powerpc/ieee1275/init.c (grub_ofdisk_init)
	(grub_console_init): Removed prototypes.
	(grub_machine_init): Don't initialize the modules anymore.
	* kern/powerpc/ieee1275/openfw.c (grub_map): Make the function
	static.
	* include/grub/powerpc/types.h (GRUB_HOST_WORDS_LITTLEENDIAN):
	Macro undef removed.
	(GRUB_HOST_WORDS_BIGENDIAN): New macro.
	* kern/powerpc/dl.c (grub_arch_dl_relocate_symbols): Add
	relocation `R_PPC_REL32'.  Return an error when the relocation is
	unknown.
	* Makefile.in (DATA): Add `$(pkgdata_PROGRAMS)'.
	* kern/i386/pc/init.c (grub_arch_sync_caches): New function.
	* util/misc.c (grub_arch_sync_caches): Likewise.
2004-12-27 13:46:20 +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 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
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
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
okuji 8367695cff shinori K. Okuji <okuji@enbug.org>
* genkernsyms.sh: Updated copyright information.
	* genmk.rb: Likewise.
	* genmodsrc.sh: Likewise.
	* gensymlist.sh: Likewise.
	* boot/i386/pc/boot.S: Likewise.
	* boot/i386/pc/diskboot.S: Likewise.
	* disk/i386/pc/biosdisk.c: Likewise.
	* disk/i386/pc/partition.c: Likewise.
	* font/manager.c: Likewise.
	* fs/ext2.c: Likewise.
	* fs/fat.c: Likewise.
	* include/pupa/boot.h: Likewise.
	* include/pupa/device.h: Likewise.
	* include/pupa/disk.h: Likewise.
	* include/pupa/dl.h: Likewise.
	* include/pupa/elf.h: Likewise.
	* include/pupa/err.h: Likewise.
	* include/pupa/file.h: Likewise.
	* include/pupa/font.h: Likewise.
	* include/pupa/fs.h: Likewise.
	* include/pupa/kernel.h: Likewise.
	* include/pupa/loader.h: Likewise.
	* include/pupa/misc.h: Likewise.
	* include/pupa/mm.h: Likewise.
	* include/pupa/net.h: Likewise.
	* include/pupa/normal.h: Likewise.
	* include/pupa/rescue.h: Likewise.
	* include/pupa/setjmp.h: Likewise.
	* include/pupa/symbol.h: Likewise.
	* include/pupa/term.h: Likewise.
	* include/pupa/types.h: Likewise.
	* include/pupa/i386/setjmp.h: Likewise.
	* include/pupa/i386/types.h: Likewise.
	* include/pupa/i386/pc/biosdisk.h: Likewise.
	* include/pupa/i386/pc/boot.h: Likewise.
	* include/pupa/i386/pc/console.h: Likewise.
	* include/pupa/i386/pc/init.h: Likewise.
	* include/pupa/i386/pc/kernel.h: Likewise.
	* include/pupa/i386/pc/linux.h: Likewise.
	* include/pupa/i386/pc/loader.h: Likewise.
	* include/pupa/i386/pc/memory.h: Likewise.
	* include/pupa/i386/pc/multiboot.h: Likewise.
	* include/pupa/i386/pc/partition.h: Likewise.
	* include/pupa/i386/pc/time.h: Likewise.
	* include/pupa/i386/pc/vga.h: Likewise.
	* include/pupa/i386/pc/util/biosdisk.h: Likewise.
	* include/pupa/util/getroot.h: Likewise.
	* include/pupa/util/misc.h: Likewise.
	* include/pupa/util/resolve.h: Likewise.
	* kern/device.c: Likewise.
	* kern/disk.c: Likewise.
	* kern/dl.c: Likewise.
	* kern/err.c: Likewise.
	* kern/file.c: Likewise.
	* kern/fs.c: Likewise.
	* kern/loader.c: Likewise.
	* kern/main.c: Likewise.
	* kern/misc.c: Likewise.
	* kern/mm.c: Likewise.
	* kern/rescue.c: Likewise.
	* kern/term.c: Likewise.
	* kern/i386/dl.c: Likewise.
	* kern/i386/pc/init.c: Likewise.
	* kern/i386/pc/lzo1x.S: Likewise.
	* kern/i386/pc/startup.S: Likewise.
	* loader/i386/pc/chainloader.c: Likewise.
	* loader/i386/pc/linux.c: Likewise.
	* loader/i386/pc/multiboot.c: Likewise.
	* normal/cmdline.c: Likewise.
	* normal/command.c: Likewise.
	* normal/main.c: Likewise.
	* normal/menu.c: Likewise.
	* normal/i386/setjmp.S: Likewise.
	* term/i386/pc/console.c: Likewise.
	* term/i386/pc/vga.c: Likewise.
	* util/console.c: Likewise.
	* util/genmoddep.c: Likewise.
	* util/misc.c: Likewise.
	* util/pupa-emu.c: Likewise.
	* util/resolve.c: Likewise.
	* util/unifont2pff.rb: Likewise.
	* util/i386/pc/biosdisk.c: Likewise.
	* util/i386/pc/getroot.c: Likewise.
	* util/i386/pc/pupa-mkimage.c: Likewise.
	* util/i386/pc/pupa-setup.c: Likewise.
2004-02-24 17:21:53 +00:00
jeroen e6eced7150 2004-02-15 Jeroen Dekkers <jeroen@dekkers.cx>
* fs/ext2.c (pupa_ext2_read_file): Correct the value of BLOCKEND
	when it is EXT2_BLOCK_SIZE (data).  New argument READ_HOOK, all
	callers changed.  Set DATA->DISK->READ_HOOK to READ_HOOK before
	reading and reset it after reading.
	(pupa_ext2_close): Return PUPA_ERR_NONE.

	* include/pupa/i386/pc/linux.h (PUPA_LINUX_INITRD_MAX_ADDRESS):
	Correct value.
	(struct linux_kernel_header): Add kernel_version and
	initrd_addr_max.
	* loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Check whether
	pupa_file_read succeeds.
	(pupa_rescue_cmd_initrd): Implement.
2004-02-15 10:09:11 +00:00
jeroen 9a5c1adeaa 2003-11-16 Jeroen Dekkers <jeroen@dekkers.cx>
* conf/i386-pc.rmk (pkgdata_MODULES): Add _multiboot.mod.
	(_multiboot_mod_SOURCES): New variable.
	(_multiboot_mod_CFLAGS): Likewise.
	* loader/i386/pc/multiboot.c: New file.
	* include/pupa/i386/pc/multiboot.h: Likewise.
	* kern/i386/pc/startup.S: Include pupa/machine/multiboot.h.
	(pupa_multiboot_real_boot): New function.
	* include/pupa/i386/pc/loader.h: Include pupa/machine/multiboot.h.
	(pupa_multiboot_real_boot): New prototype.
	(pupa_rescue_cmd_multiboot): Likewise
	(pupa_rescue_cmd_module): Likewise.

	* kern/loader.c (pupa_loader_set): Continue when
	pupa_loader_unload_func() fails.
	(pupa_loader_unset): New function.
	* include/pupa/loader.h (pupa_loader_unset): New prototype.

	* kern/misc.c (pupa_stpcpy): New function.
	* include/pupa/misc.h (pupa_stpcpy): New prototype.
2003-11-16 16:36:39 +00:00
marco_g 8e72a9c0e3 2003-11-12 Marco Gerards <metgerards@student.han.nl>
* disk/i386/pc/biosdisk.c (pupa_biosdisk_open): Correctly check
	for available extensions.

	* include/pupa/i386/pc/time.h: New file.
	* kern/disk.c: Include <pupa/machine/time.h>.
	(PUPA_CACHE_TIMEOUT): New macro.
	(pupa_last_time): New variable.
	(pupa_disk_open): Flush the cache when there was a timeout.
	(pupa_disk_close): Reset the timer.
	* kern/i386/pc/startup.S (pupa_get_rtc): Renamed from
	pupa_currticks.
	* util/misc.c: Include <sys/times.h>
	(pupa_get_rtc): New function.
2003-11-12 20:33:52 +00:00
okuji 18d9c7cd53 2003-09-25 Yoshinori K. Okuji <okuji@enbug.org>
I forgot to check in these changes for a long time. This adds
	incomplete support for VGA console, and this is still very
	buggy. Also, a lot of consideration is required for I18N,
	UNICODE, and VGA font issues. Therefore, assume that this is
	such that "better than nothing".

	* font/manager.c: New file.
	* include/pupa/font.h: Likewise.
	* include/pupa/i386/pc/vga.h: Likewise.
	* term/i386/pc/vga.c: Likewise.
	* util/unifont2pff.rb: Likewise.

	* conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h.
	(pkgdata_MODULES): Added vga.mod and font.mod.
	(vga_mod_SOURCES): New variables.
	(vga_mod_CFLAGS): Likewise.
	(font_mod_SOURCES): Likewise.
	(font_mod_CFLAGS): Likewise.

	* include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant.

	* include/pupa/term.h: Include pupa/err.h.
	(struct pupa_term): Added init and fini.
	Changed the argument of putchar to pupa_uint32_t.

	* include/pupa/i386/pc/console.h: Include pupa/symbol.h.
	(pupa_console_real_putchar): New prototype.
	(pupa_console_putchar): Removed.
	(pupa_console_checkkey): Exported.
	(pupa_console_getkey): Likewise.

	* kern/misc.c (pupa_vsprintf): Add support for UNICODE
	characters.

	* kern/term.c (pupa_term_set_current): Rewritten.
	(pupa_putchar): Likewise.
	(pupa_putcode): New function.

	* kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ...
	(pupa_console_real_putchar): ... this.
	(pupa_vga_set_mode): New function.
	(pupa_vga_get_font): Likewise.

	* normal/command.c: Include pupa/term.h.
	(terminal_command): New function.
	(pupa_command_init): Register the command "terminal".

	* normal/menu.c (DISP_LEFT): Changed to a UNICODE value.
	(DISP_UP): Likewise.
	(DISP_RIGHT): Likewise.
	(DISP_DOWN): Likewise.
	(DISP_HLINE): Likewise.
	(DISP_VLINE): Likewise.
	(DISP_UL): Likewise.
	(DISP_UR): Likewise.
	(DISP_LL): Likewise.
	(DISP_LR): Likewise.

	* term/i386/pc/console.c (pupa_console_putchar): New function.
2003-09-25 20:15:53 +00:00
okuji 1f5ab4280a 2003-01-31 Yoshinori K. Okuji <okuji@enbug.org>
* kern/i386/pc/lzo1x.S: New file.

	* util/i386/pc/pupa-mkimage.c: Include lzo1x.h.
	(compress_kernel): New variable.
	(generate_image): Heavily modified to support compressing a
	large part of the core image.

	* util/misc.c (pupa_util_read_image): Fix a file descriptor
	leak.
	(pupa_util_load_image): New function.

	* kern/i386/pc/startup.S: Include pupa/machine/kernel.h.
	(pupa_compressed_size): New variable.
	(codestart): Enable Gate A20 here.
	Decompress the compressed part of the core image.
	Rearrange the code to put functions and variables which are
	required for initialization in the non-compressed part.
	Include lzo1x.S.

	* kern/i386/pc/init.c (pupa_machine_init): Don't enable Gate A20
	here.

	* include/pupa/util/misc.h (pupa_util_write_image): Declared.

	* include/pupa/i386/pc/kernel.h
	(PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro.
	(PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4.
	(PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
	(PUPA_KERNEL_MACHINE_PREFIX): Likewise.
	(PUPA_KERNEL_MACHINE_RAW_SIZE): New macro.

	* conf/i386-pc.rmk (pupa_mkimage_LDFLAGS): New variable.

	* genmk.rb (Image#rule): Put LDFLAGS at the end of a line.
	(Utility#rule): Likewise.

	* configure.ac: Check if LZO is available.
2003-01-31 03:26:56 +00:00
okuji ce5bf700ca 2003-01-20 Yoshinori K. Okuji <okuji@enbug.org>
* include/pupa/normal.h: New file.
	* include/pupa/setjmp.h: Likewise.
	* include/pupa/i386/setjmp.h: Likewise.
	* normal/cmdline.c: Likewise.
	* normal/command.c: Likewise.
	* normal/main.c: Likewise.
	* normal/menu.c: Likewise.
	* normal/i386/setjmp.S: Likewise.

	* loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global.
	(pupa_rescue_cmd_initrd): Likewise.

	* loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader):
	Likewise.

	* kern/i386/pc/startup.S (translation_table): New variable.
	(translate_keycode): New function.
	(pupa_console_getkey): Call translate_keycode.

	* kern/rescue.c (attempt_normal_mode): New function.
	(pupa_enter_rescue_mode): Attempt to execute the normal mode. If
	it failed, print a message.

	* kern/mm.c (pupa_real_malloc): Print more information when a
	free magic is broken.
	(pupa_free): If the first free header is not free actually, set
	it to P.

	* kern/main.c (pupa_load_normal_mode): Just load the module
	"normal".
	(pupa_main): Don't print the message
	"Entering into rescue mode..." here.

	* include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd):
	Declared.
	(pupa_rescue_cmd_initrd): Likewise.
	(pupa_rescue_cmd_initrd): Likewise.

	* include/pupa/symbol.h (FUNCTION): Specify the type.
	(VARIABLE): Likewise.

	* include/pupa/err.h (pupa_err_t): Added
	PUPA_ERR_UNKNOWN_COMMAND.

	* include/pupa/dl.h (pupa_dl_set_prefix): Exported.
	(pupa_dl_get_prefix): Likewise.

	* conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod.
	Added _chain.mod and _linux.mod instead of chain.mod and
	linux.mod.
	(chain_mod_SOURCES): Renamed to ...
	(_chain_mod_SOURCES): ... this.
	(chain_mod_CFLAGS): Renamed to ...
	(_chain_mod_CFLAGS): ... this.
	(linux_mod_SOURCES): Renamed to ...
	(_linux_mod_SOURCES): ... this.
	(linux_mod_CFLAGS): Renamed to ...
	(_linux_mod_CFLAGS): ... this.
	(normal_mod_SOURCES): New variable.
	(normal_mod_CFLAGS): Likewise.
	(normal_mod_ASFLAGS): Likewise.

2003-01-18  Yoshinori K. Okuji  <okuji@enbug.org>

	* kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if
	possible.

	* kern/dl.c (pupa_dl_ref): Refer dependending modules
	recursively.
	(pupa_dl_unref): Unrefer depending modules recursively.
	Don't call pupa_dl_unload implicitly, because PUPA can crash if
	a module is unloaded before one depending on that module is
	unloaded.
	(pupa_dl_unload): Unload depending modules explicitly,
	if possible.
2003-01-20 04:13:46 +00:00
okuji c04da07444 2003-01-17 Yoshinori K. Okuji <okuji@enbug.org>
* include/pupa/i386/pc/linux.h: New file.
	* loader/i386/pc/linux.c: Likewise.

	* loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector):
	Removed.
	(pupa_chainloader_unload): Return PUPA_ERR_NONE.
	(pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead
	of PUPA_CHAINLOADER_BOOT_SECTOR.

	* kern/i386/pc/startup.S: Include pupa/machine/linux.h.
	(pupa_linux_prot_size): New variable.
	(pupa_linux_tmp_addr): Likewise.
	(pupa_linux_real_addr): Likewise.
	(pupa_linux_boot_zimage): New function.
	(pupa_linux_boot_bzimage): Likewise.

	* kern/i386/pc/init.c (struct mem_region): New structure.
	(MAX_REGIONS): New macro.
	(mem_regions): New variable.
	(num_regions): Likewise.
	(pupa_os_area_addr): Likewise.
	(pupa_os_area_size): Likewise.
	(pupa_lower_mem): Likewise.
	(pupa_upper_mem): Likewise.
	(add_mem_region): New function.
	(compact_mem_regions): Likewise.
	(pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to
	the size of the conventional memory and that of so-called upper
	memory (before the first memory hole).
	Instead of adding each found region to free memory, use
	add_mem_region and add them after removing overlaps.
	Also, add only 1/4 of the upper memory to free memory. The rest
	is used for loading OS images. Maybe this is ad hoc, but this
	makes it much easier to relocate OS images when booting.

	* kern/rescue.c (pupa_rescue_cmd_module): Removed.
	(pupa_enter_rescue_mode): Don't register initrd and module.

	* kern/mm.c: Include pupa/dl.h.

	* kern/main.c: Include pupa/file.h and pupa/device.h.

	* kern/loader.c (pupa_loader_load_module_func): Removed.
	(pupa_loader_load_module): Likewise.

	* kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of
	``.o''.

	* include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared.
	(pupa_linux_tmp_addr): Likewise.
	(pupa_linux_real_addr): Likewise.
	(pupa_linux_boot_zimage): Likewise.
	(pupa_linux_boot_bzimage): Likewise.

	* include/pupa/i386/pc/init.h (pupa_lower_mem): Declared.
	(pupa_upper_mem): Likewise.
	(pupa_gate_a20): Don't export, because turning off Gate A20 in a
	module is too dangerous.

	* include/pupa/loader.h (pupa_os_area_addr): Declared.
	(pupa_os_area_size): Likewise.
	(pupa_loader_set): Remove the first argument. Loader doesn't
	manage modules or initrd any longer.
	(pupa_loader_load_module): Removed.

	* conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod.
	(linux_mod_SOURCES): New variable.
	(linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
okuji a5ffe96617 2003-01-06 Yoshinori K. Okuji <okuji@enbug.org>
* util/i386/pc/pupa-setup.c: Include pupa/machine/kernel.h.
	(setup): Configure the installed partition information and the
	dl prefix.

	* loader/i386/pc/chainloader.c (my_mod): New variable.
	(pupa_chainloader_unload): New function.
	(pupa_rescue_cmd_chainloader): Refer itself.
	(PUPA_MOD_INIT): Save its own module in MY_MOD.

	* kern/i386/pc/startup.S (install_partition): Removed.
	(version_string): Likewise.
	(config_file): Likewise.
	(pupa_install_dos_part): New variable.
	(pupa_install_bsd_part): Likewise.
	(pupa_prefix): Likewise.
	(pupa_chainloader_real_boot): Call pupa_dl_unload_all.

	* kern/i386/pc/init.c: Include pupa/machine/kernel.h, pupa/dl.h
	and pupa/misc.h.
	(make_install_device): New function.
	(pupa_machine_init): Set the dl prefix.

	* kern/rescue.c: Include pupa/rescue.h and pupa/dl.h.
	(buf): Renamed to ...
	(linebuf): ... this.
	(pupa_rescue_cmd_prefix): New function.
	(pupa_rescue_cmd_insmod): Likewise.
	(pupa_rescue_cmd_rmmod): Likewise.
	(pupa_rescue_cmd_lsmod): Likewise.
	(pupa_enter_rescue_mode): Register new commands: prefix, insmod,
	rmmod and lsmod.

	* kern/mm.c (pupa_memalign): If failed even after invalidating
	disk caches, unload unneeded modules and retry.

	* kern/misc.c (pupa_memmove): New function.
	(pupa_memcpy): Removed.
	(pupa_strcpy): New function.
	(pupa_itoa): Made static.

	* kern/dl.c (pupa_dl_iterate): New function.
	(pupa_dl_ref): Likewise.
	(pupa_dl_unref): Likewise.
	(pupa_dl_unload): Return if succeeded or not.
	(pupa_dl_unload_unneeded): New function.
	(pupa_dl_unload_all): Likewise.
	(pupa_dl_init): Renamed to ...
	(pupa_dl_set_prefix): ... this.
	(pupa_dl_get_prefix): New function.

	* include/pupa/i386/pc/kernel.h: Include pupa/types.h.
	(PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): New macro.
	(PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise.
	(PUPA_KERNEL_MACHINE_PREFIX): Likewise.
	(pupa_install_dos_part): Declared.
	(pupa_install_bsd_part): Likewise.
	(pupa_prefix): Likewise.
	(pupa_boot_drive): Likewise.

	* include/pupa/types.h: Fix a typo.

	* include/pupa/misc.h (pupa_memcpy): New macro. Just an alias to
	pupa_memmove.
	(pupa_memmove): Declared.
	(pupa_strcpy): Likewise.

	* include/pupa/dl.h (PUPA_MOD_INIT): Change the prototype. Now
	pupa_mod_init takes one argument, its own module.
	(pupa_dl_unload_unneeded): Declared.
	(pupa_dl_unload_all): Likewise.
	(pupa_dl_ref): Likewise.
	(pupa_dl_unref): Likewise.
	(pupa_dl_iterate): Likewise.
	(pupa_dl_init): Renamed to ...
	(pupa_dl_set_prefix): ... this.
	(pupa_dl_get_prefix): Declared.

	* fs/fat.c [!PUPA_UTIL] (my_mod): New variable.
	(pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being
	unloaded.
	(pupa_fat_open) [!PUPA_UTIL]: Refer itself if succeeded.
	(pupa_fat_close) [!PUPA_UTIL]: Unrefer itself.

	* configure.ac (tmp_CFLAGS): Added -Wshadow, -Wpointer-arith,
	-Wmissing-prototypes, -Wundef and -Wstrict-prototypes.
2003-01-06 00:01:35 +00:00
okuji 1cc73a62da 2003-01-03 Yoshinori K. Okuji <okuji@enbug.org>
* include/i386/pc/util/biosdisk.h: New file.
	* util/i386/pc/biosdisk.c: Likewise.
	* util/i386/pc/pupa-setup.c: Likewise.

	* Makefile.in (INCLUDE_DISTFILES): Added
	include/pupa/i386/pc/util/biosdisk.h.
	(UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the
	directory util/i386/pc.
	(install-local): Added a rule for sbin_UTILITIES.
	(uninstall): Likewise.

	* util/i386/pc/pupa-mkimage.c (usage): Fix a typo in the doc.

	* util/misc.c (xrealloc): New function.
	(pupa_malloc): Likewise.
	(pupa_free): Likewise.
	(pupa_realloc): Likewise.
	(pupa_stop): Likewise.
	(pupa_putchar): Likewise.

	* kern/disk.c (pupa_disk_read): Prevent L from underflowing.

	* include/pupa/util/misc.h (xrealloc): Declared.

	* include/pupa/i386/pc/boot.h (PUPA_BOOT_MACHINE_BPB_START): New
	macro.
	(PUPA_BOOT_MACHINE_BPBEND): Renamed to ...
	(PUPA_BOOT_MACHINE_BPB_END): ... this.

	* include/pupa/fs.h [PUPA_UTIL] (pupa_fat_init): Declared.
	[PUPA_UTIL] (pupa_fat_fini): Likewise.

	* fs/fat.c [PUPA_UTIL] (pupa_fat_init): Defined. Maybe a better
	way should be implemented.
	[PUPA_UTIL] (pupa_fat_fini): Likewise.

	* disk/i386/pc/biosdisk.c (pupa_biosdisk_call_hook): Increase
	the size of NAME for safety.
	(pupa_biosdisk_iterate): Search hard disks to 0x90 instead of
	0x88.

	* conf/i386-pc.rmk (sbin_UTILITIES): New variable.
	(pupa_setup_SOURCES): Likewise.

	* genmk.rb (Utility#rule): Add $(BUILD_CFLAGS) into the rules.
2003-01-02 20:12:33 +00:00
okuji 6a161fa938 Initial revision 2002-12-27 08:53:07 +00:00