summaryrefslogtreecommitdiffstats
path: root/payloads
diff options
context:
space:
mode:
authorNicholas Chin <nic.c3.14@gmail.com>2021-08-28 09:40:41 -0600
committerMartin L Roth <gaumless@tutanota.com>2022-05-28 15:01:47 +0000
commit8d885577ce51a035828857079469d719249f5840 (patch)
treebbd0639ed3038bd57d8b9ec340a52bcf3aa99087 /payloads
parentc217f31d0bd59a9d63787a40b1995b08c8dc683b (diff)
downloadcoreboot-8d885577ce51a035828857079469d719249f5840.tar.gz
coreboot-8d885577ce51a035828857079469d719249f5840.tar.bz2
coreboot-8d885577ce51a035828857079469d719249f5840.zip
payloads/external: Add support for coreDOOM payload
coreDOOM is a port of DOOM to libpayload, based on the doomgeneric source port. It renders the game to the coreboot linear framebuffer, and loads WAD files from CBFS. Tested with QEMU i440fx/q35 and a Dell Latitude E6400 using the libgfxinit provided linear framebuffer. Project page: https://github.com/nic3-14159/coreDOOM Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> Change-Id: Ice0403b003a4b2717afee585f28303c2f5abea5d Reviewed-on: https://review.coreboot.org/c/coreboot/+/57222 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/Kconfig10
-rw-r--r--payloads/Makefile.inc1
-rw-r--r--payloads/external/Makefile.inc16
-rw-r--r--payloads/external/SeaBIOS/Kconfig1
-rw-r--r--payloads/external/coreDOOM/Kconfig.secondary25
-rw-r--r--payloads/external/coreDOOM/Makefile34
-rw-r--r--payloads/external/coreDOOM/libpayload-config13
7 files changed, 100 insertions, 0 deletions
diff --git a/payloads/Kconfig b/payloads/Kconfig
index e184b35668be..2e627d7e5b36 100644
--- a/payloads/Kconfig
+++ b/payloads/Kconfig
@@ -165,6 +165,16 @@ config TINT_SECONDARY_PAYLOAD
tint can be loaded as a secondary payload under SeaBIOS, GRUB,
or any other payload that can load additional payloads.
+config COREDOOM_SECONDARY_PAYLOAD
+ bool "Load coreDOOM as a secondary payload"
+ default n
+ depends on ARCH_X86
+ help
+ coreDOOM can be loaded as a secondary payload under SeaBIOS, GRUB,
+ or any other payload that can load additional payloads. Requires a
+ linear framebuffer. If built as a secondary payload for SeaBIOS, the
+ generated VGA BIOS option rom is also required.
+
source "payloads/external/*/Kconfig.secondary"
endmenu # "Secondary Payloads"
diff --git a/payloads/Makefile.inc b/payloads/Makefile.inc
index a182bd65ad26..0102ea37d171 100644
--- a/payloads/Makefile.inc
+++ b/payloads/Makefile.inc
@@ -29,6 +29,7 @@ payloads/external/GRUB2 \
payloads/external/LinuxBoot \
payloads/external/Yabits \
payloads/external/skiboot \
+payloads/external/coreDOOM \
force-payload:
diff --git a/payloads/external/Makefile.inc b/payloads/external/Makefile.inc
index e2fb9c727923..99fb0ef483a2 100644
--- a/payloads/external/Makefile.inc
+++ b/payloads/external/Makefile.inc
@@ -372,3 +372,19 @@ payloads/external/skiboot/build/skiboot.elf:
$(MAKE) -C payloads/external/skiboot all \
CONFIG_SKIBOOT_GIT_REPO=$(CONFIG_SKIBOOT_GIT_REPO) \
CONFIG_SKIBOOT_REVISION=$(CONFIG_SKIBOOT_REVISION)
+# COREDOOM
+
+payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf coredoom:
+ $(MAKE) -C payloads/external/coreDOOM
+
+cbfs-files-$(CONFIG_COREDOOM_SECONDARY_PAYLOAD) += img/coreDOOM
+img/coreDOOM-file := payloads/external/coreDOOM/coredoom/doomgeneric/coredoom.elf
+img/coreDOOM-type := payload
+img/coreDOOM-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
+# WAD file
+ifneq ($(strip $(CONFIG_COREDOOM_WAD_FILE)),)
+cbfs-files-y += doom.wad
+doom.wad-file := $(strip $(CONFIG_COREDOOM_WAD_FILE))
+doom.wad-type := raw
+doom.wad-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
+endif
diff --git a/payloads/external/SeaBIOS/Kconfig b/payloads/external/SeaBIOS/Kconfig
index 405ff9db5541..78e37935e95a 100644
--- a/payloads/external/SeaBIOS/Kconfig
+++ b/payloads/external/SeaBIOS/Kconfig
@@ -74,6 +74,7 @@ config SEABIOS_HARDWARE_IRQ
config SEABIOS_VGA_COREBOOT
prompt "Include generated option rom that implements legacy VGA BIOS compatibility"
default y if !VENDOR_EMULATION
+ default y if COREDOOM_SECONDARY_PAYLOAD
depends on !VGA_ROM_RUN && (VGA_TEXT_FRAMEBUFFER || LINEAR_FRAMEBUFFER)
bool
help
diff --git a/payloads/external/coreDOOM/Kconfig.secondary b/payloads/external/coreDOOM/Kconfig.secondary
new file mode 100644
index 000000000000..9f13cfe98c4f
--- /dev/null
+++ b/payloads/external/coreDOOM/Kconfig.secondary
@@ -0,0 +1,25 @@
+if COREDOOM_SECONDARY_PAYLOAD
+
+config COREDOOM_WAD_FILE
+ string "DOOM WAD file"
+ depends on COREDOOM_SECONDARY_PAYLOAD
+ default "doom.wad"
+ help
+ Add a WAD file to be loaded by coreDOOM.
+
+ A WAD file contains all the game data for the Doom-engine, and
+ is required to play the game.
+
+ A list of the WAD files included in the official games can be
+ found here: https://doomwiki.org/wiki/IWAD
+ These WADs can be extracted from copies of the game that you
+ own, and the shareware WADs may be freely downloaded from the
+ internet.
+
+ For a completely free (as in freedom) experience, the Freedoom
+ project (https://freedoom.github.io) provides original game
+ content under the BSD license. Other WADs not mentioned here are
+ also available and may be found from various sources such as
+ the internet and copies of other games using the Doom engine.
+
+endif
diff --git a/payloads/external/coreDOOM/Makefile b/payloads/external/coreDOOM/Makefile
new file mode 100644
index 000000000000..7c801b413e27
--- /dev/null
+++ b/payloads/external/coreDOOM/Makefile
@@ -0,0 +1,34 @@
+## SPDX-License-Identifier: GPL-2.0-only
+project_git_repo=https://github.com/nic3-14159/coreDOOM.git
+project_dir=coredoom
+
+unexport KCONFIG_AUTOHEADER
+unexport KCONFIG_AUTOCONFIG
+unexport KCONFIG_DEPENDENCIES
+unexport KCONFIG_SPLITCONFIG
+unexport KCONFIG_TRISTATE
+unexport KCONFIG_NEGATIVES
+
+all: coredoom
+
+checkout:
+ test -d coredoom || \
+ git clone $(project_git_repo) $(project_dir)
+ cd $(project_dir) && \
+ git checkout libpayload_port
+
+coredoom: libpayload
+ $(MAKE) -C $(project_dir)/doomgeneric
+
+libpayload: checkout
+ cp libpayload-config ../../libpayload/.config && \
+ cd ../../libpayload && $(MAKE) olddefconfig && $(MAKE) && \
+ $(MAKE) DESTDIR=../external/coreDOOM/coredoom/doomgeneric install
+
+clean:
+ test -d coredoom && $(MAKE) -C coredoom/doomgeneric clean || exit 0
+
+distclean:
+ rm -rf coredoom
+
+.PHONY: checkout coredoom clean distclean
diff --git a/payloads/external/coreDOOM/libpayload-config b/payloads/external/coreDOOM/libpayload-config
new file mode 100644
index 000000000000..54dffea515f0
--- /dev/null
+++ b/payloads/external/coreDOOM/libpayload-config
@@ -0,0 +1,13 @@
+# CONFIG_LP_MULTIBOOT is not set
+CONFIG_LP_HEAP_SIZE=67108864
+CONFIG_LP_STACK_SIZE=16384
+CONFIG_LP_BASE_ADDRESS=0x00100000
+# CONFIG_LP_CURSES is not set
+CONFIG_LP_SERIAL_IOBASE=0x3f8
+CONFIG_LP_COREBOOT_VIDEO_CONSOLE=y
+# CONFIG_LP_PCI is not set
+# CONFIG_LP_NVRAM is not set
+CONFIG_LP_TIMER_GENERIC_REG=0x0
+CONFIG_LP_TIMER_GENERIC_HIGH_REG=0x0
+# CONFIG_LP_STORAGE is not set
+# CONFIG_LP_USB_MSC is not set