Commit graph

74 commits

Author SHA1 Message Date
proski
d1dff95dc7 2008-05-29 Pavel Roskin <proski@gnu.org>
* disk/lvm.c (grub_lvm_scan_device): Check for the buffer end
	when scanning metadata for volume group name.
2008-05-30 03:57:16 +00:00
robertmh
7f8866edc1 2008-05-07 Robert Millan <rmh@aybabtu.com>
* disk/lvm.c (grub_lvm_scan_device): Detect errors in an additional
        grub_strstr() call.  Correct a few mistakes in failure path handling.
2008-05-07 12:39:26 +00:00
bean
25f16ec1f6 2008-04-25 Bean <bean123ch@gmail.com>
* Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and
	i386-linuxbios.

	* commands/hexdump.c (grub_cmd_hexdump): Support dumping of device,
	change the buffer size to 4096 for cdrom device.

	* conf/i386-ieee1275.rmk (pkglib_MODULES): Add _linux.mod, linux.mod
	and nand.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.
	(nand_mod_SOURCES): Likewise.
	(nand_mod_CFLAGS): Likewise.
	(nand_mod_LDFLAGS): Likewise.

	* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Return
	GRUB_ERR_UNKNOWN_DEVICE instead of GRUB_ERR_BAD_DEVICE if no device
	type property. (nand device in olpc don't have this property)

	* include/grub/disk.h (grub_disk_dev_id): New macro
	GRUB_DISK_DEVICE_NAND_ID.

	* include/grub/i386/ieee1275/loader.h (grub_rescue_cmd_linux): New
	function prototype.
	(grub_rescue_cmd_initrd): Likewise.

	* include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro.
	(linux_kernel_params): Add new member ofw_signature, ofw_num_items,
	ofw_cif_handler and ofw_idt, adjust padding number.

	* include/grub/i386/pc/memory.h (grub_upper_mem): Export it if
	GRUB_MACHINE_IEEE1275 is defined.

	* include/grub/ieee1275/ieee1275.h (grub_available_iterate):
	Use NESTED_FUNC_ATTR attribute on the hook parameter.

	* kern/powerpc/ieee1275/init.c (grub_claim_heap): Use NESTED_FUNC_ATTR
	on nested function heap_init.
	(grub_upper_mem): New variable for i386-ieee1275.
	(grub_get_extended_memory): New function for i386-ieee1275.
	(grub_machine_init): Call grub_get_extended_memory for i386-ieee1275.

	* kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use
	NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type
	property.

	* loader/i386/ieee1275/linux.c: New file.

	* loader/i386/ieee1275/linux_normal.c: New file.

	* disk/ieee1275/nand.c: New file.
2008-04-25 19:41:51 +00:00
robertmh
bfb1f1a2bc 2008-04-15 Robert Millan <rmh@aybabtu.com>
* disk/lvm.c: Update copyright year.
        * kern/misc.c: Likewise.
2008-04-15 13:28:14 +00:00
chaac
01979850ed 2008-04-14 Vesa Jaaskelainen <chaac@nic.fi>
* disk/lvm.c (grub_lvm_scan_device): Add forgotten failure path when
        there is no memory left for physical volume name.
2008-04-14 19:39:04 +00:00
chaac
0a1150e26b 2008-04-14 Vesa Jaaskelainen <chaac@nic.fi>
* disk/lvm.c (grub_lvm_scan_device): Fix logical volume's physical
        volume name mapping to support bigger than 9 character names properly.
2008-04-14 19:08:38 +00:00
robertmh
82ead3fe32 2008-04-13 Robert Millan <rmh@aybabtu.com>
* disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check,
        as per http://www.allensmith.net/Storage/HDDlimit/Int13h.htm
2008-04-13 18:40:25 +00:00
robertmh
7ceeee39d7 2008-04-13 Robert Millan <rmh@aybabtu.com>
Improve robustness when handling LVM.

        * disk/lvm.c (grub_lvm_getvalue): Return 0 when `*p' is NULL
        (and leave `*p' unmodified).
        (grub_lvm_iterate): Don't assume `vg->lvs != NULL' when iterating
        through it.
        (grub_lvm_memberlist): Don't assume `lv->vg->pvs != NULL' when
        iterating through it.
        (grub_lvm_open): Don't assume `vg->lvs != NULL' when iterating
        through it.
        (grub_lvm_scan_device): Check the return value (and fail gracefuly
        when due) on each grub_lvm_getvalue() or grub_strstr() call.
        Don't assume `vg->pvs != NULL' when iterating through it.
2008-04-13 12:22:22 +00:00
proski
ba7328dcba 2008-04-02 Pavel Roskin <proski@gnu.org>
* disk/raid.c (grub_raid_memberlist): Fix a signedness warning.
	* fs/cpio.c (grub_cpio_read): Likewise.
2008-04-02 06:10:44 +00:00
proski
4b6e1995be 2008-04-01 Pavel Roskin <proski@gnu.org>
* disk/ata.c (grub_ata_open): Don't lose precision in disk->id.
	* disk/host.c (grub_host_open): Likewise.
	* disk/loopback.c (grub_loopback_open): Likewise.
	* disk/memdisk.c (grub_memdisk_open): Use a string pointer for
	disk->id as in disk/host.c, not a multi-character constant.
2008-04-02 04:25:41 +00:00
proski
2bb4fb47e8 2008-04-01 Pavel Roskin <proski@gnu.org>
* disk/loopback.c (options): Improve help for "--partitions".
2008-04-02 01:31:11 +00:00
proski
4cb68e896b 2008-03-30 Pavel Roskin <proski@gnu.org>
* disk/host.c: Include grub/misc.h to fix a warning.
	* util/hostfs.c: Use GRUB_MOD_INIT and GRUB_MOD_FINI to fix
	warnings about implicit declarations.
2008-03-30 18:32:15 +00:00
proski
0bf6d401c1 2008-03-30 Pavel Roskin <proski@gnu.org>
* commands/sleep.c: Fix warning about implicit declaration.
	* disk/memdisk.c: Likewise.
	* loader/aout.c: Likewise.
	* loader/i386/bsd_normal.c: Likewise.
	* util/grub-probe.c: Likewise.
2008-03-30 06:13:45 +00:00
proski
7cdacf9717 2008-03-30 Pavel Roskin <proski@gnu.org>
* commands/i386/cpuid.c (has_longmode): Make static.
	* disk/i386/pc/biosdisk.c (cd_drive): Likewise.
	* include/grub/i386/bsd.h (bios_memmap_t): Remove, it's unused.
2008-03-30 05:05:01 +00:00
bean
bf962df2da 2008-03-24 Bean <bean123ch@gmail.com>
* disk/i386/pc/biosdisk.c (cd_start): Removed.
	(cd_count): Removed.
	(cd_drive): New variable.
	(grub_biosdisk_get_drive): Don't check for (cdN) device.
	(grub_biosdisk_call_hook): Likewise.
	(grub_biosdisk_iterate): Change cdrom detection method.
	(grub_biosdisk_open): Replace cd_start with cd_drive.
	(GRUB_MOD_INIT): Use grub_biosdisk_get_cdinfo_int13_extension to
	detect cdrom device.

	* include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START):
	Removed.
	(GRUB_BIOSDISK_MACHINE_CDROM_END): Removed.
	(GRUB_BIOSDISK_CDTYPE_NO_EMUL): New macro.
	(GRUB_BIOSDISK_CDTYPE_1_2_M): Likewise.
	(GRUB_BIOSDISK_CDTYPE_1_44_M): Likewise.
	(GRUB_BIOSDISK_CDTYPE_2_88_M): Likewise.
	(GRUB_BIOSDISK_CDTYPE_HARDDISK): Likewise.
	(GRUB_BIOSDISK_CDTYPE_MASK): Likewise.
	(grub_biosdisk_cdrp): New structure.
	(grub_biosdisk_get_cdinfo_int13_extensions): New function.

	* include/grub/i386/pc/kernel.h (grub_boot_drive): Export this variable.

	* kern/i386/pc/init.c (make_install_device): Don't use (cdN) as root
	device.

	* kern/i386/pc/startup.S (grub_biosdisk_get_cdinfo_int13_extensions):
	New function.
