Commit Graph

143 Commits

Author SHA1 Message Date
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
Juergen Gross 9c062ad42c xen_pvh: Add build runes for grub-core
Add the modifications to the build system needed to build a xen_pvh
grub.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
2018-12-12 12:03:27 +01:00
Juergen Gross 0b3e4eb2d2 xen: Add basic hooks for PVH in current code
Add the hooks to current code needed for Xen PVH. They will be filled
with code later when the related functionality is being added.

loader/i386/linux.c needs to include machine/kernel.h now as it needs
to get GRUB_KERNEL_USE_RSDP_ADDR from there. This in turn requires to
add an empty kernel.h header for some i386 platforms (efi, coreboot,
ieee1275, xen) and for x86_64 efi.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
2018-12-12 12:03:27 +01:00
Leif Lindholm 77808dd66b arm: Delete unused efi support from loader/arm
The 32-bit arm efi port now shares the 64-bit linux loader, so delete
the now unused bits from the 32-bit linux loader.

This in turn leaves the grub-core/kern/arm/efi/misc.c unused, so
delete that too.

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
Vladimir Serbinenko 265292f2b0 arm_coreboot: Support DMA.
This is needed to support USB and some other busses.
2017-05-08 22:06:04 +02:00
Vladimir Serbinenko 848bed9d92 arm_coreboot: Support keyboard for vexpress. 2017-05-08 21:42:37 +02:00
Vladimir Serbinenko ac6b41b89f arm-coreboot: Export FDT routines.
We need to use them from modules as well.
2017-05-08 21:29:48 +02:00
Vladimir Serbinenko fcbb723d4b Add support for device-tree-based drivers. 2017-05-08 21:19:59 +02:00
Vladimir Serbinenko 24e37a8852 arm-coreboot: Start new port. 2017-05-08 20:53:28 +02:00
Vladimir Serbinenko 461bfab7b7 coreboot: Split parts that are platform-independent.
We currently assume that coreboot is always i386, it's no longer the case,
so split i386-coreboot parts from generic coreboot code.
2017-05-08 19:10:24 +02:00
Vladimir Serbinenko c2ea443446 Use $(SHELL) rather than /bin/sh.
/bin/sh doesn't exist under termux.
2017-05-03 12:46:38 +02:00
Vladimir Serbinenko d9a3bfead8 Split pmtimer wait and tsc measurement from pmtimer tsc calibration. 2016-02-12 11:40:51 +01:00
Andrei Borzenkov ba83ed1538 Add missing BUILD_EXEEXT 2016-01-01 12:06:40 +03:00
Vladimir Serbinenko a7cf8b1e23 Verify modules on build-time rather than failing in runtime. 2015-12-31 13:09:15 +01:00
Vladimir Serbinenko d43a5ee651 tsc: Use alternative delay sources whenever appropriate.
PIT isn't available on some of new hardware including Hyper-V. So
use pmtimer for calibration. Moreover pmtimer calibration is faster, so
use it on coreboor where booting time is important.

Based on patch by Michael Chang.
2015-11-27 11:39:55 +01:00
Vladimir Serbinenko 9d25b0da9a Remove emu libusb support.
It's disabled by default and has been broken for a long time.
As nobody is interested in fixing and maintaining it, remove it.
2015-03-03 20:59:36 +01:00
Vladimir Serbinenko 064360e667 Remove libgcc dependency.
libgcc for boot environment isn't always present and compatible.
libgcc is often absent if endianness or bit-size at boot is different
from running OS.
libgcc may use optimised opcodes that aren't available on boot time.
So instead of relying on libgcc shipped with the compiler, supply
the functions in GRUB directly.
Tests are present to ensure that those replacement functions behave the
way compiler expects them to.
2015-03-03 20:50:37 +01:00
Andrey Borzenkov 015045471e use MODULE_FILES for genemuinit* instead of MOD_FILES
MinGW native nm does not support ELF binaries.
2014-01-18 23:15:40 +04:00
Andrey Borzenkov 1ecf96fcc4 add BUILD_EXEEXT support to fix make clean on Windows
Add $(BUILD_EXEEXT) to ensure files are removed. Also add CLEANFILES where
appropriate.
2014-01-18 20:41:24 +04:00
Andrey Borzenkov dcecae1a49 reintroduce BUILD_LDFLAGS for the cross-compile case
This allows providing separate LDFLAGS for build and host environments, which
are not necessary the same for cross-compile case. In particular, it allows
building host programs statically to not depend on presence of libraries at
run-time (e.g. MinGW DLLs on Windows) while continue to use default dynamic
linking at build time.

