# $Id: Makefile.kmk 43610 2012-10-11 09:21:20Z vboxsync $ ## @file # Sub-Makefile for the New VGA 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 # # VBoxVgaBios - The VGA BIOS. # MISCBINS += VBoxVgaBios VBoxVgaBios_TEMPLATE = VBoxBios VBoxVgaBios_ASFLAGS = -0 VBoxVgaBios_DEFS = VBE VBoxVgaBios_SOURCES = \ vgarom.asm \ vberom.asm \ vgabios.c \ vbe.c VBoxVgaBios_LDFLAGS = \ output raw offset=0xC0000 \ order \ clname CODE \ segment VGAROM segaddr=0xC000 \ segment _TEXT segaddr=0xC000 offset=0xA00 \ segment VBE32 segaddr=0xC000 offset=0x4600 \ clname DATA \ segment _DATA segaddr=0xC000 offset=0x4800 \ # # Updates the alternative source file. # update-vgabios-source +| $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.asm $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.md5sum: \ $$(VBoxVgaBios_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_0_OUTDIR)/VBoxVgaBiosAlternative.asm $(QUIET)yasm -f bin -o $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.bin $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm $(VBOX_VBOXCMP) $< $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.bin $(CP) --changed -- $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm $(REDIRECT) -C $(dir $(VBoxVgaBios_1_TARGET)) -- \ $(MD5SUM_EXT) -bo $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.md5sum $(notdir $(VBoxVgaBios_1_TARGET)) $(CP) --changed -- $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.md5sum $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum $(RM) -f -- $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.asm $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.bin $(VBoxVgaBios_0_OUTDIR)/VBoxVgaBiosAlternative.md5sum else $(QUIET)$(ECHO) "Fatal error: Can only update VBoxVgaBiosAlternative.asm/md5sum with a release build." $(QUIET)exit 1 endif endif # VBOX_WITH_OPEN_WATCOM # # The library containing the VGA BIOS image. # LIBRARIES += VgaBiosBin VgaBiosBin_TEMPLATE = VBOXR3 VgaBiosBin_DEFS = IN_VBOXDD2 VgaBiosBin_SOURCES = \ $(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c VgaBiosBin_DEPS = \ $(VgaBiosBin_0_OUTDIR)/vbetables.h VgaBiosBin_CLEAN = \ $(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c \ $(VgaBiosBin_0_OUTDIR)/vbetables.h ifdef VBOX_WITH_OPEN_WATCOM $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c: $$(VBoxVgaBios_1_TARGET) $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@) $(QUIET)$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary $< $@ else VgaBiosBin_CLEAN += $(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin.c + $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom: \ $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.asm \ $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative.md5sum \ $(VBOX_BIN2C) | $$(dir $$@) $(call MSG_TOOL,bin2c,VgaBiosBin,$<,$@) $(QUIET)yasm -f bin -o $(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom $< $(QUIET)$(REDIRECT) -C $(VgaBiosBin_0_OUTDIR) -- \ $(MD5SUM_EXT) -c $(basename $<).md5sum $(QUIET)$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary $(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom $@ $(QUIET)$(RM) -f -- $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios.rom endif # 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 $< $@ include $(FILE_KBUILD_SUB_FOOTER)