2008-03-24 04:13:37 +00:00
robertmh
68e7fc7aa8 2008-03-20 Robert Millan <rmh@aybabtu.com>
Remove 2 TiB limit in ata.mod.
        * disk/ata.c (grub_ata_device): Promote `size' to grub_uint64_t.
        (grub_ata_dumpinfo): Print sector count with 0x%llx.
        (grub_ata_identify): Interpret `&info16[100]' as a pointer to
        grub_uint64_t instead of grub_uint32_t.
2008-03-20 21:00:15 +00:00
robertmh
7a634e08cb 2008-02-09 Robert Millan <rmh@aybabtu.com>
* disk/raid.c (grub_raid_scan_device): Add a pair of sanity checks for
        situations in which we can deduce the RAID size and the superblock
        doesn't match it.
2008-02-09 10:54:44 +00:00
robertmh
b92f0c1843 2008-02-09 Robert Millan <rmh@aybabtu.com>
* disk/lvm.c [GRUB_UTIL] (grub_lvm_memberlist): New function.  Construct
        and return a grub_diskmemberlist_t composed of LVM physical volumes.
        [GRUB_UTIL] (grub_lvm_dev): Add `memberlist' member.

        * disk/raid.c [GRUB_UTIL] (grub_raid_memberlist): New function.  Construct
        and return a grub_diskmemberlist_t composed of physical array members.
        [GRUB_UTIL] (grub_raid_dev): Add `memberlist' member.

        * include/grub/disk.h [GRUB_UTIL] (grub_disk_memberlist): New struct
        prototype.
        [GRUB_UTIL] (struct grub_disk_dev): Add `memberlist' function pointer.
        [GRUB_UTIL] (struct grub_disk_memberlist): New struct declaration.
        [GRUB_UTIL] (grub_disk_memberlist_t): New typedef.

        * util/grub-probe.c (probe): Move partmap probing code from here ...
        (probe_partmap): ... to here.
        (probe): Use probe_partmap() once for the disk we're probing, and
        additionally, when such disk contains a memberlist() struct member,
        once for each disk that is contained in the structure returned by
        memberlist().
2008-02-09 10:49:29 +00:00
robertmh
a96f9caa1d 2008-02-08 Robert Millan <rmh@aybabtu.com>
* disk/raid.c (grub_raid_scan_device): Check for
        `array->device[sb.this_disk.number]' rather than for
        `array->device[sb.this_disk.number]->name', since the latter is not
        garanteed to be accessible.
2008-02-08 22:39:29 +00:00
robertmh
b37a922267 2008-02-08 Robert Millan <rmh@aybabtu.com>
* disk/raid.c: Update copyright.
        * fs/cpio.c: Likewise.
        * include/grub/raid.h: Likewise.
        * loader/i386/pc/multiboot.c: Likewise.
        * util/hostfs.c: Likewise.
2008-02-08 21:27:55 +00:00
robertmh
5626aee186 2008-02-08 Robert Millan <rmh@aybabtu.com>
* include/grub/raid.h (struct grub_raid_array): Change type of `device'
        to a grub_disk_t array.
        * disk/raid.c (grub_raid_read): Replace `device[x].disk' accesses with
        `device[x]'.
        (grub_raid_scan_device): Replace `device[x].name' accesses with
        `device[x]->name'.  Simplify initialization of `array->device[x]'.
