Commit Graph

36 Commits

Author SHA1 Message Date
Vincent Batts 1b24dcf433 one patch, on grub-2.04 2020-10-29 15:48:21 -04:00
Alexander Graf f1957dc8a3 RISC-V: Add to build system
This patch adds support for RISC-V to the grub build system. With this
patch, I can successfully build grub on RISC-V as a UEFI application.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-02-25 14:02:05 +01:00
Alexander Graf e4b84a0d7c efi: Rename armxx to arch
Some architectures want to boot Linux as plain UEFI binary. Today that
really only encompasses ARM and AArch64, but going forward more
architectures may adopt that model.

So rename our internal API accordingly.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-02-25 11:28:44 +01:00
Leif Lindholm d0c070179d arm/efi: Switch to arm64 linux loader
The arm64 and arm linux kernel EFI-stub support presents pretty much
identical interfaces, so the same linux loader source can be used for
both architectures.

Switch 32-bit ARM UEFI platforms over to the existing EFI-stub aware
loader initially developed for arm64.

This *WILL* stop non-efistub Linux kernels from booting on arm-efi.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2018-07-25 14:18:11 +02:00
Leif Lindholm d24dd12086 arm64/linux/loader: Rename functions and macros and move to common headers
In preparation for using the linux loader for 32-bit and 64-bit platforms,
rename grub_arm64*/GRUB_ARM64* to grub_armxx*/GRUB_ARMXX*.

Move prototypes for now-common functions to efi/efi.h.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2018-07-25 14:18:11 +02:00
Leif Lindholm bad144c60f efi: Add grub_efi_get_ram_base() function for arm64
Since ARM platforms do not have a common memory map, add a helper
function that finds the lowest address region with the EFI_MEMORY_WB
attribute set in the UEFI memory map.

Required for the arm64 efi linux loader to restrict the initrd
location to where it will be accessible by the kernel at runtime.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2018-07-25 14:18:11 +02:00
Leif Lindholm 8ec18d1a4c efi: Add central copy of grub_efi_find_mmap_size
There are several implementations of this function in the tree.
Add a central version in grub-core/efi/mm.c.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2018-07-25 14:18:11 +02:00
Alexander Graf 92bfc33db9 efi: Free malloc regions on exit
When we exit grub, we don't free all the memory that we allocated earlier
for our heap region. This can cause problems with setups where you try
to descend the boot order using "exit" entries, such as PXE -> HD boot
scenarios.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2017-09-07 23:35:01 +02:00
Vladimir Serbinenko 4bc909bf89 Remove grub_efi_allocate_pages.
grub_efi_allocate_pages Essentially does 2 unrelated things:
* Allocate at fixed address.
* Allocate at any address.

To switch between 2 different functions it uses address == 0 as magic
value which is wrong as 0 is a perfectly valid fixed adress to allocate at.
2017-08-07 18:33:29 +02:00
Leif Lindholm dd5fde2df8 efi: refactor grub_efi_allocate_pages
Expose a new function, grub_efi_allocate_pages_real(), making it possible
to specify allocation type and memory type as supported by the UEFI
AllocatePages boot service.

Make grub_efi_allocate_pages() a consumer of the new function,
maintaining its old functionality.

Also delete some left-around #if 1/#else blocks in the affected
functions.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-08-07 18:23:39 +02:00
Alexander Graf 0d2345774d efi: Move fdt helper into own file
We only support FDT files with EFI on arm and arm64 systems, not
on x86. So move the helper that finds a prepopulated FDT UUID
into its own file and only build it for architectures where it
also gets called.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-11-24 10:09:24 +01:00
Alexander Graf fbca374105 arm64: Move firmware fdt search into global function
Searching for a device tree that EFI passes to us via configuration tables
is nothing architecture specific. Move it into generic code.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2016-11-10 13:20:56 +01:00
Andrei Borzenkov 7b386b7031 efidisk: move device path helpers in core for efinet 2015-05-07 20:37:16 +03:00
Peter Jones c5052c81ab * grub-core/Makefile.core.def (efifwsetup): New module.
* grub-core/commands/efi/efifwsetup.c: New file.
	* grub-core/kern/efi/efi.c (grub_efi_set_variable): New function
	* include/grub/efi/api.h (GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI):
	New define.
	* include/grub/efi/efi.h (grub_efi_set_variable): New proto.
