Skip to content

Commit e16c999

Browse files
mintsukiFlyGoat
authored andcommitted
Add a 'make seabios' target to build SeaBIOS
1 parent 0bd1417 commit e16c999

File tree

5 files changed

+30
-28
lines changed

5 files changed

+30
-28
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010
[submodule "nanoprintf"]
1111
path = nanoprintf
1212
url = https://github.com/charlesnicholson/nanoprintf.git
13+
[submodule "seabios"]
14+
path = seabios
15+
url = https://github.com/FlyGoat/seabios-csmwrap.git

GNUmakefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ BUILD_VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || ech
4848
# Check if CC is Clang.
4949
override CC_IS_CLANG := $(shell ! $(CC) --version 2>/dev/null | grep 'clang' >/dev/null 2>&1; echo $$?)
5050

51-
# Save user CFLAGS and CPPFLAGS before we append internal flags.
51+
# Save user CFLAGS, CPPFLAGS, and LDFLAGS before we append internal flags.
5252
override USER_CFLAGS := $(CFLAGS)
5353
override USER_CPPFLAGS := $(CPPFLAGS)
54+
override USER_LDFLAGS := $(LDFLAGS)
5455

5556
# Internal C flags that should not be changed by the user.
5657
override CFLAGS += \
@@ -259,3 +260,22 @@ clean:
259260
.PHONY: distclean
260261
distclean:
261262
rm -rf bin-* obj-* ovmf
263+
264+
# SeaBIOS build target.
265+
.PHONY: seabios
266+
seabios:
267+
cp seabios-config seabios/.config
268+
$(MAKE) -C seabios olddefconfig \
269+
CC="$(CC)" \
270+
OBJCOPY="$(OBJCOPY)" \
271+
CFLAGS="$(USER_CFLAGS)" \
272+
CPPFLAGS="$(USER_CPPFLAGS)" \
273+
LDFLAGS="$(USER_LDFLAGS)"
274+
$(MAKE) -C seabios \
275+
CC="$(CC)" \
276+
OBJCOPY="$(OBJCOPY)" \
277+
CFLAGS="$(USER_CFLAGS)" \
278+
CPPFLAGS="$(USER_CPPFLAGS)" \
279+
LDFLAGS="$(USER_LDFLAGS)"
280+
cd seabios/out && xxd -i Csm16.bin >../../src/bins/Csm16.h
281+
cd seabios/out && xxd -i vgabios.bin >../../src/bins/vgabios.h

seabios

Submodule seabios added at e8cdc4f

seabios-config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_CSM=y
2+
# CONFIG_FLASH_FLOPPY is not set
3+
# CONFIG_VGAHOOKS is not set
4+
# CONFIG_TCGBIOS is not set
5+
CONFIG_VGA_COREBOOT=y

seabios/patches/0001-csm-Setup-PIC-in-PrepareToBoot.patch

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)