2008-02-08 12:32:25 +00:00
robertmh
554f018744 2008-02-08 Robert Millan <rmh@aybabtu.com>
* disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few
        grub_dprintf() calls.
        * kern/disk.c (grub_disk_read): Include grub_errmsg in out of range
        error message.
2008-02-08 12:22:51 +00:00
robertmh
f2156fda69 2008-02-07 Robert Millan <rmh@aybabtu.com>
Patch from Jeroen Dekkers.
        * disk/raid.c (grub_raid_scan_device): Reset `grub_errno' on disk
        failure, since succesfuly reading all array members might not be
        required.
2008-02-07 12:46:45 +00:00
bean
9be665dd11 2008-01-31 Bean <bean123ch@gmail.com>
* conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img.
        (cdboot_img_SOURCES): New variable.
        (cdboot_img_ASFLAGS): New variable.
        (cdboot_img_LDFLAGS): New variable.

        * boot/i386/pc/cdboot.S: New file.

        * disk/i386/pc/biosdisk.c (cd_start): New variable.
        (cd_count): Likewise.
        (grub_biosdisk_get_drive): Add support for cd device.
        (grub_biosdisk_call_hook): Likewise.
        (grub_biosdisk_iterate): Likewise.
        (grub_biosdisk_open): Likewise.
        (GRUB_BIOSDISK_CDROM_RETRY_COUNT): New macro.
        (grub_biosdisk_rw): Support reading from cd device.
        (GRUB_MOD_INIT): Iterate cd devices.

        * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_FLAG_CDROM): New macro.
        (GRUB_BIOSDISK_MACHINE_CDROM_START): Likewise.
        (GRUB_BIOSDISK_MACHINE_CDROM_END): Likewise.

        * kern/i386/pc/init.c (make_install_device): Check for cd device.
2008-02-03 08:27:15 +00:00
robertmh
2563862970 2008-01-22 Robert Millan <rmh@aybabtu.com>
* disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): When
        `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag is set, skip any
        device that doesn't look like an SD card.
        * include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): Add
        `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag.
        * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_set_flag): Detect
        OLPC laptop, and set `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' when
        found.