2012-09-08 09:40:24 +02:00
Vladimir 'phcoder' Serbinenko 1ecd61a47a Fix efi chainloader on network root.
* grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Handle
	network devices.
	* grub-core/net/drivers/efi/efinet.c (grub_efinet_get_device_handle):
	New function.
2012-03-10 20:41:28 +01:00
Matthew Garrett 3935dde2f2 Use EDID on EFI.
* grub-core/kern/efi/efi.c (grub_efi_get_variable): New argument
	datasize_out.
	* grub-core/video/efi_gop.c (check_protocol): Check that GOP has usable
	modes. Set gop_handle.
	(grub_video_gop_get_edid): New function.
	(grub_gop_get_preferred_mode): Likewise.
	(grub_video_gop_setup): Use grub_gop_get_preferred_mode.
	(grub_video_efi_gop_adapter): Set .get_edid.
	* include/grub/efi/edid.h: New file.
	* include/grub/efi/efi.h (grub_efi_get_variable): Update proto.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2012-03-04 00:48:21 +01:00
Matthew Garrett c598862958 * grub-core/kern/efi/efi.c (grub_efi_get_variable): Add new function.
* include/grub/efi/efi.h: Likewise.
	* include/grub/efi/api.h: Add guid for EFI-specified variables.
	* include/grub/charset.h (GRUB_MAX_UTF16_PER_UTF8): New definition.
	* grub-core/normal/charset.c (grub_utf8_process): Move from here ...
	* include/grub/charset.h (grub_utf8_process): ... to here. Inline.
	* grub-core/normal/charset.c (grub_utf8_to_utf16): Move from here ...
	* include/grub/charset.h (grub_utf8_to_utf16): ... to here. Inline.
2012-02-27 12:02:57 +01:00
Vladimir 'phcoder' Serbinenko 39705fadd7 Replace grub_module_iterate with FOR_MODULES.
* grub-core/disk/memdisk.c (GRUB_MOD_INIT): Switched to new interface.
	* grub-core/kern/efi/efi.c (grub_arch_modules_addr): Renamed to...
	(grub_efi_modules_addr): ...this.
	* grub-core/kern/efi/init.c (grub_modbase): New variable.
	(grub_efi_init): Set grub_modbase.
	* grub-core/kern/emu/main.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	* grub-core/kern/i386/coreboot/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/i386/pc/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/ieee1275/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/main.c (grub_module_iterate): Remove.
	(grub_modules_get_end): Use grub_modbase.
	(grub_load_modules): Use FOR_MODULES.
	(grub_load_config): Likewise.
	* grub-core/kern/mips/arc/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/mips/loongson/init.c (grub_arch_modules_addr): Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* grub-core/kern/mips/qemu_mips/init.c (grub_arch_modules_addr):
	Removed.
	(grub_modbase): New variable.
	(grub_machine_init): Set grub_modbase.
	* include/grub/efi/efi.h (grub_efi_modules_addr): New declaration.
	* include/grub/kernel.h (grub_arch_modules_addr): Removed.
	(grub_module_iterate): Likewise.
	(grub_modbase): New variable declaration.
	(FOR_MODULES): New macro.
