1 | # $Id: Makefile.kmk 82968 2020-02-04 10:35:17Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the New VGA BIOS ROM.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2012-2020 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
23 |
|
---|
24 | #
|
---|
25 | # VBoxVgaBios - The VGA BIOS.
|
---|
26 | #
|
---|
27 | MISCBINS += VBoxVgaBios386
|
---|
28 | VBoxVgaBios386_TEMPLATE = VBoxBios
|
---|
29 | VBoxVgaBios386_ASFLAGS = -0
|
---|
30 | VBoxVgaBios386_CFLAGS = -3
|
---|
31 | VBoxVgaBios386_DEFS = VBE VBOX_BIOS_CPU=80386
|
---|
32 | VBoxVgaBios386_INCS = $(VBOX_GRAPHICS_INCS)
|
---|
33 | VBoxVgaBios386_SOURCES = \
|
---|
34 | vgarom.asm \
|
---|
35 | vberom.asm \
|
---|
36 | vgabios.c \
|
---|
37 | vbe.c
|
---|
38 | VBoxVgaBios386_LDFLAGS = \
|
---|
39 | output raw offset=0xC0000 \
|
---|
40 | order \
|
---|
41 | clname CODE \
|
---|
42 | segment VGAROM segaddr=0xC000 \
|
---|
43 | segment _TEXT segaddr=0xC000 offset=0x980 \
|
---|
44 | segment VBE32 segaddr=0xC000 offset=0x4600 \
|
---|
45 | clname DATA \
|
---|
46 | segment _DATA segaddr=0xC000 offset=0x4780 \
|
---|
47 |
|
---|
48 | MISCBINS += VBoxVgaBios286
|
---|
49 | VBoxVgaBios286_EXTENDS = VBoxVgaBios386
|
---|
50 | VBoxVgaBios286_CFLAGS = -2
|
---|
51 | VBoxVgaBios286_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxVgaBios386_DEFS)) VBOX_BIOS_CPU=80286
|
---|
52 |
|
---|
53 | MISCBINS += VBoxVgaBios8086
|
---|
54 | VBoxVgaBios8086_EXTENDS = VBoxVgaBios386
|
---|
55 | VBoxVgaBios8086_CFLAGS = -0
|
---|
56 | VBoxVgaBios8086_DEFS = $(filter-out VBOX_BIOS_CPU=80386,$(VBoxVgaBios386_DEFS)) VBOX_BIOS_CPU=8086
|
---|
57 |
|
---|
58 | #
|
---|
59 | # Updates the alternative source file.
|
---|
60 | #
|
---|
61 | define def_VBoxVgaBiosUpdateAltSource
|
---|
62 | $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).asm +| $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).md5sum: \
|
---|
63 | $$$$(VBoxVgaBios$(1)_1_TARGET) \
|
---|
64 | $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
|
---|
65 | $$(VBOX_VBOXCMP)
|
---|
66 | if1of ($$(KBUILD_TYPE), release)
|
---|
67 | $$(VBOX_MAKE_ALTERNATIVE_SOURCE) \
|
---|
68 | --bios-image $$< \
|
---|
69 | --bios-map $$(basename $$<).map \
|
---|
70 | --bios-sym $$(basename $$<).sym \
|
---|
71 | --bios-type vga \
|
---|
72 | --output $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm
|
---|
73 | $$(QUIET)yasm -f bin \
|
---|
74 | -o $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin \
|
---|
75 | -l $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).lst \
|
---|
76 | $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm
|
---|
77 | $$(VBOX_VBOXCMP) $$< $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin
|
---|
78 | $$(CP) --changed -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm $$(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative$(1).asm
|
---|
79 | $$(REDIRECT) -C $$(dir $$(VBoxVgaBios$(1)_1_TARGET)) -- \
|
---|
80 | $$(MD5SUM_EXT) -bo $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum $$(notdir $$(VBoxVgaBios$(1)_1_TARGET))
|
---|
81 | $$(CP) --changed -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum $$(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative$(1).md5sum
|
---|
82 | $$(RM) -f -- $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).asm \
|
---|
83 | $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).bin \
|
---|
84 | $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).lst \
|
---|
85 | $$(VBoxVgaBios$(1)_0_OUTDIR)/VBoxVgaBiosAlternative$(1).md5sum
|
---|
86 | else
|
---|
87 | $$(QUIET)$$(ECHO) "Fatal error: Can only update VBoxVgaBiosAlternative$(1).asm/md5sum with a release build."
|
---|
88 | $$(QUIET)exit 1
|
---|
89 | endif
|
---|
90 | endef
|
---|
91 |
|
---|
92 | $(evalcall2 def_VBoxVgaBiosUpdateAltSource,386)
|
---|
93 | $(evalcall2 def_VBoxVgaBiosUpdateAltSource,286)
|
---|
94 | $(evalcall2 def_VBoxVgaBiosUpdateAltSource,8086)
|
---|
95 |
|
---|
96 | update-vgabios-source: \
|
---|
97 | $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative386.asm \
|
---|
98 | $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative286.asm \
|
---|
99 | $(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative8086.asm
|
---|
100 |
|
---|
101 | endif # VBOX_WITH_OPEN_WATCOM
|
---|
102 |
|
---|
103 |
|
---|
104 | #
|
---|
105 | # The library containing the VGA BIOS image.
|
---|
106 | #
|
---|
107 | LIBRARIES += VgaBiosBin
|
---|
108 | VgaBiosBin_TEMPLATE = VBOXR3
|
---|
109 | VgaBiosBin_DEFS = IN_VBOXDD2
|
---|
110 | VgaBiosBin_SOURCES =
|
---|
111 | VgaBiosBin_DEPS = $(VgaBiosBin_0_OUTDIR)/vbetables.h
|
---|
112 | VgaBiosBin_CLEAN = $(VgaBiosBin_0_OUTDIR)/vbetables.h
|
---|
113 |
|
---|
114 | define def_VBoxVgaBiosBin
|
---|
115 | VgaBiosBin_SOURCES += $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c
|
---|
116 | VgaBiosBin_CLEAN += $$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c
|
---|
117 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
118 | $$$$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c: $$$$(VBoxVgaBios$(1)_1_TARGET) $$(VBOX_BIN2C) | $$$$(dir $$$$@)
|
---|
119 | $$(call MSG_TOOL,bin2c,VgaBiosBin,$$<,$$@)
|
---|
120 | $$(QUIET)$$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary$(1) $$< $$@
|
---|
121 | else
|
---|
122 | VgaBiosBin_CLEAN += $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom
|
---|
123 |
|
---|
124 | $$$$(VgaBiosBin_0_OUTDIR)/VgaBiosBin$(1).c + $$$$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom: \
|
---|
125 | $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).asm \
|
---|
126 | $$(PATH_SUB_CURRENT)/VBoxVgaBiosAlternative$(1).md5sum \
|
---|
127 | $$(VBOX_BIN2C) | $$$$(dir $$$$@)
|
---|
128 | $$(call MSG_TOOL,bin2c,VgaBiosBin,$$<,$$@)
|
---|
129 | $$(QUIET)yasm -f bin -o $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$<
|
---|
130 | $$(QUIET)$$(REDIRECT) -C $$(VgaBiosBin_0_OUTDIR) -- \
|
---|
131 | $$(MD5SUM_EXT) -c $$(basename $$<).md5sum
|
---|
132 | $$(QUIET)$$(VBOX_BIN2C) -min 32 -max 36 -mask 0x0fff -ascii -export VgaBiosBinary$(1) $$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom $$@
|
---|
133 | $$(QUIET)$$(RM) -f -- $$$$(VgaBiosBin_0_OUTDIR)/VBoxVgaBios$(1).rom
|
---|
134 | endif
|
---|
135 | endef
|
---|
136 | $(evalcall2 def_VBoxVgaBiosBin,386)
|
---|
137 | $(evalcall2 def_VBoxVgaBiosBin,286)
|
---|
138 | $(evalcall2 def_VBoxVgaBiosBin,8086)
|
---|
139 |
|
---|
140 |
|
---|
141 | # Rule for making the vbetables.h that DevVGA uses.
|
---|
142 | $$(VgaBiosBin_0_OUTDIR)/vbetables.h: $(MAKEFILE_CURRENT) $$(vbetables-gen_1_TARGET) | $$(dir $$@)
|
---|
143 | $(QUIET)$(REDIRECT) -wo $@ -- $(vbetables-gen_1_TARGET)
|
---|
144 |
|
---|
145 |
|
---|
146 | #
|
---|
147 | # The VBE tables.
|
---|
148 | #
|
---|
149 | BLDPROGS += vbetables-gen
|
---|
150 | vbetables-gen_TEMPLATE = VBoxBldProg
|
---|
151 | vbetables-gen_SOURCES = vbetables-gen.c
|
---|
152 | vbetables-gen_CLEAN = $(vbetables-gen)
|
---|
153 |
|
---|
154 |
|
---|
155 | #
|
---|
156 | # The VGA BIOS Logo.
|
---|
157 | #
|
---|
158 | LIBRARIES += VgaDefBiosLogo
|
---|
159 | VgaDefBiosLogo_TEMPLATE = VBOXR3
|
---|
160 | VgaDefBiosLogo_INCS = $(VBOX_PATH_DEVICES_SRC)
|
---|
161 | VgaDefBiosLogo_SOURCES = $(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogo.c
|
---|
162 | VgaDefBiosLogo_CLEAN = $(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogo.c
|
---|
163 | ifndef VBOX_OSE
|
---|
164 | VgaDefBiosLogo_SOURCES += $(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogoNY.c
|
---|
165 | VgaDefBiosLogo_CLEAN += $(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogoNY.c
|
---|
166 | endif
|
---|
167 |
|
---|
168 | # Rule for making the bios logo.
|
---|
169 | $$(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogo.c: $(VBOX_BRAND_BIOS_LOGO) $(VBOX_BIN2C) | $$(dir $$@)
|
---|
170 | $(call MSG_TOOL,bin2c,VgaDefBiosLogo,$<,$@)
|
---|
171 | $(QUIET)$(VBOX_BIN2C) VgaDefBiosLogo $< $@
|
---|
172 |
|
---|
173 | # Rule for making the bios logo.
|
---|
174 | $$(VgaDefBiosLogo_0_OUTDIR)/VgaDefBiosLogoNY.c: $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/puel_logo_ny.bmp $(VBOX_BIN2C) | $$(dir $$@)
|
---|
175 | $(call MSG_TOOL,bin2c,VgaDefBiosLogoNY,$<,$@)
|
---|
176 | $(QUIET)$(VBOX_BIN2C) VgaDefBiosLogoNY $< $@
|
---|
177 |
|
---|
178 |
|
---|
179 | ifdef VBOX_WITH_OPEN_WATCOM
|
---|
180 | #
|
---|
181 | # Install the symbol file for the BIOS.
|
---|
182 | #
|
---|
183 | INSTALLS += VBoxVgaBiosSym
|
---|
184 | VBoxVgaBiosSym_TEMPLATE = VBoxDbgSyms
|
---|
185 | VBoxVgaBiosSym_SOURCES = \
|
---|
186 | $(basename $(VBoxVgaBios386_1_TARGET)).sym \
|
---|
187 | $(basename $(VBoxVgaBios286_1_TARGET)).sym \
|
---|
188 | $(basename $(VBoxVgaBios8086_1_TARGET)).sym
|
---|
189 | endif
|
---|
190 |
|
---|
191 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
192 |
|
---|