2008-01-22 20:13:14 +00:00
robertmh
f970b55e43 2008-01-21 Robert Millan <rmh@aybabtu.com>
* disk/memdisk.c (memdisk_size): New variable.
        (grub_memdisk_open): Replace grub_arch_memdisk_size() call with
        `memdisk_size'.
        (grub_memdisk_init): Initialize `memdisk_size'.  Reallocate memdisk
        image to dynamic memory.
        (grub_memdisk_fini): Replace grub_arch_memdisk_size() call with
        `memdisk_size'.  Free memdisk block.
2008-01-21 14:37:25 +00:00
robertmh
6e9b4aabd4 2008-01-21 Robert Millan <rmh@aybabtu.com>
* disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Add debug message
        on grub_biosdisk_rw_standard() error.
2008-01-21 14:28:34 +00:00
robertmh
55a581dc06 2008-01-21 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_HEADERS): Add `machine/kernel.h'.
        (pkglib_MODULES): Add `memdisk.mod'.
        (memdisk_mod_SOURCES): New variable.
        (memdisk_mod_CFLAGS): Likewise.
        (memdisk_mod_LDFLAGS): Likewise.

        * disk/memdisk.c: New file.

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

        * include/grub/i386/pc/kernel.h
        (GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): New macro.
        (GRUB_KERNEL_MACHINE_PREFIX): Increment by 4.
        (grub_kernel_image_size): New variable declaration.
        (grub_total_module_size): Likewise.
        (grub_memdisk_image_size): Likewise.

        * include/grub/i386/pc/memory.h
        (GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR): New macro.

        * include/grub/kernel.h: Include `<grub/symbol.h>'.
        (grub_arch_memdisk_addr): New variable declaration.
        (grub_arch_memdisk_size): Likewise.

        * kern/i386/pc/init.c (grub_arch_memdisk_addr): New function.
        (grub_arch_memdisk_size): Likewise.

        * kern/i386/pc/startup.S (grub_memdisk_image_size): New variable.
        (codestart): Replace hardcoded `0x100000' with
        `GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR' macro.

        * util/i386/pc/grub-mkimage.c: Include `<grub/misc.h>'.
        (generate_image): Add `memdisk_path' parameter.  When `memdisk_path' is
        not NULL, append the contents of the file it refers to, at the end of
        the compressed kernel image.  Initialize `grub_memdisk_image_size'
        variable (at `GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE' offset).
        (options): Add "memdisk"|'m' option.
        (main): Parse --memdisk|-m option, and pass user-provided path as
        parameter to generate_image().