2011-10-16 15:23:29 +02:00
Vladimir 'phcoder' Serbinenko cae730b452 Automatically determine prefix when netbooted on EFI 2011-07-02 16:56:35 +02:00
Vladimir 'phcoder' Serbinenko c6fb51295b merge mainline into newreloc 2010-05-01 15:10:44 +02:00
Vladimir 'phcoder' Serbinenko 91b58e6b74 EFI requests support for newreloc 2010-04-20 18:08:26 +02:00
Robert Millan 58bc8bd5b1 2010-01-03 Robert Millan <rmh.grub@aybabtu.com>
* boot/i386/pc/boot.S: Update copyright year.
	* boot/i386/pc/cdboot.S: Likewise.
	* boot/i386/pc/diskboot.S: Likewise.
	* boot/i386/pc/lnxboot.S: Likewise.
	* boot/i386/pc/pxeboot.S: Likewise.
	* bus/pci.c: Likewise.
	* commands/cmp.c: Likewise.
	* commands/help.c: Likewise.
	* commands/hexdump.c: Likewise.
	* commands/i386/pc/halt.c: Likewise.
	* commands/i386/pc/play.c: Likewise.
	* commands/i386/pc/vbeinfo.c: Likewise.
	* commands/ls.c: Likewise.
	* commands/test.c: Likewise.
	* disk/dmraid_nvidia.c: Likewise.
	* disk/i386/pc/biosdisk.c: Likewise.
	* disk/ieee1275/nand.c: Likewise.
	* disk/ieee1275/ofdisk.c: Likewise.
	* disk/lvm.c: Likewise.
	* disk/raid.c: Likewise.
	* disk/raid6_recover.c: Likewise.
	* disk/scsi.c: Likewise.
	* fs/affs.c: Likewise.
	* fs/cpio.c: Likewise.
	* fs/ext2.c: Likewise.
	* fs/hfs.c: Likewise.
	* fs/iso9660.c: Likewise.
	* fs/ntfs.c: Likewise.
	* fs/sfs.c: Likewise.
	* fs/udf.c: Likewise.
	* fs/ufs.c: Likewise.
	* fs/xfs.c: Likewise.
	* gencmdlist.sh: Likewise.
	* genmk.rb: Likewise.
	* include/grub/disk.h: Likewise.
	* include/grub/efi/api.h: Likewise.
	* include/grub/efi/efi.h: Likewise.
	* include/grub/efi/pe32.h: Likewise.
	* include/grub/elf.h: Likewise.
	* include/grub/fs.h: Likewise.
	* include/grub/i386/at_keyboard.h: Likewise.
	* include/grub/i386/pc/memory.h: Likewise.
	* include/grub/i386/pc/vbe.h: Likewise.
	* include/grub/i386/pci.h: Likewise.
	* include/grub/i386/tsc.h: Likewise.
	* include/grub/ieee1275/ieee1275.h: Likewise.
	* include/grub/ntfs.h: Likewise.
	* include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
	* include/grub/sparc64/libgcc.h: Likewise.
	* include/grub/symbol.h: Likewise.
	* include/grub/types.h: Likewise.
	* include/multiboot2.h: Likewise.
	* io/gzio.c: Likewise.
	* kern/device.c: Likewise.
	* kern/disk.c: Likewise.
	* kern/efi/efi.c: Likewise.
	* kern/efi/mm.c: Likewise.
	* kern/elf.c: Likewise.
	* kern/file.c: Likewise.
	* kern/i386/dl.c: Likewise.
	* kern/i386/pc/init.c: Likewise.
	* kern/i386/pc/startup.S: Likewise.
	* kern/ieee1275/ieee1275.c: Likewise.
	* kern/ieee1275/init.c: Likewise.
	* kern/main.c: Likewise.
	* kern/mm.c: Likewise.
	* kern/powerpc/dl.c: Likewise.
	* kern/sparc64/dl.c: Likewise.
	* kern/x86_64/dl.c: Likewise.
	* lib/hexdump.c: Likewise.
	* loader/efi/appleloader.c: Likewise.
	* loader/i386/ieee1275/linux.c: Likewise.
	* loader/i386/pc/chainloader.c: Likewise.
	* loader/i386/pc/linux.c: Likewise.
	* loader/i386/pc/multiboot2.c: Likewise.
	* loader/ieee1275/multiboot2.c: Likewise.
	* loader/multiboot2.c: Likewise.
	* loader/multiboot_loader.c: Likewise.
	* loader/powerpc/ieee1275/linux.c: Likewise.
	* normal/completion.c: Likewise.
	* normal/menu_entry.c: Likewise.
	* partmap/apple.c: Likewise.
	* util/grub.d/10_hurd.in: Likewise.
	* util/hostfs.c: Likewise.
	* video/readers/png.c: Likewise.
