# $Id: Makefile.kmk 41657 2012-06-11 22:20:59Z vboxsync $ ## @file # Sub-Makefile for the New BIOS ROM. # # # Copyright (C) 2012 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # SUB_DEPTH = ../../../../.. include $(KBUILD_PATH)/subheader.kmk ifdef VBOX_WITH_OPEN_WATCOM # # VBoxBios - Template for building the BIOS bits. # TEMPLATE_VBoxBios = PXE ROM TEMPLATE_VBoxBios_TOOL = OPENWATCOM-16 TEMPLATE_VBoxBios_LDTOOL = OPENWATCOM-WL TEMPLATE_VBoxBios_ASTOOL = OPENWATCOM-16 TEMPLATE_VBoxBios_BLD_TRG = os-agnostic TEMPLATE_VBoxBios_BLD_TRG_ARCH = x86 TEMPLATE_VBoxBios_BINSUFF = .rom TEMPLATE_VBoxBios_INCS = . TEMPLATE_VBoxBios_ASFLAGS = -q -wx TEMPLATE_VBoxBios_CFLAGS = -q -3 -wx -zl -zu -s -oas -d1+ -ms TEMPLATE_VBoxBios_DEFS = \ VBOX_PC_BIOS \ VBOX_LANBOOT_SEG=0xE200 \ VBOX_VERSION_STRING=\"$(VBOX_VERSION_STRING)\" \ VBOX_WITH_SCSI \ VBOX_WITH_AHCI TEMPLATE_VBoxBios_LDFLAGS = system dos \ debug all \ option quiet, nofarcalls, map, verbose, statics, symfile \ output raw offset=0xF0000 order \ clname DATA segaddr=0xF000 segment _DATA \ clname CODE \ segment _TEXT segaddr=0xF000 offset=0x1600 \ segment BIOS32 segaddr=0xF000 offset=0xDE00 \ segment BIOSSEG segaddr=0xF000 offset=0xE000 \ disable 1014, 1023, 2120 TEMPLATE_VBoxBios_LNK_DEPS = $(VBOX_BIOSSUMS) TEMPLATE_VBoxBios_POST_CMDS = \ $(QUIET)$(MV_EXT) -f $(out) $(out).tmp \ && $(VBOX_BIOSSUMS) $(out).tmp $(out) \ && $(RM_EXT) -f $(out).tmp # # VBoxPcBios - The PC BIOS. # MISCBINS += VBoxPcBios VBoxPcBios_TEMPLATE = VBoxBios VBoxPcBios_SOURCES = \ bios.c \ print.c \ ata.c \ floppy.c \ eltorito.c \ boot.c \ keyboard.c \ disk.c \ serial.c \ system.c \ timepci.c \ ps2mouse.c \ parallel.c \ logo.c \ scsi.c \ ahci.c \ pciutil.c \ vds.c \ support.asm \ pcibio32.asm \ orgs.asm # # Updates the alternative source file. # update-bios-source | $(PATH_SUB_CURRENT)/VBoxBiosAlternative.asm $(PATH_SUB_CURRENT)/VBoxBiosAlternative.md5sum: \ $$(VBoxPcBios_1_TARGET) \ $$(MakeDebianBiosAssembly_1_TARGET) if1of ($(KBUILD_TYPE), release) $(MakeDebianBiosAssembly_1_TARGET) \ --bios-image $< \ --bios-map $(basename $<).map \ --bios-sym $(basename $<).sym \ --output $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(QUIET)yasm -f bin -o $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(CMP) -l -- $< $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(CP) --changed -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(PATH_ROOT)/src/VBox/Devices/PC/BIOS-new/VBoxBiosAlternative.asm $(REDIRECT) -C $(dir $(VBoxPcBios_1_TARGET)) -- \ $(MD5SUM_EXT) -bo $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum $(notdir $(VBoxPcBios_1_TARGET)) $(CP) --changed -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum $(PATH_ROOT)/src/VBox/Devices/PC/BIOS-new/VBoxBiosAlternative.md5sum $(RM) -f -- $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.asm $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.bin $(VBoxPcBios_0_OUTDIR)/VBoxBiosAlternative.md5sum else $(QUIET)$(ECHO) "Fatal error: Can only update VBoxBiosAlternative.asm/md5sum with a release build." $(QUIET)exit 1 endif endif # VBOX_WITH_OPEN_WATCOM # # The library containing the PC BIOS image. # LIBRARIES += PcBiosBin PcBiosBin_TEMPLATE = VBOXR3 PcBiosBin_DEFS = IN_VBOXDD2 PcBiosBin_SOURCES = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c PcBiosBin_CLEAN = $(PcBiosBin_0_OUTDIR)/PcBiosBin.c ifdef VBOX_WITH_OPEN_WATCOM $$(PcBiosBin_0_OUTDIR)/PcBiosBin.c: $$(VBoxPcBios_1_TARGET) $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@) $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $< $@ else PcBiosBin_CLEAN += $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $$(PcBiosBin_0_OUTDIR)/PcBiosBin.c + $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom: \ $(PATH_SUB_CURRENT)/VBoxBiosAlternative.asm \ $(PATH_SUB_CURRENT)/VBoxBiosAlternative.md5sum \ $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,PcBiosBin,$<,$@) $(QUIET)yasm -f bin -o $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $< $(QUIET)$(REDIRECT) -C $(PcBiosBin_0_OUTDIR) -- \ $(MD5SUM_EXT) -c $(basename $<).md5sum $(QUIET)$(VBOX_BIN2C) -min 64 -max 256 -mask 0xffff -ascii -export PcBiosBinary $(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom $@ $(QUIET)$(RM) -f -- $$(PcBiosBin_0_OUTDIR)/VBoxPcBios.rom endif # # MakeDebianBiosAssembly - For distros without OpenWatcom. # ifdef TODO_LATER BLDPROGS += MakeDebianBiosAssembly MakeDebianBiosAssembly_TEMPLATE = VBoxAdvBldProg MakeDebianBiosAssembly_DEFS = IN_DIS MakeDebianBiosAssembly_SOURCES = MakeDebianBiosAssembly.cpp MakeDebianBiosAssembly_LIBS = \ $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) ifdef IPRT_WITH_KSTUFF MakeDebianBiosAssembly_LIBS += \ $(PATH_STAGE_LIB)/VBox-kStuff$(VBOX_SUFF_LIB) endif else PROGRAMS += MakeDebianBiosAssembly ## TODO this is build program, really. later. MakeDebianBiosAssembly_TEMPLATE = VBOXR3EXE MakeDebianBiosAssembly_DEFS = IN_DIS MakeDebianBiosAssembly_SOURCES = MakeDebianBiosAssembly.cpp MakeDebianBiosAssembly_LIBS = \ $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ $(LIB_RUNTIME) endif include $(FILE_KBUILD_SUB_FOOTER)