diff options
author | Ronald G. Minnich <rminnich@gmail.com> | 2018-08-13 15:24:30 -0700 |
---|---|---|
committer | Philipp Deppenwiese <zaolin.daisuki@gmail.com> | 2018-09-01 17:16:04 +0000 |
commit | 4cea3a19f886cf8154af235fb233dc35cd60d0ea (patch) | |
tree | 81ce8a7524ecf596306847f4fbbb560b7c9d156f /payloads/linuxcheck/Makefile | |
parent | aef592d9b66aa18d83b0a211ead26013ff1f7d98 (diff) | |
download | coreboot-4cea3a19f886cf8154af235fb233dc35cd60d0ea.tar.gz coreboot-4cea3a19f886cf8154af235fb233dc35cd60d0ea.tar.bz2 coreboot-4cea3a19f886cf8154af235fb233dc35cd60d0ea.zip |
Add support for ram payloadsrampayload
This is enabled by CONFIG_RAMPAYLOAD.
The code will look for a ram payload and, if it is found, try
to run it. If the load fails or the payload returns it will
continue with ramstage.
We also include a new payload, linuxcheck, which is intended
to verify that linux can be loaded and run, e.g. as a LinuxBoot
payload. Currently, it fails.
This does not yet work but it makes sense as a foundation on which
to build. For one thing, we need to build at least a few tables
for Linux. The goal for LinuxBoot is to build as few as possible.
To test with linuxcheck (linux is not even close to working):
cd payloads/linuxcheck/
cp x86config .config
make
cd ../..
make
./build/cbfstool build/coreboot.rom add-payload -n fallback/rampayload -f payloads/linuxcheck/linuxcheck.elf
qemu-system-x86_64 -nographic -m 8192 -bios build/coreboot.rom -monitor /dev/pts/$1 -s
We need to change the payload menu so we can add a rampayload but it's a bit
tricky as written, so that must come later.
Note that I'm still creating a special purpose romselfboot. The idea of
merging romselfboot and selfboot is probably a good idea -- in the future.
I think until we know how this should look, such a merge is premature.
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Change-Id: I8199aae6776f6dee969b370b0e6a41ef96e854d8
clang-formatted-by: Ronald G. Minnich
Reviewed-on: https://review.coreboot.org/28402
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Tested-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'payloads/linuxcheck/Makefile')
-rw-r--r-- | payloads/linuxcheck/Makefile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/payloads/linuxcheck/Makefile b/payloads/linuxcheck/Makefile new file mode 100644 index 000000000000..0e3feae90d02 --- /dev/null +++ b/payloads/linuxcheck/Makefile @@ -0,0 +1,34 @@ +LIBPAYLOAD_DIR=$(CURDIR)/libpayload +XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile +# build libpayload and put .config file in $(CURDIR) instead of ../libpayload +# to avoid pollute the libpayload source directory and possible conflicts +LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config" +CFLAGS += -Wall -Werror -Os -ffreestanding -nostdinc -nostdlib + +all: linuxcheck.elf + +$(LIBPAYLOAD_DIR): + $(MAKE) -C ../libpayload $(LPOPTS) defconfig + $(MAKE) -C ../libpayload $(LPOPTS) + $(MAKE) -C ../libpayload $(LPOPTS) install + +ifneq ($(strip $(wildcard libpayload)),) +include $(XCOMPILE) +LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc" +%.elf: %.c Makefile + $(LPGCC) $(CFLAGS) -o $*.elf $*.c +else +# If libpayload is not found, first build libpayload, +# then do the make, this time it'll find libpayload +# and generate the linuxcheck.elf target +%.elf: $(LIBPAYLOAD_DIR) + $(MAKE) all +endif + +clean: + rm -f linuxcheck.elf + +distclean: clean + rm -rf build libpayload .config .config.old + +.PHONY: all clean distclean |