2010-01-03 22:05:07 +00:00
Vladimir 'phcoder' Serbinenko 7ea73643f5 merge mtrunk into xnu 2009-12-18 03:57:32 +01:00
Robert Millan 6b8474f8e8 2009-12-04 Robert Millan <rmh.grub@aybabtu.com>
* commands/halt.c: Replace misc arch-specific headers with
        `<grub/misc.h>'.
        * commands/reboot.c: Likewise.
        * commands/i386/pc/halt.c: Replace `<grub/machine/init.h>' with
        `<grub/misc.h>'.
        * conf/i386-coreboot.rmk (kernel_img_HEADERS): Remove `cpu/reboot.h'.
        (halt_mod_SOURCES): Move `kern/i386/halt.c' from here ...
        (kernel_img_SOURCES): ... to here.

        * include/grub/efi/efi.h (grub_reboot, grub_halt): Remove prototypes.
        * include/grub/i386/pc/init.h: Likewise.
        * include/grub/powerpc/ieee1275/kernel.h: Likewise.
        * include/grub/sparc64/ieee1275/kernel.h: Likewise.

        * include/grub/misc.h (grub_reboot, grub_halt): New prototypes.

        * include/grub/i386/halt.h: Remove.
        * include/grub/i386/reboot.h: Likewise.

        * kern/i386/halt.c: Remove `<grub/cpu/halt.h>'.
2009-12-03 23:07:29 +00:00
phcoder 12d6fc8461 EFI support 2009-09-03 19:19:59 +02:00
phcoder 8a10b2c632 now hangs at maxDec 2009-09-02 13:34:40 +02:00
phcoder bbee0f2b56 2009-05-03 Vladimir Serbinenko <phcoder@gmail.com>
xnu support

	* conf/i386-efi.rmk (kernel_mod_HEADERS): added i386/pit.h
	(pkglib_MODULES): add xnu.mod
	(xnu_mod_SOURCES): new variable
	(xnu_mod_CFLAGS): likewise
	(xnu_mod_LDFLAGS): likewise
	(xnu_mod_ASFLAGS): likewise
	* conf/i386-pc.rmk: likewise
	* conf/x86_64-efi.rmk: likewise
	* include/grub/efi/efi.h (grub_efi_finish_boot_services): 
	new declaration
	* include/grub/i386/macho.h: new file
	* include/grub/i386/xnu.h: likewise
	* include/grub/macho.h: likewise
	* include/grub/machoload.h: likewise
	* include/grub/x86_64/macho.h: likewise
	* include/grub/x86_64/xnu.h: likewise
	* include/grub/xnu.h: likewise
	* kern/efi/efi.c (grub_efi_finish_boot_services): new function
	* kern/efi/mm.c (MAX_HEAP_SIZE): increase
	* loader/i386/efi/xnu.c: new file
	* loader/i386/pc/xnu.c: likewise
	* loader/i386/xnu.c: likewise
	* loader/i386/xnu_helper.S: likewise
	* loader/macho.c: likewise
	* loader/xnu.c: likewise
	* loader/xnu_resume.c: likewise
	* util/grub-dumpdevtree: likewise
	* include/grub/i386/pit.h: include grub/err.h
	(grub_pit_wait): export
	* util/grub.d/30_os-prober.in: support Darwin/Mac OS X
