]> xenbits.xensource.com Git - seabios.git/commitdiff
Build different final files for QEMU, coreboot, and CSM.
authorKevin O'Connor <kevin@koconnor.net>
Tue, 15 Oct 2013 01:52:28 +0000 (21:52 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 17 Oct 2013 00:17:00 +0000 (20:17 -0400)
Build out/bios.bin on QEMU, out/bios.bin.elf on coreboot, and
out/Csm16.bin for CSM.  This reduces the chance that one accidentally
builds for an incorrect target.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Makefile
README
README.CSM

index 01bd8b3ca0164ed4d78d8f5677add3876e6f040e..18127966bfbae45570ed139f7a6de9aed7daf746 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,10 @@ endif
 # Default targets
 -include $(KCONFIG_CONFIG)
 
-target-y = $(OUT)bios.bin
+target-y :=
+target-$(CONFIG_QEMU) += $(OUT)bios.bin
+target-$(CONFIG_CSM) += $(OUT)Csm16.bin
+target-$(CONFIG_COREBOOT) += $(OUT)bios.bin.elf
 target-$(CONFIG_BUILD_VGABIOS) += $(OUT)vgabios.bin
 
 all: $(target-y)
@@ -174,12 +177,24 @@ $(OUT)rom.o: $(OUT)rom16.strip.o $(OUT)rom32seg.strip.o $(OUT)code32flat.o $(OUT
        @echo "  Linking $@"
        $(Q)$(LD) -T $(OUT)romlayout32flat.lds $(OUT)rom16.strip.o $(OUT)rom32seg.strip.o $(OUT)code32flat.o -o $@
 
-$(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o scripts/checkrom.py
+$(OUT)bios.bin.prep: $(OUT)rom.o scripts/checkrom.py
        @echo "  Prepping $@"
+       $(Q)rm -f $(OUT)bios.bin $(OUT)Csm16.bin $(OUT)bios.bin.elf
        $(Q)$(OBJDUMP) -thr $< > $<.objdump
        $(Q)$(OBJCOPY) -O binary $< $(OUT)bios.bin.raw
        $(Q)$(PYTHON) ./scripts/checkrom.py $<.objdump $(CONFIG_ROM_SIZE) \
-               $(OUT)bios.bin.raw $(OUT)bios.bin
+               $(OUT)bios.bin.raw $(OUT)bios.bin.prep
+
+$(OUT)bios.bin: $(OUT)bios.bin.prep
+       @echo "  Creating $@"
+       $(Q)cp $< $@
+
+$(OUT)Csm16.bin: $(OUT)bios.bin.prep
+       @echo "  Creating $@"
+       $(Q)cp $< $@
+
+$(OUT)bios.bin.elf: $(OUT)rom.o $(OUT)bios.bin.prep
+       @echo "  Creating $@"
        $(Q)$(STRIP) -R .comment $< -o $(OUT)bios.bin.elf
 
 
diff --git a/README b/README
index f7524517ee88e8077c955a3d9e1c05dc1f4a225c..6844e52e1917a5a4a02994ecd4bf84705999049c 100644 (file)
--- a/README
+++ b/README
@@ -1,8 +1,10 @@
 This code implements an X86 legacy bios.  It is intended to be
 compiled using standard gnu tools (eg, gas and gcc).
 
-To build, one should be able to run "make" in the main directory.  The
-resulting file "out/bios.bin" contains the processed bios image.
+To build for QEMU, one should be able to run "make" in the main
+directory.  The resulting file "out/bios.bin" contains the processed
+bios image.  To build for coreboot, please see the coreboot wiki.  To
+build for CSM, please see README.CSM.
 
 
 Testing of images:
index ea7184652424eabf8e76bedf7ec184acdf83fc6e..b904e65478ba0cb9e1beadc89e3629a3947bbfa7 100644 (file)
@@ -9,11 +9,12 @@ Windows 2008r2 is known to use INT 10h BIOS calls even when booted via
 EFI, and the presence of a CSM makes this work as expected too.
 
 Having built SeaBIOS with CONFIG_CSM, you should be able to drop the
-result into your OVMF build tree at OvmfPkg/Csm/Csm16/Csm16.bin and
-then build OVMF with 'build -D CSM_ENABLE'. The SeaBIOS binary will be
-included as a discrete file within the 'Flash Volume' which is
-created, and there are tools which will extract it and allow it to be
-replaced; satisfying the requirements of the LGPL licence.
+result (out/Csm16.bin) into your OVMF build tree at
+OvmfPkg/Csm/Csm16/Csm16.bin and then build OVMF with 'build -D
+CSM_ENABLE'. The SeaBIOS binary will be included as a discrete file
+within the 'Flash Volume' which is created, and there are tools which
+will extract it and allow it to be replaced; satisfying the
+requirements of the LGPL licence.
 
 A patch to OVMF is required, to prevent it from marking the region from
 0xC0000-0xFFFFF as read-only before invoking our Legacy16Boot method. See