2008-01-20 23:20:36 +00:00
proski
44cb1ec888 * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Don't use
grub_errno if no errors have been detected.
2008-01-14 04:16:20 +00:00
proski
cc85c3c340 Typo fixes in comments and variable names. 2007-12-30 08:52:06 +00:00
robertmh
57e57e3167 2007-12-23 Robert Millan <rmh@aybabtu.com>
Patch from Bean  <bean123ch@gmail.com>:
	* disk/loopback.c (grub_loopback_read): Add missing bit shift to
	`size'.
2007-12-23 21:28:03 +00:00
robertmh
3b8db1a82b 2007-11-18 Christian Franke <franke@computer.org>
* disk/host.c (grub_host_open): Remove attribute unused from
	name parameter. Add check for "host". This fixes the problem
	that grub-emu does not find partitions.
2007-11-18 07:17:40 +00:00
robertmh
5ab33bba2f 2007-11-05 Robert Millan <rmh@aybabtu.com>
* kern/disk.c (grub_disk_firmware_fini)
	(grub_disk_firmware_is_tainted): New variables.

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

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

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

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

	* include/grub/misc.h (grub_div_roundup): Fix parenthesization.
	* include/grub/i386/time.h (grub_cpu_idle): Disable `hlt' instruction.
2007-11-05 14:54:00 +00:00
marco_g
bb06ab2eb2 2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_pio_read): Don't wait for the command to
	become activate.
	(grub_ata_pio_write): Likewise.

	(grub_atapi_identify): Wait after issuing an ATA command.
	(grub_atapi_packet): Likewise.
	(grub_ata_identify): Likewise.
	(grub_ata_readwrite): Likewise.
2007-11-03 15:45:07 +00:00
marco_g
cf8f780b84 2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_pio_read): Detect and return the error code.
	(grub_ata_pio_write): Likewise.
	(grub_ata_readwrite): Use `grub_error', instead of
	returning `grub_errno'.
2007-11-03 13:12:52 +00:00
marco_g
ed649e5402 2007-11-03 Marco Gerards <marco@gnu.org>
* disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and
	grub_ata_pio_write once for every single sector, instead of for
	multiple sectors.
2007-11-03 12:25:19 +00:00
marco_g
e911ecc1c2 2007-10-31 Marco Gerards <marco@gnu.org>
* conf/i386-pc.rmk (pkgdata_MODULES): Add `ata.mod'.
	(ata_mod_SOURCES): New variable.
	(ata_mod_CFLAGS): Likewise.
	(ata_mod_LDFLAGS): Likewise.

	* disk/ata.c: New file.

	* include/grub/disk.h (grub_disk_dev_id): Add
	`GRUB_DISK_DEV_ATA_ID'.
2007-10-31 22:29:20 +00:00
robertmh
73fcb0f38d 2007-10-22 Robert Millan <rmh@aybabtu.com>
* conf/i386-pc.rmk (kernel_img_SOURCES): Remove `disk/i386/pc/biosdisk.c'.
	(pkgdata_MODULES): Add `biosdisk.mod'.
	(biosdisk_mod_SOURCES, biosdisk_mod_CFLAGS, biosdisk_mod_LDFLAGS): New
	variables.

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

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

	* util/i386/pc/grub-install.in (modules): Add `biosdisk'.
2007-10-22 20:05:27 +00:00
marco_g
0a203f83ff 2007-08-02 Marco Gerards <marco@gnu.org>
* conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/host.c' and
	`util/hostfs.c'.

	* disk/host.c: New file.

	* util/hostfs.c: Likewise.

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

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

	* util/grub-emu.c (main): Initialize and de-initialize hostfs.
2007-08-02 17:24:06 +00:00
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
jeroen
260ba823e6 2007-05-18 Jeroen Dekkers <jeroen@dekkers.cx>
* util/getroot.c (grub_util_get_grub_dev): Support partitionable
	arrays.
	* disk/raid.c (grub_raid_open): Likewise.