2009-05-02 23:19:20 +00:00
boeglin f714229e34 2008-02-12 Alexandre Boeglin <alex@boeglin.org>
* conf/i386-efi.rmk (grub_emu_SOURCES): Replace commands/i386/pc/halt.c and
  reboot.c by commands/halt.c and reboot.c.
  (grub_install_SOURCES): Add halt.mod and reboot.mod.
  (halt_mod_SOURCES): New variable.
  (halt_mod_CFLAGS): Likewise.
  (halt_mod_LDFLAGS): Likewise.
  (reboot_mod_SOURCES): Likewise.
  (reboot_mod_CFLAGS): Likewise.
  (reboot_mod_LDFLAGS): Likewise.

  * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace commands/ieee1275/halt.c
  and reboot.c by commands/halt.c and reboot.c.
  (halt_mod_SOURCES): Likewise.
  (reboot_mod_SOURCES): Likewise.

  * conf/i386-pc.rmk (grub_emu_SOURCES): Replace commands/i386/pc/reboot.c by
  commands/reboot.c.
  (reboot_mod_SOURCES): Likewise.

  * commands/i386/pc/reboot.c: merge this file ...

  * commands/ieee1275/reboot.c: ... and this file ...

  * commands/reboot.c: ... to this file.
  Add some precompiler directive to include the correct header for each
  machine.

  * commands/ieee1275/halt.c: move this file ...

  * commands/halt.c: ... to here.
  Add some precompiler directive to include the correct header for each
  machine.

  * include/grub/efi/efi.h (grub_reboot): New function declaration.
  (grub_halt): Likewise.

  * kern/efi/efi.c (grub_reboot): New function.
  (grub_halt): Likewise.
