diff --git a/.gitmodules b/.gitmodules index 2a5ebda..e4c2b5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "nanoprintf"] path = nanoprintf url = https://github.com/charlesnicholson/nanoprintf.git +[submodule "seabios"] + path = seabios + url = https://github.com/FlyGoat/seabios-csmwrap.git diff --git a/GNUmakefile b/GNUmakefile index c3320aa..aa0057b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -48,9 +48,10 @@ BUILD_VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || ech # Check if CC is Clang. override CC_IS_CLANG := $(shell ! $(CC) --version 2>/dev/null | grep 'clang' >/dev/null 2>&1; echo $$?) -# Save user CFLAGS and CPPFLAGS before we append internal flags. +# Save user CFLAGS, CPPFLAGS, and LDFLAGS before we append internal flags. override USER_CFLAGS := $(CFLAGS) override USER_CPPFLAGS := $(CPPFLAGS) +override USER_LDFLAGS := $(LDFLAGS) # Internal C flags that should not be changed by the user. override CFLAGS += \ @@ -259,3 +260,22 @@ clean: .PHONY: distclean distclean: rm -rf bin-* obj-* ovmf + +# SeaBIOS build target. +.PHONY: seabios +seabios: + cp seabios-config seabios/.config + $(MAKE) -C seabios olddefconfig \ + CC="$(CC)" \ + OBJCOPY="$(OBJCOPY)" \ + CFLAGS="$(USER_CFLAGS)" \ + CPPFLAGS="$(USER_CPPFLAGS)" \ + LDFLAGS="$(USER_LDFLAGS)" + $(MAKE) -C seabios \ + CC="$(CC)" \ + OBJCOPY="$(OBJCOPY)" \ + CFLAGS="$(USER_CFLAGS)" \ + CPPFLAGS="$(USER_CPPFLAGS)" \ + LDFLAGS="$(USER_LDFLAGS)" + cd seabios/out && xxd -i Csm16.bin >../../src/bins/Csm16.h + cd seabios/out && xxd -i vgabios.bin >../../src/bins/vgabios.h diff --git a/seabios b/seabios new file mode 160000 index 0000000..e8cdc4f --- /dev/null +++ b/seabios @@ -0,0 +1 @@ +Subproject commit e8cdc4ff818375157ec13dc2f0644f9ffe841c0f diff --git a/seabios-config b/seabios-config new file mode 100644 index 0000000..e55d81b --- /dev/null +++ b/seabios-config @@ -0,0 +1,5 @@ +CONFIG_CSM=y +# CONFIG_FLASH_FLOPPY is not set +# CONFIG_VGAHOOKS is not set +# CONFIG_TCGBIOS is not set +CONFIG_VGA_COREBOOT=y diff --git a/seabios/patches/0001-csm-Setup-PIC-in-PrepareToBoot.patch b/seabios/patches/0001-csm-Setup-PIC-in-PrepareToBoot.patch deleted file mode 100644 index 2645302..0000000 --- a/seabios/patches/0001-csm-Setup-PIC-in-PrepareToBoot.patch +++ /dev/null @@ -1,27 +0,0 @@ -From c7849b92ea651c976ab0141e2b04e94ba73900d6 Mon Sep 17 00:00:00 2001 -From: Jiaxun Yang -Date: Fri, 9 May 2025 17:48:07 +0100 -Subject: [PATCH 1/2] csm: Setup PIC in PrepareToBoot - -This is required to get timer working. - -Signed-off-by: Jiaxun Yang ---- - src/fw/csm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/fw/csm.c b/src/fw/csm.c -index 579debdcf4cc..ccd7645e1ce9 100644 ---- a/src/fw/csm.c -+++ b/src/fw/csm.c -@@ -184,6 +184,7 @@ handle_csm_0002(struct bregs *regs) - struct bios_data_area_s *bda = MAKE_FLATPTR(SEG_BDA, 0); - bda->hdcount = 0; - -+ pic_setup(); - thread_setup(); - mathcp_setup(); - timer_setup(); --- -2.39.5 (Apple Git-154) -