2007-05-17 23:23:03 +00:00
hollisb
e2b8278c9e 2006-10-27 Hollis Blanchard <hollis@penguinppc.org>
* disk/ieee1275/ofdisk.c (grub_ofdisk_read): Return error if `status'
	is negative.
	* kern/ieee1275/ieee1275.c (IEEE1275_IHANDLE_INVALID): Change to 0.
2006-10-27 17:57:05 +00:00
jeroen
6555d655e2 2006-10-25 Jeroen Dekkers <jeroen@dekkers.cx>
* disk/lvm.c (grub_lvm_scan_device): Malloc sizeof(*lv) bytes
	instead of sizeof(lv). Patch by Michael Guntsche.
2006-10-25 20:41:43 +00:00
jeroen
4d42b77f3f The "don't use variable names that differ only one character" commit.
2006-10-18  Jeroen Dekkers  <jeroen@dekkers.cx>

	* disk/lvm.c: Rename VGS to VG_LIST.
	(grub_lvm_iterate): Change VGS->LV to VG-LV.
	(grub_lvm_open): Likewise.
	Thanks to Michael Guntsche for finding this bug.
2006-10-18 21:42:42 +00:00
okuji
2b00217369 2006-10-14 Yoshinori K. Okuji <okuji@enbug.org>
* DISTLIST: Added commands/echo.c, disk/lvm.c, disk/raid.c,
        include/grub/bitmap.h, include/grub/lvm.h, include/grub/raid.h,
        include/grub/i386/pc/vbeutil.h, include/grub/util/lvm.h,
        include/grub/util/raid.h, util/lvm.c, util/raid.c, video/bitmap.c,
        video/readers/tga.c and video/i386/pc/vbeutil.c.

2006-10-14  Jeroen Dekkers  <jeroen@dekkers.cx>

        Added support for RAID and LVM.

        * disk/lvm.c: New file.
        * disk/raid.c: Likewise.
        * include/grub/lvm.h: Likewise.
        * include/grub/raid.h: Likewise.
        * include/grub/util/lvm.h: Likewise.
        * include/grub/util/raid.h: Likewise.
        * util/lvm.c: Likewise.
        * util/raid.c: Likewise.

        * include/grub/disk.h (grub_disk_dev_id): Add
        GRUB_DISK_DEVICE_RAID_ID and GRUB_DISK_DEVICE_LVM_ID.
        (grub_disk_get_size): New prototype.
        * kern/disk.c (grub_disk_open): Check whether grub_partition_probe()
        returns a partition.
        (grub_disk_get_size): New function.

        * kern/i386/pc/init.c (make_install_device): Copy the prefix
        verbatim if grub_install_dos_part is -2.

        * util/i386/pc/getroot.c (grub_guess_root_device): Support RAID
        and LVM devices.

        * util/i386/pc/grub-setup.c (setup): New argument
        MUST_EMBED. Force embedding of GRUB when the argument is
        true. Close FILE before returning.
        (main): Add support for RAID and LVM.

        * conf/common.rmk: Add RAID and LVM modules.
        * conf/i386-pc.rmk (grub_setup_SOURCES): Add util/raid.c and
        util/lvm.c.
        (grub_emu_SOURCES): Add disk/raid.c and disk/lvm.c.

        * kern/misc.c (grub_strstr): New function.
        * include/grub/misc.h (grub_strstr): New prototype.
2006-10-14 15:24:53 +00:00
hollisb
fba51f4801 2005-10-01 Hollis Blanchard <hollis@penguinppc.org>
* disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Cast `size' to long.

	* include/grub/ieee1275/ieee1275.h (grub_ieee1275_next_property):
	Remove `flags' argument.  All callers changed.
	* kern/ieee1275/ieee1275.c (IEEE1275_PHANDLE_ROOT): Removed.
	(IEEE1275_IHANDLE_INVALID): New variable.
	(IEEE1275_CELL_INVALID): New variable.
	(grub_ieee1275_finddevice, grub_ieee1275_get_property,
	grub_ieee1275_get_property_length, grub_ieee1275_instance_to_package,
	grub_ieee1275_package_to_path, grub_ieee1275_instance_to_path,
	grub_ieee1275_peer, grub_ieee1275_child, grub_ieee1275_open,
	grub_ieee1275_claim, grub_ieee1275_set_property): Error-check return
	codes from Open Firmware.  All callers updated.
	(grub_ieee1275_next_property): Directly return Open Firmware return
	code.
	* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options):
	Standardize error checking from `grub_ieee1275_get_property'.
	* kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Rename
	`devalias' to `aliases'.  Correct comments.  Consolidate error paths.