2008-02-12 23:47:07 +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
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 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
okuji 2965c7cc2d 2006-04-25 Yoshinori K. Okuji <okuji@enbug.org>
A new machine-specific function "grub_machine_set_prefix" is
        defined. This is called after loading modules, so that a prefix
        initialization can use modules. Also, this change adds an
        intensive debugging feature for the memory manager via the
        configure option "--enable-mm-debug".

        * partmap/gpt.c (gpt_partition_map_iterate): Add one more into
        PART.LEN.

        * kern/sparc64/ieee1275/init.c (abort): Removed.
        (grub_stop): Likewise.
        (grub_exit): New function.
        (grub_set_prefix): Renamed to ...
        (grub_machine_set_prefix): ... this.
        (grub_machine_init): Do not call grub_set_prefix.

        * kern/powerpc/ieee1275/init.c (grub_set_prefix): Renamed to ...
        (grub_machine_set_prefix): ... this.
        (grub_machine_init): Do not call grub_set_prefix.

        * kern/i386/pc/init.c (grub_machine_set_prefix): New function.
        (grub_machine_init): Do not set the prefix here.

        * kern/i386/efi/init.c (grub_machine_set_prefix): New function.

        * kern/efi/init.c: Include grub/mm.h.
        (grub_efi_set_prefix): New function.

        * kern/efi/efi.c (grub_exit): Call grub_efi_fini.
        (grub_efi_get_filename): New function.
        (grub_print_device_path): Renamed to ...
        (grub_efi_print_device_path): ... this.

        * kern/mm.c [MM_DEBUG] (grub_malloc): Undefined.
        [MM_DEBUG] (grub_realloc): Likewise.
        [MM_DEBUG] (grub_free): Likewise.
        [MM_DEBUG] (grub_memalign): Likewise.
        [MM_DEBUG] (grub_mm_debug): New variable.
        [MM_DEBUG] (grub_debug_malloc): New function.
        [MM_DEBUG] (grub_debug_free): New function.
        [MM_DEBUG] (grub_debug_realloc): New function.
        [MM_DEBUG] (grub_debug_memalign): New function.

        * kern/misc.c (grub_abort): Print a newline to distinguish
        the message.

        * kern/main.c (grub_main): Call grub_machine_set_prefix and
        grub_set_root_dev after loading modules. This is necessary when
        setting a prefix depends on modules.

        * include/grub/efi/efi.h (grub_print_device_path): Renamed to ...
        (grub_efi_print_device_path): ... this.
        (grub_efi_get_filename): New prototype.
        (grub_efi_set_prefix): Likewise.

        * include/grub/efi/disk.h: Include grub/efi/api.h, grub/symbol.h
        and grub/disk.h.
        (grub_efidisk_get_device_handle): New prototype.
        (grub_efidisk_get_device_name): Likewise.

        * include/grub/mm.h: Include config.h.
        (MM_DEBUG): Removed.
        [MM_DEBUG && !GRUB_UTIL] (grub_mm_debug): New prototype.
        [MM_DEBUG && !GRUB_UTIL] (grub_malloc): New macro.
        [MM_DEBUG && !GRUB_UTIL] (grub_realloc): Likewise.
        [MM_DEBUG && !GRUB_UTIL] (grub_memalign): Likewise.
        [MM_DEBUG && !GRUB_UTIL] (grub_free): Likewise.
        [MM_DEBUG && !GRUB_UTIL] (grub_debug_malloc): New prototype.
        [MM_DEBUG && !GRUB_UTIL] (grub_debug_realloc): New prototype.
        [MM_DEBUG && !GRUB_UTIL] (grub_debug_memalign): New prototype.
        [MM_DEBUG && !GRUB_UTIL] (grub_debug_free): New prototype.

        * include/grub/kernel.h (grub_machine_set_prefix): New prototype.

        * disk/efi/efidisk.c: Include grub/partition.h.
        (iterate_child_devices): New function.
        (add_device): First, compare only last device path nodes, so that
        devices are sorted by the types.
        (grub_efidisk_get_device_handle): New function.
        (grub_efidisk_get_device_name): Likewise.

        * configure.ac (--enable-mm-debug): New option to enable the
        memory manager debugging feature. This makes the binary much
        bigger, so is disabled by default.