Also fix obsolete comments in confgure.ac - we do use different environment
for build and host now.
2014-01-18 19:50:54 +04:00
Vladimir Serbinenko bbc52c228f Enable cache on ARM U-Boot port.
Without it the port is reidiculously slow.
2013-12-23 05:01:58 +01:00
Vladimir Serbinenko 2984035e1a * grub-core/Makefile.am: Don't attempt to export grub_bios_interrupt on i386-multiboot. 2013-12-18 21:19:11 +01:00
Vladimir Serbinenko 72c9a50773 Remove xen VFB.
Due to XEN bug it prevents Linux boot. Remove it at least, until
	workaround is found.
2013-12-18 18:43:09 +01:00
Vladimir Serbinenko 71669c3b76 Implement XEN VFB support. 2013-12-17 13:07:26 +01:00
Vladimir Serbinenko 60d1dd3d72 Remove grub_bios_interrupt on coreboot.
It's not used currently and cannot be used safely currently.
2013-12-17 12:54:11 +01:00
Vladimir Serbinenko 6f1f6a0c82 Add support for converting PE+ to Elf64. 2013-12-16 15:30:50 +01:00
Vladimir Serbinenko d5c14e1e26 Fix mips-emu compilation. 2013-12-08 17:49:02 +01:00
Vladimir Serbinenko 6f07c4e407 Pass font config to config.h and not by TARGET_CFLAGS as adding
arguments doesn't work if TARGET_CFLAGS is specified on command
	line.
2013-12-04 10:25:53 +01:00
Leif Lindholm b29b77fee2 New port arm64-efi 2013-11-30 16:50:31 +01:00
Vladimir Serbinenko 9208367d3f * grub-core/Makefile.am: Reduce gratuituous differences between Apple
and non-Apple variants of efiemu compile.
2013-11-26 11:38:12 +01:00
Andrey Borzenkov c2b70d0981 Explicitly check for linking format to use for efiemu64 module
Similar to check for target linking format, also check for efiemu64
instead of hardcoding -melf_x86_64. This fixes compilation on *BSD
variants. We cannot easily reuse main target check because platforms
are different (main target is 32 bit and efiemu64 - 64 bit).

This commit adds EFIEMU64_LINK_FORMAT that contains detected
link option and is used in efiemu64.o linking instead of hardcoded
value.

Reported-By: Beeblebrox <zaphod@berentweb.com>
2013-11-25 22:32:55 +04:00
Vladimir Serbinenko d6c92cdc34 Merge branch 'master' into leiflindholm/arm64
Conflicts:
	include/grub/util/install.h
2013-11-25 13:02:27 +01:00
Vladimir Serbinenko b700a427d2 * grub-core/Makefile.am: Use correct TARGET_OBJCONV rather than
OBJCONV.
2013-11-24 05:27:20 +01:00
Leif Lindholm 15a463d742 ARM 64 port by Leif Lindholm 2013-11-16 20:52:55 +01:00
Vladimir Serbinenko cd46aa6cef Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir
the function of these files exceeds what can be sanely handled in shell
	in posix-comaptible way. Also writing it in C extends the functionality
	to non-UNIX-like OS and minimal environments.
2013-11-16 20:21:16 +01:00
Vladimir Serbinenko a9f25a0819 * configure.ac: Probe for linking format rather than guessing it based
on target_os.
2013-11-14 23:17:18 +01:00
Vladimir Serbinenko ec525c18e1 * grub-core/Makefile.am (efiemu64.o): Explicitly set link format. 2013-11-14 12:05:48 +01:00
Vladimir Serbinenko 54da019fdb * grub-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and
-DELF.
	* grub-core/efiemu/runtime/config.h: Use __i386__ and __x86_64__
	instead of ELF*.