2006-10-01 08:30:09 +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
7f362539b7 2006-04-30 Yoshinori K. Okuji <okuji@enbug.org>
Extend the loader so that GRUB can accept a loader which comes
        back to GRUB when a loaded image exits. Also, this change adds
        support for a chainloader on EFI.

        * term/efi/console.c: Include grub/misc.h.
        (grub_console_checkkey): Display a scan code on the top for
        debugging. This will be removed once the EFI port gets stable.
        Correct the scan code mapping.

        * kern/efi/mm.c (sort_memory_map): Sort in a descending order to
        allocate memory from larger regions, in order to reduce the number
        of allocated regions. Otherwise, the MacOSX loader panics.
        (filter_memory_map): Avoid less than 1MB for compatibility with
        other loaders.
        (add_memory_regions): Allocate from the tail of a region, if
        possible, to avoid allocating a region near to 1MB, for the MacOSX
        loader.

        * kern/efi/init.c (grub_efi_set_prefix): Specify
        GRUB_EFI_IMAGE_HANDLE to grub_efi_get_loaded_image.

        * kern/efi/efi.c (grub_efi_get_loaded_image): Accept a new
        argument IMAGE_HANDLE and specify it to get a loaded image.
        (grub_arch_modules_addr): Specify GRUB_EFI_IMAGE_HANDLE to
        grub_efi_get_loaded_image.
        (grub_efi_get_filename): Divide the legnth by the size of
        grub_efi_char16_t.
        (grub_efi_get_device_path): New function.
        (grub_efi_print_device_path): Print End Device Path nodes. Divide
        the length by the size of grub_efi_char16_t for a file path device
        path node.

        * kern/loader.c (grub_loader_noreturn): New variable.
        (grub_loader_set): Accept a new argument NORETURN. Set
        GRUB_LOADER_NORETURN to NORETURN.
        All callers changed.
        (grub_loader_boot): If GRUB_LOADER_NORETURN is false, do not call
        grub_machine_fini.

        * include/grub/efi/efi.h (grub_efi_get_device_path): New
        prototype.
        (grub_efi_get_loaded_image): Take an argument to specify an image
        handle.

        * include/grub/loader.h (grub_loader_set): Added one more argument
        NORETURN.

        * disk/efi/efidisk.c (make_devices): Use grub_efi_get_device_path
        instead of grub_efi_open_protocol.
        (grub_efidisk_get_device_name): Likewise.
        (grub_efidisk_close): Print a newline.
        (grub_efidisk_get_device_handle): Fixed to use
        GRUB_EFI_DEVICE_PATH_SUBTYPE instead of
        GRUB_EFI_DEVICE_PATH_TYPE.

        * disk/efi/efidisk.c (device_path_guid): Moved to ...
        * kern/efi/efi.c (device_path_guid): ... here.

        * conf/i386-efi.rmk (pkgdata_MODULES): Added _chain.mod and
        chain.mod.
        (kernel_mod_HEADERS): Added efi/disk.h.
        (_chain_mod_SOURCES): New variable.
        (_chain_mod_CFLAGS): Likewise.
        (_chain_mod_LDFLAGS): Likewise.
        (chain_mod_SOURCES): Likewise.
        (chain_mod_CFLAGS): Likewise.
        (chain_mod_LDFLAGS): Likewise.

        * DISTLIST: Added include/grub/efi/chainloader.h,
        loader/efi/chainloader.c and loader/efi/chainloader_normal.c.

        * include/grub/efi/chainloader.h: New file.
        * loader/efi/chainloader.c: Likewise.
        * loader/efi/chainloader_normal.c: Likewise.
2006-04-30 21:09:37 +00:00