2006-04-25 20:08:31 +00:00
okuji 9cacaa174c 2006-04-23 Yoshinori K. Okuji <okuji@enbug.org>
Use grub_abort instead of grub_stop, and grub_exit must be
        define in each architecture now. Also, this change adds support
        for EFI disks.

        * util/i386/pc/grub-probefs.c: Include grub/term.h.
        (grub_getkey): New function.
        (grub_term_get_current): Likewise.

        * util/i386/pc/grub-setup.c: Include grub/term.h.
        (grub_getkey): New function.
        (grub_term_get_current): Likewise.

        * util/misc.c (grub_stop): Renamed to ...
        (grub_exit): ... this.

        * kern/powerpc/ieee1275/init.c (abort): Renamed to ...
        (grub_exit): ... this.
        (grub_machine_init): Use grub_abort instead of abort.
        (grub_stop): Removed.

        * kern/powerpc/ieee1275/cmain.c (cmain): Use grub_abort instead of
        abort.

        * kern/i386/pc/startup.S (grub_exit): New function.
        (cold_reboot): New label.

        * kern/efi/init.c: Include grub/efi/disk.h and grub/env.h.
        (grub_efi_init): Call grub_efidisk_init.
        (grub_efi_fini): Call grub_efidisk_fini.

        * kern/efi/efi.c: Include grub/mm.h.
        (grub_efi_console_control_guid): Renamed to ...
        (console_control_guid): ... this.
        (grub_efi_loaded_image_guid): Renamed to ...
        (loaded_image_guid): ... this.
        (grub_efi_locate_handle): New function.
        (grub_efi_open_protocol): Likewise.
        (grub_efi_set_text_mode): Use CONSOLE_CONTROL_GUID instead of
        GRUB_EFI_CONSOLE_CONTROL_GUID.
        (grub_efi_exit): Removed.
        (grub_stop): Likewise.
        (grub_efi_get_loaded_image): Use grub_efi_open_protocol.
        (grub_exit): New function.
        (grub_print_device_path): Likewise.

        * kern/rescue.c (grub_rescue_cmd_exit): New function.
        (grub_enter_rescue_mode): Register "exit".

        * kern/misc.c (grub_real_dprintf): A cosmetic change.
        (grub_abort): New function.

        * kern/err.c (grub_fatal): Use grub_abort instead of grub_stop.

        * include/grub/sparc64/ieee1275/kernel.h (abort): Removed.

        * include/grub/powerpc/ieee1275/kernel.h (abort): Removed.

        * include/grub/efi/efi.h (grub_efi_exit): Removed.
        (grub_print_device_path): New prototype.
        (grub_efi_locate_handle): Likewise.
        (grub_efi_open_protocol): Likewise.

        * include/grub/efi/disk.h (grub_efidisk_fini): New file.
        * disk/efi/efidisk.c: Likewise.

        * DISTLIST: Added disk/efi/efidisk.c and include/grub/efi/disk.h.

        * include/grub/efi/console_control.h
        (GRUB_EFI_CONSOLE_CONTROL_GUID): Use an array for the last 8 bytes.

        * include/grub/efi/api.h (GRUB_EFI_LOADED_IMAGE_GUID): Specify the
        last 8 bytes as an array.
        (GRUB_EFI_DISK_IO_GUID): New macro.
        (GRUB_EFI_BLOCK_IO_GUID): Likewise.
        (GRUB_EFI_DEVICE_PATH_GUID): Likewise.
        (grub_efi_ipv6_address_t): Change the type to grub_uint16_t from
        grub_uint8_t.
        (struct grub_efi_guid): Use an array to specify the last 8 bytes.
        (struct grub_efi_device_path): Rename the member "sub_type" to
        "subtype".
        (GRUB_EFI_DEVICE_PATH_TYPE): New macro.
        (GRUB_EFI_DEVICE_PATH_SUBTYPE): Likewise.
        (GRUB_EFI_DEVICE_PATH_LENGTH): Likewise.
        (GRUB_EFI_END_DEVICE_PATH_TYPE): Likewise.
        (GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE): Likewise.
        (GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE): Likewise.
        (GRUB_EFI_END_ENTIRE_DEVICE_PATH): Likewise.
        (GRUB_EFI_NEXT_DEVICE_PATH): Likewise.
        (GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE): Likewise.
        (GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE): Likewise.
        (struct grub_efi_pci_device_path): New structure.
        (grub_efi_pci_device_path_t): New type.
        (GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_pccard_device_path): New structure.
        (grub_efi_pccard_device_path_t): New type.
        (GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_memory_mapped_device_path): New structure.
        (grub_efi_memory_mapped_device_path_t): New type.
        (GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_vendor_device_path): New structure.
        (grub_efi_vendor_device_path_t): New type.
        (GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_controller_device_path): New structure.
        (grub_efi_controller_device_path_t): New type.
        (GRUB_EFI_ACPI_DEVICE_PATH_TYPE): New macro.
        (GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE): Likewise.
        (struct grub_efi_acpi_device_path): New structure.
        (grub_efi_acpi_device_path_t): New type.
        (GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_expanded_acpi_device_path): New structure.
        (grub_efi_expanded_acpi_device_path_t): New type.
        (GRUB_EFI_EXPANDED_ACPI_HIDSTR): New macro.
        (GRUB_EFI_EXPANDED_ACPI_UIDSTR): Likewise.
        (GRUB_EFI_EXPANDED_ACPI_CIDSTR): Likewise.
        (GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE): Likewise.
        (GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE): Likewise.
        (struct grub_efi_atapi_device_path): New structure.
        (grub_efi_atapi_device_path_t): New type.
        (GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_fibre_channel_device_path): New structure.
        (grub_efi_fibre_channel_device_path_t): New type.
        (GRUB_EFI_1394_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_1394_device_path): New structure.
        (grub_efi_1394_device_path_t): New type.
        (GRUB_EFI_USB_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_usb_device_path): New structure.
        (grub_efi_usb_device_path_t): New type.
        (GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_usb_class_device_path): New structure.
        (grub_efi_usb_class_device_path_t): New type.
        (GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_i2o_device_path): New structure.
        (grub_efi_i2o_device_path_t): New type.
        (GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_mac_address_device_path): New structure.
        (grub_efi_mac_address_device_path_t): New type.
        (GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_ipv4_device_path): New structure.
        (grub_efi_ipv4_device_path_t): New type.
        (GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_ipv6_device_path): New structure.
        (grub_efi_ipv6_device_path_t): New type.
        (GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_infiniband_device_path): New structure.
        (grub_efi_infiniband_device_path_t): New type.
        (GRUB_EFI_UART_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_uart_device_path): New structure.
        (grub_efi_uart_device_path_t): New type.
        (GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_vendor_messaging_device_path): New structure.
        (grub_efi_vendor_messaging_device_path_t): New type.
        (GRUB_EFI_MEDIA_DEVICE_PATH_TYPE): New macro.
        (GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE): Likewise.
        (struct grub_efi_hard_drive_device_path): New structure.
        (grub_efi_hard_drive_device_path_t): New type.
        (GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_cdrom_device_path): New structure.
        (grub_efi_cdrom_device_path_t): New type.
        (GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_vendor_media_device_path): New structure.
        (grub_efi_vendor_media_device_path_t): New type.
        (GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_file_path_device_path): New structure.
        (grub_efi_file_path_device_path_t): New type.
        (GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE): New macro.
        (struct grub_efi_protocol_device_path): New structure.
        (grub_efi_protocol_device_path_t): New type.
        (GRUB_EFI_BIOS_DEVICE_PATH_TYPE): New macro.
        (GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE): Likewise.
        (struct grub_efi_bios_device_path): New structure.
        (grub_efi_bios_device_path_t): New type.
        (struct grub_efi_disk_io): New structure.
        (grub_efi_disk_io_t): New type.
        (struct grub_efi_block_io_media): New structure.
        (grub_efi_block_io_media_t): New type.
        (struct grub_efi_block_io): New structure.
        (grub_efi_block_io_t): New type.

        * include/grub/misc.h (grub_stop): Removed.
        (grub_exit): New prototype.
        (grub_abort): Likewise.

        * include/grub/disk.h (enum grub_disk_dev_id): Added
        GRUB_DISK_DEVICE_EFIDISK_ID.

        * conf/i386-efi.rmk (kernel_mod_SOURCES): Added
        disk/efi/efidisk.c.
        (kernel_syms.lst): Remove the target if an error occurs.
2006-04-23 13:37:36 +00:00
okuji 2eab1c0dad 2006-04-20 Yoshinori K. Okuji <okuji@enbug.org>
Add support for pre-loaded modules into the EFI port.

        * util/i386/efi/grub-mkimage.c (make_mods_section): Rewritten
        completely. Accept one more argument DIR. The caller has changed.

        * kern/i386/efi/init.c (grub_arch_modules_addr): Removed.

        * kern/efi/efi.c: Include grub/efi/pe32.h and grub/kernel.h.
        (grub_efi_loaded_image_guid): New variable.
        (grub_efi_get_loaded_image): New function.
        (grub_arch_modules_addr): Likewise.

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

        * include/grub/efi/api.h (GRUB_EFI_LOADED_IMAGE_GUID): New macro.
        (struct grub_efi_loaded_image): New structure.
        (grub_efi_loaded_image_t): New type.
2006-04-20 04:29:17 +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