# $Id: Makefile.kmk 62514 2016-07-22 19:13:35Z vboxsync $ ## @file # Sub-Makefile for the New VGA BIOS ROM. # # # Copyright (C) 2012-2016 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 # # VBoxVgaBios - The VGA BIOS. # MISCBINS += VBoxVgaBios386 VBoxVgaBios386_TEMPLATE = VBoxBios VBoxVgaBios386_ASFLAGS = -0 VBoxVgaBios386_CFLAGS = -3 VBoxVgaBios386_DEFS = VBE VBOX_BIOS_CPU=80386 VBoxVgaBios386_SOURCES = \ vgarom.asm \ vberom.asm \ vgabios.c \ vbe.c VBoxVgaBios386_LDFLAGS = \ output raw offset=0xC0000 \ order \ clname CODE \ segment VGAROM segaddr=0xC000 \ segment _TEXT segaddr=0xC000 offset=0xA00 \ segment VBE32 segaddr=0xC000 offset=0x4400 \ clname DATA \ segment _DATA segaddr=0xC000 offset=0x4600 \ MISCBINS += VBoxVgaBios286 VBoxVgaBios286_EXTENDS = VBoxVgaBios386 VBoxVgaBios286_CFLAGS = -2 VBoxVgaBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxVgaBios386_DEFS)) VBOX_BIOS_CPU=80286 MISCBINS += VBoxVgaBios8086 VBoxVgaBios8086_EXTENDS = VBoxVgaBios386 VBoxVgaBios8086_CFLAGS = -0 VBoxVgaBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxVgaBios386_DEFS)) VBOX_BIOS_CPU=8086 # # Updates the alternative source file. # define def_VBoxVgaBiosUpdateAltSource $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).md5sum: \ $$$$(VBoxVgaBios$(1)_1_TARGET) \ $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \ $$(VBOX_VBOXCMP) if1of ($$(KBUILD_TYPE), release) $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \ --bios-image $$< \ --bios-map $$(basename $$<).map \ --bios-sym $$(basename $$<).sym \ --bios-type vga \ --output $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm $$(QUIET)yasm -f bin \ -o $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin \ -l $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).lst \ $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm $$(VBOX_VBOXCMP) $$< $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin $$(CP) --changed -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative$(1).asm $$(REDIRECT) -C $$(dir $$(VBoxVgaBios$(1)_1_TARGET)) -- \ $$(MD5SUM_EXT) -bo $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum $$(notdir $$(VBoxVgaBios$(1)_1_TARGET)) $$(CP) --changed -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative$(1).md5sum $$(RM) -f -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm \ $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin \ $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).lst \ $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum else $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxVgaBiosAlternative$(1).asm/md5sum with a release build." $$(QUIET)exit 1 endif endef $(evalcall2 def_VBoxVgaBiosUpdateAltSource,386) $(evalcall2 def_VBoxVgaBiosUpdateAltSource,286) $(evalcall2 def_VBoxVgaBiosUpdateAltSource,8086) update-vgabios-source: \ $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative386.asm \ $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative286.asm \ $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative8086.asm endif # VBOX_WITH_OPEN_WATCOM # # The library containing the VGA BIOS image. # LIBRARIES += VgaBiosBin VgaBiosBin_TEMPLATE = VBOXR3 VgaBiosBin_DEFS = IN_VBOXDD2 VgaBiosBin_SOURCES = VgaBiosBin_DEPS = $(VgaBiosBin_0_OUTDIR)/vbetables.h VgaBiosBin_CLEAN = $(VgaBiosBin_0_OUTDIR)/vbetables.h define def_VBoxVgaBiosBin VgaBiosBin_SOURCES += $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c VgaBiosBin_CLEAN += $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c ifdef VBOX_WITH_OPEN_WATCOM $$$$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c: $$$$(VBoxVgaBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@) $$(call MSG_TOOL,bin2c,VgaBiosBin,$$<,$$@) $$(QUIET)$$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary$(1) $$< $$@ else VgaBiosBin_CLEAN += $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$$$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c + $$$$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom: \ $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).asm \ $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).md5sum \ $$(VBOX_BIN2C) | $$$$(dir $$$$@) $$(call MSG_TOOL,bin2c,VgaBiosBin,$$<,$$@) $$(QUIET)yasm -f bin -o $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$< $$(QUIET)$$(REDIRECT) -C $$(VgaBiosBin_0_OUTDIR) -- \ $$(MD5SUM_EXT) -c $$(basename $$<).md5sum $$(QUIET)$$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary$(1) $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$@ $$(QUIET)$$(RM) -f -- $$$$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom endif endef $(evalcall2 def_VBoxVgaBiosBin,386) $(evalcall2 def_VBoxVgaBiosBin,286) $(evalcall2 def_VBoxVgaBiosBin,8086) # Rule for making the vbetables.h that DevVGA uses. $$(VgaBiosBin_0_OUTDIR)/vbetables.h: $(MAKEFILE_CURRENT) $$(vbetables-gen_1_TARGET) | $$(dir $$@) $(QUIET)$(REDIRECT) -wo $@ -- $(vbetables-gen_1_TARGET) # # The VBE tables. # BLDPROGS += vbetables-gen vbetables-gen_TEMPLATE = VBoxBldProg vbetables-gen_SOURCES = vbetables-gen.c vbetables-gen_CLEAN = $(vbetables-gen) # # The VGA BIOS Logo. # LIBRARIES += VgaDefBiosLogo VgaDefBiosLogo_TEMPLATE = VBOXR3 VgaDefBiosLogo_INCS = $(VBOX_PATH_DEVICES_SRC) VgaDefBiosLogo_SOURCES = $(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogo.c VgaDefBiosLogo_CLEAN = $(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogo.c # Rule for making the bios logo. $$(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogo.c: $(VBOX_BRAND_BIOS_LOGO) $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,VgaDefBiosLogo,$<,$@) $(QUIET)$(VBOX_BIN2C) VgaDefBiosLogo $< $@ ifdef VBOX_WITH_OPEN_WATCOM # # Install the symbol file for the BIOS. # INSTALLS += VBoxVgaBiosSym VBoxVgaBiosSym_TEMPLATE = VBoxDbgSyms VBoxVgaBiosSym_SOURCES = \ $(basename $(VBoxVgaBios386_1_TARGET)).sym \ $(basename $(VBoxVgaBios286_1_TARGET)).sym \ $(basename $(VBoxVgaBios8086_1_TARGET)).sym endif include $(FILE_KBUILD_SUB_FOOTER)