2013-11-10 13:13:41 +01:00
Vladimir Serbinenko 9612ebc00e Add new ports: i386-xen and x86_64-xen. This allows running GRUB in
XEN PV environment and load kernels.
2013-11-09 21:29:11 +01:00
Vladimir Serbinenko d59849b2e7 * grub-core/Makefile.am: Do not include libgcc.h when compiling with
clang.
2013-11-07 19:33:54 +01:00
Vladimir 'phcoder' Serbinenko 29013cba15 Don't add -lm on haiku.
* configure.ac: Define BUILD_LIBM to -lm on most platforms
	and empty on haiku.
	* grub-core/Makefile.am (gentrigtables): Use $(BUILD_LIBM) rather than
	-lm.
2013-10-19 02:20:21 +02:00
Vladimir 'phcoder' Serbinenko d7750b324f * include/grub/emu/hostdisk.h: Move file operations to
* include/grub/emu/hostfile.h: ... here.
2013-10-15 13:56:10 +02:00
Vladimir 'phcoder' Serbinenko 7e45abcef4 Move cpu time retrieval to separate grub_util_get_cpu_time_ms
and remove export.h.
2013-10-15 13:13:53 +02:00
Vladimir 'phcoder' Serbinenko 70671037c8 Split emunet into platform-dependent and GRUB-binding parts. Keep
platform-dependent part in kernel for easy access to OS functions.
2013-10-15 11:55:20 +02:00
Vladimir 'phcoder' Serbinenko 25ac643a54 * grub-core/tests/video_checksum.c: Use grub_util_fd_* rather than
open/read/write.
2013-10-15 11:06:57 +02:00
Vladimir 'phcoder' Serbinenko 0e8daad0bd * grub-core/Makefile.am: Override STRIP and RANLIB.
* configure.ac: compute TARGET_RANLIB.
	* INSTALL: Document TARGET_RANLIB

	Based on patches from AROS.
2013-09-23 12:55:18 +02:00
Vladimir 'phcoder' Serbinenko 7b780018f5 Handle grub-pe2elf and grub-mkfont for cases when build != host.
* Makefile.am (build-grub-mkfont): Don't include gnulib.
	(build-grub-gen-asciih): Likewise.
	(build-grub-gen-widthspec): Likewise.
	* Makefile.util.def (grub-pe2elf): Remove.
	* config.h.in [GRUB_BUILD]: Use build rather than host constants.
	* configure.ac: Separate tests for build.
	Move ./build-grub-pe2elf to grub-core.
	Fix typo.
	* grub-core/Makefile.am (build-grub-pe2elf): New target.
	* grub-core/kern/emu/misc.c (xasprintf): Don't compile if GRUB_BUILD is
	defined.
	* include/grub/types.h [GRUB_BUILD]: Use build rather than host
	constants.
	* util/grub-mkfont.c [GRUB_BUILD]: Simplify not to rely on argp.
	* util/grub-pe2elf.c: Simplify not to rely on getopt.
	* util/misc.c (program_name) [GRUB_BUILD]: Define to static string.
2013-08-22 17:00:59 +02:00
Vladimir 'phcoder' Serbinenko fc97214f7e * INSTALL: Document cross-compilation.
* acinclude.m4: Determine whether nm support -P and --defined-only.
	* configure.ac: Add TARGET_ to all variables pertaining to target
	that don't have it yet.
	* gentpl.py: Likewise.
	* grub-core/Makefile.am: Likewise.
	* grub-core/genmod.sh.in: Likewise.
	* grub-core/gensyminfo.sh.in: Handle OpenBSD and other non-GNU nm
	as well.
2013-08-22 01:56:28 +02:00
Vladimir 'phcoder' Serbinenko 7c9d0c39af Fix handling of build-time grub-bin2h and grub-mkfont when doing
full Canadian cross. Tested with build=x86_64, host=arm,
	target=ppc-ieee1275.
2013-08-14 10:56:55 +02:00
Vladimir 'phcoder' Serbinenko ae27e4d323 Merge mainline into arm 2013-07-16 18:43:43 +02:00