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