VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/Config.kmk@ 105884

Last change on this file since 105884 was 105075, checked in by vboxsync, 5 months ago

ValKit/bootsectors: Produce a special 63.5MB capable bootsector and use it with the VBoxBS3KitImgBig template, disabling the 63.5MB capability in the regular bootsector so it works on USB sticks on real HW as well. bugref:10715

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 46.9 KB
Line 
1# $Id: Config.kmk 105075 2024-06-28 15:45:11Z vboxsync $
2## @file
3# kBuild Configuration file for VirtualBox Boot Sector Kit 3.
4#
5
6#
7# Copyright (C) 2010-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# The contents of this file may alternatively be used under the terms
26# of the Common Development and Distribution License Version 1.0
27# (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28# in the VirtualBox distribution, in which case the provisions of the
29# CDDL are applicable instead of those of the GPL.
30#
31# You may elect to license modified versions of this file under the
32# terms and conditions of either the GPL or the CDDL or both.
33#
34# SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35#
36
37VBOX_BOOTSECTORS_CONFIG_KMK_INCLUDED = 1
38
39# Include the parent configure file.
40ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
41 include $(PATH_ROOT)/src/VBox/ValidationKit/Config.kmk
42endif
43
44# Add our 32-bit and 64-bit C properties.
45KBUILD_COMPILE_CATEGTORIES += C32 C64
46PROPS_TOOLS += C32TOOL C64TOOL
47PROPS_SINGLE += C32TOOL C64TOOL C32OBJSUFF C64OBJSUFF
48PROPS_ACCUMULATE_R += C32FLAGS C64FLAGS C32DEFS C64DEFS
49PROPS_ACCUMULATE_L += C32INCS C64INCS
50
51if 0 # Adding as few as possible new properties.
52 KBUILD_COMPILE_CATEGTORIES += C16
53 PROPS_TOOLS += C16TOOL
54 PROPS_SINGLE += C16TOOL C16OBJSUFF
55 PROPS_ACCUMULATE_R += C16FLAGS C16DEFS
56 PROPS_ACCUMULATE_L += C16INCS
57endif
58
59# Add noarch to the architectures list (will be there by default in a new kBuild).
60KBUILD_ARCHES += noarch
61
62
63# The bootsector directory.
64VBOX_PATH_BOOTSECTORS_SRC = $(VBOX_PATH_VALIDATIONKIT_SRC)/bootsectors
65
66# The bs3kit source directory.
67VBOX_PATH_BS3KIT_SRC = $(VBOX_PATH_BOOTSECTORS_SRC)/bs3kit
68
69
70# The 16-bit code & data segment classes.
71if 1
72 BS3KIT_CLASS_CODE16 = CODE
73 BS3KIT_SEGNM_DATA16 =
74 BS3KIT_CLASS_DATA16 = DATA
75 BS3KIT_GRPNM_DATA16 = DGROUP
76 BS3KIT_CLASS_BSS16 = BSS
77else
78 BS3KIT_CLASS_CODE16 = BS3CLASS16CODE
79 BS3KIT_SEGNM_DATA16 = BS3DATA16
80 BS3KIT_CLASS_DATA16 = FAR_DATA
81 BS3KIT_GRPNM_DATA16 = BS3DATA16_GROUP
82 BS3KIT_CLASS_BSS16 = ???
83endif
84
85
86##
87# Macro for generating near-call aliases for one 16-bit C function.
88# @param 1 The target name.
89# @param 2 The common function.
90BS3KIT_FN_GEN_CMN_NEARSTUB = $(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2_c16,_$2_f16)
91
92##
93# Macro for generating near-call aliases for one 16-bit C mode function.
94# @param 1 The target name.
95# @param 2 The mode function.
96BS3KIT_FN_GEN_MODE_NEARSTUB = $(foreach suff, \
97 _rm \
98 _pe16 \
99 _pe16_v86 \
100 _pe32_16 \
101 _pev86 \
102 _pp16 \
103 _pp16_v86 \
104 _pp32_16 \
105 _ppv86 \
106 _pae16 \
107 _pae16_v86 \
108 _pae32_16 \
109 _paev86 \
110 _lm16 \
111 ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2$(suff),_$2$(suff)_far))
112
113# @param 1 The target name.
114# @param 2 The near function name.
115# @param 3 The far function name.
116define def_Bs3KitGenNearStubSource
117 $1_SOURCES += $$($1_0_OUTDIR)/stub$2.asm
118 $1_CLEAN += $$($1_0_OUTDIR)/stub$2.asm
119 #$$$$($1_0_OUTDIR)/stub$2.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)
120 $$$$($1_0_OUTDIR)/stub$2.asm: | $$$$(dir $$$$@)
121 $(QUIET)$(APPEND) -tn $$@ \
122 '%include "bs3kit.mac"' \
123 'BS3_BEGIN_TEXT16' \
124 ' extern $3' \
125 'BS3_BEGIN_TEXT16_NEARSTUBS' \
126 'BS3_GLOBAL_NAME_EX $2, function, 6' \
127 ' pop ax' \
128 ' push cs' \
129 ' push ax' \
130 ' jmp $3 wrt CGROUP16'
131endef
132
133
134##
135# Macro for generating far-call aliases for zero or more 16-bit C or assembly functions.
136# @param 1 The target name.
137# @param 2 The common function.
138# @param 3 The parameter size in bytes.
139BS3KIT_FN_GEN_CMN_FARSTUB = $(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,_f16,_c16,$3)
140
141##
142# Macro for generating far-call aliases for zero or more 16-bit C mode functions.
143# @param 1 The target name.
144# @param 2 The mode function.
145# @param 3 The parameter size in bytes.
146BS3KIT_FN_GEN_MODE_FARSTUB = $(foreach suff, \
147 _rm \
148 _pe16 \
149 _pe16_v86 \
150 _pe32_16 \
151 _pev86 \
152 _pp16 \
153 _pp16_v86 \
154 _pp32_16 \
155 _ppv86 \
156 _pae16 \
157 _pae16_v86 \
158 _pae32_16 \
159 _paev86 \
160 _lm16 \
161 ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,$(suff)_far,$(suff),$3))
162
163# @param 1 The target name.
164# @param 2 The function name.
165# @param 3 The far function suffix.
166# @param 4 The near function suffix.
167# @param 5 The parameter size in bytes.
168define def_Bs3KitGenFarStubSource
169 $1_SOURCES += $$($1_0_OUTDIR)/stub_$2$3.asm
170 $1_CLEAN += $$($1_0_OUTDIR)/stub_$2$3.asm
171 #$$$$($1_0_OUTDIR)/stub_$2$3.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)
172 $$$$($1_0_OUTDIR)/stub_$2$3.asm: | $$$$(dir $$$$@)
173 $(QUIET)$(APPEND) -tn $$@ \
174 '%include "bs3kit.mac"' \
175 'BS3_BEGIN_TEXT16' \
176 ' extern _$2$4' \
177 'BS3_BEGIN_TEXT16_FARSTUBS' \
178 'BS3_PROC_BEGIN _$2$3' \
179 ' CPU 8086' \
180 ' inc bp' \
181 ' push bp' \
182 ' mov bp, sp' \
183 '%assign offParam $5' \
184 '%rep $5 / 2' \
185 ' push word [bp + 2 + 4 + offParam - 2]' \
186 '%assign offParam offParam - 2' \
187 '%endrep' \
188 ' call _$2$4' \
189 ' add sp, $5' \
190 ' pop bp' \
191 ' dec bp' \
192 ' retf' \
193 'BS3_PROC_END _$2$3' \
194 ''
195endef
196
197
198#
199# Tools Tools Tools
200# Tools Tools Tools
201# Tools Tools Tools
202#
203
204if defined(VBOX_USE_KSUBMIT) && "$(KBUILD_HOST)" == "win"
205 VBOX_BS3KIT_KSUBMIT_OBJ_CONV := kmk_builtin_kSubmit --
206else
207 VBOX_BS3KIT_KSUBMIT_OBJ_CONV :=
208endif
209
210# Dummy CP "linker" tool.
211TOOL_VBoxBsCpLd = Dummy copy linker.
212TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
213TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
214TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
215define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
216 $(CP) -- $(objs) $(othersrc) "$(out)"
217endef
218
219# Dummy exit 1 "linker" tool.
220TOOL_VBoxBsUnusedLd = Dummy unused linker.
221TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
222TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
223TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
224define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
225 echo "cannot use this template for linking"
226 exit 1
227endef
228
229# NASM tool with dependency workarounds (change dir to force consistent results; add -MP).
230# Requires http://permalink.gmane.org/gmane.comp.lang.nasm.devel/3704 to work.
231include $(KBUILD_PATH)/tools/NASM.kmk
232TOOL_VBoxNasm = Our version of the NASM tool
233ifndef TOOL_VBoxNasm_PATH
234 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/nasm/v*.*)))
235 if "$(TOOL_VBoxNasm_PATH)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
236 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/nasm/v*.*)))
237 endif
238endif
239ifneq ($(TOOL_VBoxNasm_PATH),)
240 TOOL_VBoxNasm_AS ?= $(TOOL_VBoxNasm_PATH)/nasm$(HOSTSUFF_EXE)
241else
242 TOOL_VBoxNasm_AS ?= nasm$(HOSTSUFF_EXE)
243endif
244TOOL_VBoxNasm_ASFLAGS ?= $(TOOL_NASM_ASFLAGS)
245TOOL_VBoxNasm_COMPILE_AS_OUTPUT = $(outbase).lst
246TOOL_VBoxNasm_COMPILE_AS_OUTPUT_MAYBE = $(obj).original
247TOOL_VBoxNasm_COMPILE_AS_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
248TOOL_VBoxNasm_COMPILE_AS_DEPORD =
249define TOOL_VBoxNasm_COMPILE_AS_CMDS
250 ifdef TOOL_VBoxNasm_USE_KSUBMIT
251 $(QUIET)kmk_builtin_kSubmit -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasm_AS)\
252 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
253 -l $(outbase).lst\
254 -o $(obj)\
255 -MD "$(dep)" -MP\
256 $(abspath $(source))
257 else
258 $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasm_AS)\
259 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
260 -l $(outbase).lst\
261 -o $(obj)\
262 -MD "$(dep)" -MP\
263 $(abspath $(source))
264 endif
265 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
266endef
267
268#
269# ELF 64-bit compiler tool with object conversion.
270#
271# Mac needs cross compiler: sudo port install x86_64-elf-gcc
272#
273TOOL_Bs3Gcc64Elf64 := AMD64/ELF64 gcc/g++ (cross) compiler.
274ifeq ($(KBUILD_HOST),darwin)
275 TOOL_Bs3Gcc64Elf64_CC ?= x86_64-elf-gcc$(HOSTSUFF_EXE) -m64
276 TOOL_Bs3Gcc64Elf64_CXX ?= x86_64-elf-g++$(HOSTSUFF_EXE) -m64
277else
278 TOOL_Bs3Gcc64Elf64_CC ?= gcc$(HOSTSUFF_EXE) -m64
279 TOOL_Bs3Gcc64Elf64_CXX ?= g++$(HOSTSUFF_EXE) -m64
280endif
281ifdef SLKRUNS
282 TOOL_Bs3Gcc64Elf64_CC += -fmessage-length=0
283 TOOL_Bs3Gcc64Elf64_CXX += -fmessage-length=0
284endif
285TOOL_Bs3Gcc64Elf64_COBJSUFF = .o64
286TOOL_Bs3Gcc64Elf64_CFLAGS = -fno-pie -x c $(VBOX_GCC_Wa_cma_nocompress_debug_sections) -ffreestanding
287TOOL_Bs3Gcc64Elf64_CFLAGS.debug = -g
288TOOL_Bs3Gcc64Elf64_CFLAGS.profile = -O2 #-g -pg
289TOOL_Bs3Gcc64Elf64_CFLAGS.release = -O2
290TOOL_Bs3Gcc64Elf64_CINCS =
291TOOL_Bs3Gcc64Elf64_CDEFS =
292TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
293TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD =
294TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT =
295TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT_MAYBE = $(obj).original
296define TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS
297 $(QUIET)$(TOOL_Bs3Gcc64Elf64_CC) -c\
298 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
299 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
300 -o $(obj)\
301 $(abspath $(source))
302 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
303 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
304endef
305
306TOOL_Bs3Gcc64Elf64_C64OBJSUFF = $(TOOL_Bs3Gcc64Elf64_COBJSUFF)
307TOOL_Bs3Gcc64Elf64_C64FLAGS = $(TOOL_Bs3Gcc64Elf64_CFLAGS)
308TOOL_Bs3Gcc64Elf64_C64FLAGS.debug = $(TOOL_Bs3Gcc64Elf64_CFLAGS.debug)
309TOOL_Bs3Gcc64Elf64_C64FLAGS.profile = $(TOOL_Bs3Gcc64Elf64_CFLAGS.profile)
310TOOL_Bs3Gcc64Elf64_C64FLAGS.release = $(TOOL_Bs3Gcc64Elf64_CFLAGS.release)
311TOOL_Bs3Gcc64Elf64_C64INCS = $(TOOL_Bs3Gcc64Elf64_CINCS)
312TOOL_Bs3Gcc64Elf64_C64DEFS = $(TOOL_Bs3Gcc64Elf64_CDEFS)
313TOOL_Bs3Gcc64Elf64_COMPILE_C64_DEPEND = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND)
314TOOL_Bs3Gcc64Elf64_COMPILE_C64_DEPORD = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD)
315TOOL_Bs3Gcc64Elf64_COMPILE_C64_OUTPUT = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT)
316TOOL_Bs3Gcc64Elf64_COMPILE_C64_OUTPUT_MAYBE = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT_MAYBE)
317define TOOL_Bs3Gcc64Elf64_COMPILE_C64_CMDS
318$(TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS)
319endef
320
321TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
322TOOL_Bs3Gcc64Elf64_CXXFLAGS ?= -fno-pie $(VBOX_GCC_Wa_cma_nocompress_debug_sections) -ffreestanding
323TOOL_Bs3Gcc64Elf64_CXXFLAGS.debug ?= -g0 # no debug info, thank you
324TOOL_Bs3Gcc64Elf64_CXXFLAGS.profile ?= -O2 #-g -pg
325TOOL_Bs3Gcc64Elf64_CXXFLAGS.release ?= -O2
326TOOL_Bs3Gcc64Elf64_CXXINCS ?=
327TOOL_Bs3Gcc64Elf64_CXXDEFS ?=
328TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
329TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPORD =
330TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT =
331TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT_MAYBE = $(obj).original
332define TOOL_Bs3Gcc64Elf64_COMPILE_CXX_CMDS
333 $(QUIET)$(TOOL_Bs3Gcc64Elf64_CXX) -c\
334 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
335 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
336 -o $(obj)\
337 $(abspath $(source))
338 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
339 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
340endef
341
342#
343# Visual C++ tool variant that runs the object converter afterwards.
344#
345# We also run SED on the assembly listing looking for SSE instructions, since
346# the compiler doesn't have any known option to suppress SSE optimization. When
347# the SED script finds something, the source code needs to be tweaked to work
348# around it. See r160217 for examples.
349#
350TOOL_Bs3Vcc64 := Visual C++ 64-bit
351TOOL_Bs3Vcc64_CC = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CC)
352TOOL_Bs3Vcc64_CXX = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXX)
353TOOL_Bs3Vcc64_COBJSUFF = .o64
354TOOL_Bs3Vcc64_CFLAGS = $(filter-out -TC -Zi,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CFLAGS)) -TC -Z7
355TOOL_Bs3Vcc64_CFLAGS.debug =
356TOOL_Bs3Vcc64_CFLAGS.dbgopt = -O1
357TOOL_Bs3Vcc64_CFLAGS.profile = -O1
358TOOL_Bs3Vcc64_CFLAGS.release = -O1
359TOOL_Bs3Vcc64_CINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
360TOOL_Bs3Vcc64_CDEFS =
361TOOL_Bs3Vcc64_COMPILE_C_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
362TOOL_Bs3Vcc64_COMPILE_C_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPORD)
363TOOL_Bs3Vcc64_COMPILE_C_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT)
364TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE) $(obj).original
365TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE_PRECIOUS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE_PRECIOUS) $(outbase)-obj.asm
366define TOOL_Bs3Vcc64_COMPILE_C_CMDS
367$(subst -Fo,-Fa$(outbase)-obj.asm -Fo,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS))
368 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
369 $(QUIET)$(SED) -e '/xmm[0-9]/!d' -e 'q11' $(outbase)-obj.asm
370endef
371
372TOOL_Bs3Vcc64_C64OBJSUFF = $(TOOL_Bs3Vcc64_COBJSUFF)
373TOOL_Bs3Vcc64_C64FLAGS = $(TOOL_Bs3Vcc64_CFLAGS)
374TOOL_Bs3Vcc64_C64FLAGS.debug = $(TOOL_Bs3Vcc64_CFLAGS.debug)
375TOOL_Bs3Vcc64_C64FLAGS.dbgopt = $(TOOL_Bs3Vcc64_CFLAGS.dbgopt)
376TOOL_Bs3Vcc64_C64FLAGS.profile = $(TOOL_Bs3Vcc64_CFLAGS.profile)
377TOOL_Bs3Vcc64_C64FLAGS.release = $(TOOL_Bs3Vcc64_CFLAGS.release)
378TOOL_Bs3Vcc64_C64INCS = $(TOOL_Bs3Vcc64_CINCS)
379TOOL_Bs3Vcc64_C64DEFS = $(TOOL_Bs3Vcc64_CDEFS)
380TOOL_Bs3Vcc64_COMPILE_C64_DEPEND = $(TOOL_Bs3Vcc64_COMPILE_C_DEPEND)
381TOOL_Bs3Vcc64_COMPILE_C64_DEPORD = $(TOOL_Bs3Vcc64_COMPILE_C_DEPORD)
382TOOL_Bs3Vcc64_COMPILE_C64_OUTPUT = $(TOOL_Bs3Vcc64_COMPILE_C_OUTPUT)
383TOOL_Bs3Vcc64_COMPILE_C64_OUTPUT_MAYBE = $(TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE)
384define TOOL_Bs3Vcc64_COMPILE_C64_CMDS
385$(TOOL_Bs3Vcc64_COMPILE_C_CMDS)
386endef
387
388TOOL_Bs3Vcc64_CXXOBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXOBJSUFF)
389TOOL_Bs3Vcc64_CXXFLAGS = $(filter-out -Zi,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXFLAGS)) -TP -Z7
390TOOL_Bs3Vcc64_CXXFLAGS.debug =
391TOOL_Bs3Vcc64_CXXFLAGS.dbgopt = -O1
392TOOL_Bs3Vcc64_CXXFLAGS.profile = -O1
393TOOL_Bs3Vcc64_CXXFLAGS.release = -O1
394TOOL_Bs3Vcc64_CXXINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
395TOOL_Bs3Vcc64_CXXDEFS =
396TOOL_Bs3Vcc64_COMPILE_CXX_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
397TOOL_Bs3Vcc64_COMPILE_CXX_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPORD)
398TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT)
399TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE) $(obj).original
400TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE_PRECIOUS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE_PRECIOUS) $(outbase)-obj.asm
401define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
402$(subst -Fo,-Fa$(outbase)-obj.asm -Fo,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS))
403 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
404 $(QUIET)$(SED) -e '/xmm[0-9]/!d' -e 'q11' $(outbase)-obj.asm
405endef
406
407#
408# 32-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
409# to rename intrinsic functions so they don't clash with the 16-bit compiler.
410#
411TOOL_Bs3Ow32 := OpenWatcom C/C++ 32-bit with object conversion and import library creation
412TOOL_Bs3Ow32_EXTENDS = OPENWATCOM
413TOOL_Bs3Ow32_CC = $(TOOL_OPENWATCOM_CC)
414TOOL_Bs3Ow32_CXX = $(TOOL_OPENWATCOM_CXX)
415TOOL_Bs3Ow32_COBJSUFF = .o32
416TOOL_Bs3Ow32_CFLAGS = $(TOOL_OPENWATCOM_CFLAGS)
417# -adfs \ - This is too complicated and it doesn't support stubbing files (svn rename fun.h pain.h). Use kDepObj instead.
418# -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) \
419# -adt=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \
420# -add=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) \
421# -adhp=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dir $(abspath $(source))))
422TOOL_Bs3Ow32_CFLAGS.debug = $(TOOL_OPENWATCOM_CFLAGS.debug)
423TOOL_Bs3Ow32_CFLAGS.dbgopt = $(TOOL_OPENWATCOM_CFLAGS.dbgopt)
424TOOL_Bs3Ow32_CFLAGS.profile = $(TOOL_OPENWATCOM_CFLAGS.profile)
425TOOL_Bs3Ow32_CFLAGS.release = $(TOOL_OPENWATCOM_CFLAGS.release)
426TOOL_Bs3Ow32_CINCS = $(TOOL_OPENWATCOM_CINCS)
427TOOL_Bs3Ow32_CDEFS =
428TOOL_Bs3Ow32_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
429TOOL_Bs3Ow32_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM_COMPILE_C_DEPORD)
430TOOL_Bs3Ow32_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT)
431TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT_MAYBE) $(obj).original
432define TOOL_Bs3Ow32_COMPILE_C_CMDS
433$(TOOL_OPENWATCOM_COMPILE_C_CMDS)
434 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
435endef
436
437TOOL_Bs3Ow32_C32OBJSUFF = $(TOOL_Bs3Ow32_COBJSUFF)
438TOOL_Bs3Ow32_C32FLAGS = $(TOOL_Bs3Ow32_CFLAGS)
439TOOL_Bs3Ow32_C32FLAGS.debug = $(TOOL_Bs3Ow32_CFLAGS.debug)
440TOOL_Bs3Ow32_C32FLAGS.dbgopt = $(TOOL_Bs3Ow32_CFLAGS.dbgopt)
441TOOL_Bs3Ow32_C32FLAGS.profile = $(TOOL_Bs3Ow32_CFLAGS.profile)
442TOOL_Bs3Ow32_C32FLAGS.release = $(TOOL_Bs3Ow32_CFLAGS.release)
443TOOL_Bs3Ow32_C32INCS = $(TOOL_Bs3Ow32_CINCS)
444TOOL_Bs3Ow32_C32DEFS =
445TOOL_Bs3Ow32_COMPILE_C32_DEPEND = $(TOOL_Bs3Ow32_COMPILE_C_DEPEND)
446TOOL_Bs3Ow32_COMPILE_C32_DEPORD = $(TOOL_Bs3Ow32_COMPILE_C_DEPORD)
447TOOL_Bs3Ow32_COMPILE_C32_OUTPUT = $(TOOL_Bs3Ow32_COMPILE_C_OUTPUT)
448TOOL_Bs3Ow32_COMPILE_C32_OUTPUT_MAYBE = $(TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE)
449define TOOL_Bs3Ow32_COMPILE_C32_CMDS
450$(TOOL_Bs3Ow32_COMPILE_C_CMDS)
451endef
452
453TOOL_Bs3Ow32_CXXOBJSUFF = $(TOOL_OPENWATCOM_CXXOBJSUFF)
454TOOL_Bs3Ow32_CXXFLAGS = $(TOOL_OPENWATCOM_CXXFLAGS) -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) -adfs
455TOOL_Bs3Ow32_CXXFLAGS.debug = $(TOOL_OPENWATCOM_CXXFLAGS.debug)
456TOOL_Bs3Ow32_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM_CXXFLAGS.dbgopt)
457TOOL_Bs3Ow32_CXXFLAGS.profile = $(TOOL_OPENWATCOM_CXXFLAGS.profile)
458TOOL_Bs3Ow32_CXXFLAGS.release = $(TOOL_OPENWATCOM_CXXFLAGS.release)
459TOOL_Bs3Ow32_CXXINCS = $(TOOL_OPENWATCOM_CXXINCS)
460TOOL_Bs3Ow32_CXXDEFS =
461TOOL_Bs3Ow32_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
462TOOL_Bs3Ow32_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPORD)
463TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT)
464TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT_MAYBE) $(obj).original
465define TOOL_Bs3Ow32_COMPILE_CXX_CMDS
466$(TOOL_OPENWATCOM_COMPILE_CXX_CMDS)
467 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
468endef
469
470
471#
472# 16-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
473# to rename intrinsic functions so they don't clash with the 16-bit compiler.
474#
475TOOL_Bs3Ow16 := OpenWatcom C/C++ 16-bit with object convertsion
476TOOL_Bs3Ow16_EXTENDS := OPENWATCOM-16
477TOOL_Bs3Ow16_CC = $(TOOL_OPENWATCOM-16_CC)
478TOOL_Bs3Ow16_CXX = $(TOOL_OPENWATCOM-16_CXX)
479TOOL_Bs3Ow16_COBJSUFF = .o16
480TOOL_Bs3Ow16_CFLAGS = $(TOOL_OPENWATCOM-16_CFLAGS)
481TOOL_Bs3Ow16_CFLAGS.debug = $(TOOL_OPENWATCOM-16_CFLAGS.debug)
482TOOL_Bs3Ow16_CFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CFLAGS.dbgopt)
483TOOL_Bs3Ow16_CFLAGS.profile = $(TOOL_OPENWATCOM-16_CFLAGS.profile)
484TOOL_Bs3Ow16_CFLAGS.release = $(TOOL_OPENWATCOM-16_CFLAGS.release)
485TOOL_Bs3Ow16_CINCS = $(TOOL_OPENWATCOM-16_CINCS)
486TOOL_Bs3Ow16_CDEFS =
487TOOL_Bs3Ow16_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
488TOOL_Bs3Ow16_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPORD)
489TOOL_Bs3Ow16_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT)
490TOOL_Bs3Ow16_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT_MAYBE) $(obj).original
491define TOOL_Bs3Ow16_COMPILE_C_CMDS
492$(TOOL_OPENWATCOM-16_COMPILE_C_CMDS)
493 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
494endef
495
496TOOL_Bs3Ow16_C16OBJSUFF = $(TOOL_Bs3Ow16_C16OBJSUFF)
497TOOL_Bs3Ow16_C16FLAGS = $(TOOL_Bs3Ow16_C16FLAGS)
498TOOL_Bs3Ow16_C16FLAGS.debug = $(TOOL_Bs3Ow16_C16FLAGS.debug)
499TOOL_Bs3Ow16_C16FLAGS.dbgopt = $(TOOL_Bs3Ow16_C16FLAGS.dbgopt)
500TOOL_Bs3Ow16_C16FLAGS.profile = $(TOOL_Bs3Ow16_C16FLAGS.profile)
501TOOL_Bs3Ow16_C16FLAGS.release = $(TOOL_Bs3Ow16_C16FLAGS.release)
502TOOL_Bs3Ow16_C16INCS = $(TOOL_Bs3Ow16_C16INCS)
503TOOL_Bs3Ow16_C16DEFS = $(TOOL_Bs3Ow16_C16DEFS)
504TOOL_Bs3Ow16_COMPILE_C16_DEPEND = $(TOOL_Bs3Ow16_COMPILE_C16_DEPEND)
505TOOL_Bs3Ow16_COMPILE_C16_DEPORD = $(TOOL_Bs3Ow16_COMPILE_C16_DEPORD)
506TOOL_Bs3Ow16_COMPILE_C16_OUTPUT = $(TOOL_Bs3Ow16_COMPILE_C16_OUTPUT)
507TOOL_Bs3Ow16_COMPILE_C16_OUTPUT_MAYBE = $(TOOL_Bs3Ow16_COMPILE_C16_OUTPUT_MAYBE)
508define TOOL_Bs3Ow16_COMPILE_C16_CMDS
509$(TOOL_Bs3Ow16_COMPILE_C_CMDS)
510endef
511
512TOOL_Bs3Ow16_CXXOBJSUFF = $(TOOL_OPENWATCOM-16_CXXOBJSUFF)
513TOOL_Bs3Ow16_CXXFLAGS = $(TOOL_OPENWATCOM-16_CXXFLAGS)
514TOOL_Bs3Ow16_CXXFLAGS.debug = $(TOOL_OPENWATCOM-16_CXXFLAGS.debug)
515TOOL_Bs3Ow16_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CXXFLAGS.dbgopt)
516TOOL_Bs3Ow16_CXXFLAGS.profile = $(TOOL_OPENWATCOM-16_CXXFLAGS.profile)
517TOOL_Bs3Ow16_CXXFLAGS.release = $(TOOL_OPENWATCOM-16_CXXFLAGS.release)
518TOOL_Bs3Ow16_CXXINCS = $(TOOL_OPENWATCOM-16_CXXINCS)
519TOOL_Bs3Ow16_CXXDEFS =
520TOOL_Bs3Ow16_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
521TOOL_Bs3Ow16_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPORD)
522TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT)
523TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT_MAYBE) $(obj).original
524define TOOL_Bs3Ow16_COMPILE_CXX_CMDS
525$(TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS)
526 $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
527endef
528
529TOOL_Bs3Ow16_AR = $(TOOL_OPENWATCOM_AR)
530TOOL_Bs3Ow16_ARFLAGS = $(TOOL_OPENWATCOM_ARFLAGS) @@replace-me-with-list-option@@
531TOOL_Bs3Ow16_ARLIBSUFF = $(TOOL_OPENWATCOM_ARLIBSUFF)
532TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT = $(outbase)-implib.lib $(outbase)-implib.rsp $(outbase).lst
533TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT_MAYBE_PRECIOUS = $(TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT_MAYBE_PRECIOUS)
534TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT_DEPEND = $(TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT_DEPEND)
535TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT_DEPORD = $(TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT_DEPORD)
536define TOOL_Bs3Ow16_LINK_LIBRARY_CMDS
537$(subst @@replace-me-with-list-option@@,-l=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).lst),$(TOOL_OPENWATCOM_LINK_LIBRARY_CMDS))
538 $(TOOL_Bs3Ow16_AR) -m "$(out)" \
539 | $(SED) \
540 -e '/^ _Bs3[_a-zA-Z0-9]*$$(DOLLAR)/!d' \
541 -e '/_EndProc/d' \
542 -e '/\./d' \
543 -e 's/^ *\(_Bs3[_a-zA-Z0-9]*\)$$(DOLLAR)/++\1.bs3kit/' \
544 --output $(outbase)-implib.rsp
545 $(TOOL_Bs3Ow16_AR) -q -n -io -inn $(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase)-implib.lib) @$(outbase)-implib.rsp
546endef
547
548# Debug info format depends on what we use for 64-bit.
549if 1 #1of ($(KBUILD_HOST), win) - wlink dwarf .sym files are useless for binary blobs
550 BS3_OW_DBG_OPT = -hc -d1+
551 #BS3_OW_DBG_OPT = -hd -d1+
552 BS3_OW_DBG_LDOPT = codeview
553else
554 BS3_OW_DBG_OPT = -hd -d1+
555 BS3_OW_DBG_LDOPT = dwarf
556endif
557
558#
559# Source handlers for .c16, .c32 and .c64
560#
561define VBoxBs3KitImgSrcHandler_16bit_c
562 local type := C
563 $(kb-src-one 2)
564endef
565
566C32TOOL = Bs3Ow32
567define VBoxBs3KitImgSrcHandler_32bit_c
568 local type := C32
569 $(kb-src-one 2)
570endef
571
572define VBoxBs3KitImgSrcHandler_64bit_c
573 local type := C64
574 $(kb-src-one 2)
575endef
576
577define VBoxBs3KitImgSrcHandler_high_dll
578 local genasm := $($(target)_0_OUTDIR)/high-dll-$(notdir $(basename $(source))).asm
579 $(eval $(target)_CLEAN += $(genasm))
580 $(eval $(target)_GEN_SOURCES_ += $(genasm))
581 $(target)_2_VBOX_BS3KIT_HIGH_DLLS := $($(target)_2_VBOX_BS3KIT_HIGH_DLLS) $(source)
582
583 $(genasm): $(source) | $(VBoxBs3Linker_1_TARGET) $$(dir $$@)
584 $(VBoxBs3Linker_1_TARGET) --generate-high-dll-import-table "$<" --output "$@"
585endef
586
587
588#
589# BS3Kit template for assembly and 16-bit code.
590#
591# Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen
592# reloading string pointer argument all the time).
593# Update! -d1+ is required for line number information in code living in include
594# files and any DWARF stuff at all. So, we'll ignore poor code quality.
595# Note! Optimization options should come after debug stuff as -d2 for instance
596# disables all optimziations.
597# Note! We use BS3CLASS16CODE because of wdis code detection heuristics requires the class
598# of a code segment to be exactly 'CODE', or ending with 'CODE' or 'TEXT' (more
599# recent wdis have a -c=<clsnm> option, but not the one we currently use ).
600#
601#
602# Compiler options explained:
603# -nt=xxxx Sets the text segment name.
604# -nc=xxxx Sets the text segment class name.
605# -nd=xxxx Sets the data segment name.
606# -ecc Sets the default calling convension to __cdecl
607# Update: We don't use this in 16-bit code as it causes unfavorable reloading of DS before calling
608# inlined functions (e.g. iprt/asm.h). Instead we use -ecw and __cdecl where needed.
609# Update: With -zdp the DS reloading is gone. Code is slightly larger, but seems to cure stability
610# issues in bs3CpuBasic2_RaiseXcpt1 (workers ending up with default calling convention).
611# -ecw Sets the default calling convension to __watcall ()
612# -q Quiet, no logos or stuff.
613# -0 Use 8086 instruction set (16-bit only).
614# -3 Use 386 instruction set (16-bit only).
615# -e<num> Stop after <num> errors.
616# -wx Maxium warning level.
617# -zl Don't emit default library information.
618# -zdp DS pegged to BS3DATA16_GROUP/DGROUP.
619# -zu Assume SS != DS.
620# -mc Compact memory model, far data, small code.
621# -ml Large memory model, far data, far code.
622# -mf Flat memory model (32-bit).
623# -d+ Enabled better /dVAR=XXX parsing, using space as delimiter instead of alpha-numerical/whatever.
624# -d1 Debug info: Globals and line numbers.
625# -s No stack overflow checks.
626# -oa Relaxed aliasing constraints.
627# -ob Branch prediction.
628# -of Generate stack frames when needed.
629# -oi Inline instrinsics functions.
630# -ol Loop optimizations.
631# -oh Expensive optimizations. (saves a byte or two)
632# -or Reorder for best pipeline.
633# -os Favor size over speed.
634#
635TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
636TEMPLATE_VBoxBS3KitImg_BLD_TRG = os-agnostic
637TEMPLATE_VBoxBS3KitImg_BLD_TRG_ARCH = noarch
638TEMPLATE_VBoxBS3KitImg_INST = $(INST_VALIDATIONKIT)bootsectors/
639TEMPLATE_VBoxBS3KitImg_BINSUFF = .img
640TEMPLATE_VBoxBS3KitImg_MODE = 0644
641TEMPLATE_VBoxBS3KitImg_SRC_HANDLERS = \
642 .c16:VBoxBs3KitImgSrcHandler_16bit_c \
643 .c32:VBoxBs3KitImgSrcHandler_32bit_c \
644 .c64:VBoxBs3KitImgSrcHandler_64bit_c \
645 .high-dll:VBoxBs3KitImgSrcHandler_high_dll
646TEMPLATE_VBoxBS3KitImg_ASOBJSUFF = .o16
647TEMPLATE_VBoxBS3KitImg_ASTOOL = VBoxNasm
648#TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
649TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
650TEMPLATE_VBoxBS3KitImg_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__ ARCH_BITS=16 RT_ARCH_X86 ASM_MODEL_FAR_CODE \
651 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
652 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
653TEMPLATE_VBoxBS3KitImg_DEFS = IN_BS3KIT IPRT_NO_CRT
654TEMPLATE_VBoxBS3KitImg_DEFS.debug = BS3_STRICT
655
656TEMPLATE_VBoxBS3KitImg_ARTOOL = Bs3Ow16
657
658TEMPLATE_VBoxBS3KitImg_CTOOL = Bs3Ow16
659TEMPLATE_VBoxBS3KitImg_CXXTOOL = Bs3Ow16
660TEMPLATE_VBoxBS3KitImg_CFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \
661 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -e125 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -oh -d+
662TEMPLATE_VBoxBS3KitImg_CXXFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \
663 -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -e125 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -oh -d+
664TEMPLATE_VBoxBS3KitImg_CDEFS = ARCH_BITS=16 RT_ARCH_X86
665
666TEMPLATE_VBoxBS3KitImg_TOOL = $(NO_SUCH_VARIABLE)
667TEMPLATE_VBoxBS3KitImg_C16TOOL = $(TEMPLATE_VBoxBS3KitImg_CTOOL)
668TEMPLATE_VBoxBS3KitImg_C16FLAGS = $(TEMPLATE_VBoxBS3KitImg_CFLAGS)
669TEMPLATE_VBoxBS3KitImg_C16DEFS = $(TEMPLATE_VBoxBS3KitImg_CDEFS)
670TEMPLATE_VBoxBS3KitImg_C32TOOL := Bs3Ow32
671TEMPLATE_VBoxBS3KitImg_C32FLAGS = $(TEMPLATE_VBoxBS3KitImg32_CFLAGS)
672TEMPLATE_VBoxBS3KitImg_C32DEFS = ARCH_BITS=32 RT_ARCH_X86
673TEMPLATE_VBoxBS3KitImg_C64TOOL = $(TEMPLATE_VBoxBS3KitImg64_CTOOL)
674TEMPLATE_VBoxBS3KitImg_C64FLAGS = $(TEMPLATE_VBoxBS3KitImg64_CFLAGS)
675TEMPLATE_VBoxBS3KitImg_C64DEFS = ARCH_BITS=64 RT_ARCH_AMD64
676
677TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) .
678TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL
679
680# linker options:
681# system dos: Link a 16-bit DOS binary.
682# output raw ...: Produce a raw DOS binary for loading at flat address 10000h.
683# The following is for ordering segments.
684# option start=_start: The start symbol in bs3-first-xxx.asm.
685# debug codeview/dwarf all: Full debug information either in codeview or dwarf.
686# option symfile: Produce a separate symbol file with the debug info.
687# option map: Produce a map file.
688# option farcalls: Change intrasegment far calls into 'push cs; seg ds; call symbol' where possible.
689# option statics: ?
690# option verbose: Verbose map file?
691# option disable 1014: Disable warning about 'stack segment not found'.
692# option disable 1080: Disable warning about '%1 is a 32-bit object file'.
693#
694# Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink
695# to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e.
696# real-mode address on the form 0fff8:0000.
697TEMPLATE_VBoxBS3KitImg_LDFLAGS = system dos \
698 debug $(BS3_OW_DBG_LDOPT) all \
699 option quiet, map, statics, verbose, symfile, start=_start, farcalls \
700 disable 1014, 1080 \
701 \
702 output raw offset=0x10000 \
703 order \
704 clname BS3FLAT segaddr=0x0000 \
705 segment BS3FLAT segaddr=0x0000 \
706 clname $(BS3KIT_CLASS_CODE16) segaddr=0x1000 \
707 segment BS3TEXT16 \
708 segment BS3TEXT16_NEARSTUBS \
709 segment BS3TEXT16_FARSTUBS \
710 segment BS3TEXT16_END \
711 clname BS3SYSTEM16 segaddr=0x2000 \
712 segment BS3SYSTEM16 \
713 $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
714 clname DATA \
715 segment BS3DATA16 segaddr=0x2900 \
716 segment BS3DATA16_DATA \
717 segment DATA \
718 segment _DATA \
719 segment BS3DATA16CONST \
720 segment CONST \
721 segment BS3DATA16CONST2 \
722 segment CONST2 \
723 segment STRINGS \
724 segment BS3DATA16_END \
725 clname BSS \
726 segment BSS \
727 segment _BSS \
728 segment BS3DATA16_END \
729 clname FAR_DATA \
730 segment FAR_DATA \
731 , \
732 clname FAR_DATA \
733 segment BS3DATA16 segaddr=0x2900 \
734 segment FAR_DATA \
735 segment BS3DATA16CONST \
736 segment BS3DATA16CONST2 \
737 segment BS3DATA16_DATA \
738 segment BS3DATA16_END \
739 ) \
740 segment BS3DATA32 \
741 segment BS3DATA32CONST \
742 segment BS3DATA32CONST2 \
743 segment BS3DATA32_DATA \
744 segment BS3DATA32_BSS \
745 segment BS3DATA32_END \
746 \
747 segment BS3DATA64 \
748 segment BS3DATA64CONST \
749 segment BS3DATA64_BSS \
750 segment BS3DATA64_END \
751 clname BS3CLASS16RMCODE \
752 segment BS3RMTEXT16_START \
753 segment BS3RMTEXT16 \
754 segment BS3RMTEXT16_END \
755 clname BS3CLASS16X0CODE \
756 segment BS3X0TEXT16_START \
757 segment BS3X0TEXT16 \
758 segment BS3X0TEXT16_END \
759 clname BS3CLASS16X1CODE \
760 segment BS3X1TEXT16_START \
761 segment BS3X1TEXT16 \
762 segment BS3X1TEXT16_END \
763 clname BS3CLASSSEPARATE16AND32BITCODE \
764 segment BS3SEPARATE16AND32BITCODE \
765 clname BS3CLASS32CODE \
766 segment BS3TEXT32_START \
767 segment BS3TEXT32 \
768 segment BS3TEXT32_END \
769 clname BS3CLASSSEPARATE32AND64BITCODE \
770 segment BS3SEPARATE32AND64BITCODE \
771 clname BS3CLASS64CODE \
772 segment BS3TEXT64_START \
773 segment BS3TEXT64 \
774 segment BS3TEXT64_END \
775 clname BS3HIGHDLLCLASS \
776 segment BS3HIGHDLLEXPORTS \
777 segment BS3HIGHDLLIMPORTS \
778 segment BS3HIGHDLLSTRINGS \
779 segment BS3HIGHDLLTABLE \
780 segment BS3HIGHDLLTABLE_END
781
782TEMPLATE_VBoxBS3KitImg_LNK_DEPS = \
783 $(bs3-bootsector_1_TARGET) \
784 $(VBoxBs3Linker_1_TARGET)
785TEMPLATE_VBoxBS3KitImg_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY) \
786 ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
787 $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp $($(target)_2_VBOX_BS3KIT_HIGH_DLLS) \
788 $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp") \
789 $(eval .PRECIOUS: $(outbase).map) # ugly hack!
790
791TEMPLATE_VBoxBS3KitImg_LIBS = \
792 $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16.lib \
793 $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \
794 $(PATH_OBJ)/bs3kit-common-64/bs3kit-common-64.lib \
795 \
796 $(PATH_OBJ)/bs3kit-rm/bs3kit-rm.lib \
797 $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16.lib \
798 $(PATH_OBJ)/bs3kit-pe16_32/bs3kit-pe16_32.lib \
799 $(PATH_OBJ)/bs3kit-pe16_v86/bs3kit-pe16_v86.lib \
800 $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32.lib \
801 $(PATH_OBJ)/bs3kit-pe32_16/bs3kit-pe32_16.lib \
802 $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86.lib \
803 $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16.lib \
804 $(PATH_OBJ)/bs3kit-pp16_32/bs3kit-pp16_32.lib \
805 $(PATH_OBJ)/bs3kit-pp16_v86/bs3kit-pp16_v86.lib \
806 $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32.lib \
807 $(PATH_OBJ)/bs3kit-pp32_16/bs3kit-pp32_16.lib \
808 $(PATH_OBJ)/bs3kit-ppv86/bs3kit-ppv86.lib \
809 $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16.lib \
810 $(PATH_OBJ)/bs3kit-pae16_32/bs3kit-pae16_32.lib \
811 $(PATH_OBJ)/bs3kit-pae16_v86/bs3kit-pae16_v86.lib \
812 $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32.lib \
813 $(PATH_OBJ)/bs3kit-pae32_16/bs3kit-pae32_16.lib \
814 $(PATH_OBJ)/bs3kit-paev86/bs3kit-paev86.lib \
815 $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16.lib \
816 $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32.lib \
817 $(PATH_OBJ)/bs3kit-lm64/bs3kit-lm64.lib
818
819# Variant of VBoxBS3KitImg that's for images needing large 32-bit and 64-bit
820# code segments.
821TEMPLATE_VBoxBS3KitImgBig = Template for building BS3Kit test images with high 32-bit & 64-bit code
822TEMPLATE_VBoxBS3KitImgBig_EXTENDS = VBoxBS3KitImg
823TEMPLATE_VBoxBS3KitImgBig_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_BIG_IMAGE BS3_TEXT32_ABOVE_1M BS3_TEXT64_ABOVE_1M
824#TEMPLATE_VBoxBS3KitImgBig_LDFLAGS = \
825# $(subst BS3CLASS32CODE, BS3CLASS32CODE segaddr=0xa000$(SP), $(TEMPLATE_VBoxBS3KitImg_LDFLAGS))
826#TEMPLATE_VBoxBS3KitImgBig_POST_CMDS = $(NO_SUCH_VARIABLE)
827
828TEMPLATE_VBoxBS3KitImgBig_LNK_DEPS = \
829 $(bs3-bootsector-63MB_1_TARGET) \
830 $(VBoxBs3Linker_1_TARGET)
831TEMPLATE_VBoxBS3KitImgBig_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY) \
832 ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
833 $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector-63MB_1_TARGET) $(out).tmp $($(target)_2_VBOX_BS3KIT_HIGH_DLLS) \
834 $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp") \
835 $(eval .PRECIOUS: $(outbase).map) # ugly hack!
836
837
838# BS3Kit template for a high image.
839TEMPLATE_VBoxBS3KitHighImg = Template for building BS3Kit test images, the high DLL.
840TEMPLATE_VBoxBS3KitHighImg_EXTENDS := VBoxBS3KitImg
841TEMPLATE_VBoxBS3KitHighImg_INSTTYPE := none
842TEMPLATE_VBoxBS3KitHighImg_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_IS_HIGH_IMAGE
843TEMPLATE_VBoxBS3KitHighImg_ASFLAGS = $(filter-out -g,$(TEMPLATE_VBoxBS3KitImg_ASFLAGS)) # trouble with bs3-cpu-basic-3, nasm produce garbage comment/something.
844TEMPLATE_VBoxBS3KitHighImg_BINSUFF := .high-dll
845TEMPLATE_VBoxBS3KitHighImg_LDTOOL := OPENWATCOM-WL
846TEMPLATE_VBoxBS3KitHighImg_LDFLAGS := system os2v2 flat dll \
847 \
848 segment BS3TEXT16 executeread \
849 segment BS3TEXT16_NEARSTUBS executeread \
850 segment BS3TEXT16_FARSTUBS executeread \
851 segment BS3TEXT16_END executeread \
852 \
853 $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
854 segment BS3DATA16 readwrite \
855 segment BS3DATA16_DATA readwrite \
856 segment DATA readwrite \
857 segment _DATA readwrite \
858 segment BS3DATA16CONST readwrite \
859 segment CONST readwrite \
860 segment BS3DATA16CONST2 readwrite \
861 segment CONST2 readwrite \
862 segment STRINGS readwrite \
863 segment BSS readwrite \
864 segment _BSS readwrite \
865 segment BS3DATA16_END readwrite \
866 , \
867 segment BS3DATA16 readwrite \
868 segment BS3DATA16CONST readwrite \
869 segment BS3DATA16CONST2 readwrite \
870 segment BS3DATA16_DATA readwrite \
871 segment BS3DATA16_END readwrite \
872 ) \
873 \
874 segment BS3TEXT32 executeonly \
875 segment BS3TEXT32_END executeonly \
876 \
877 segment BS3DATA32 readwrite \
878 segment BS3DATA32CONST readwrite \
879 segment BS3DATA32CONST2 readwrite \
880 segment BS3DATA32_DATA readwrite \
881 segment BS3DATA32_BSS readwrite \
882 segment BS3DATA32_END readwrite \
883 \
884 segment BS3TEXT64 executeread \
885 segment BS3TEXT64_END executeread \
886 \
887 segment BS3DATA64 readwrite \
888 segment BS3DATA64CONST readwrite \
889 segment BS3DATA64_BSS readwrite \
890 segment BS3DATA64_END readwrite \
891 \
892 debug $(BS3_OW_DBG_LDOPT) all \
893 \
894 option quiet, map, statics, verbose, symfile, objalign=4096, offset=0x800000 \
895 disable 1014, 1080
896
897TEMPLATE_VBoxBS3KitHighImg_LIBS = \
898 $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16-implib.lib \
899 $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32-implib.lib \
900 $(PATH_OBJ)/bs3kit-common-64/bs3kit-common-64-implib.lib \
901 \
902 $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16-implib.lib \
903 $(PATH_OBJ)/bs3kit-pe16_32/bs3kit-pe16_32-implib.lib \
904 $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32-implib.lib \
905 $(PATH_OBJ)/bs3kit-pe32_16/bs3kit-pe32_16-implib.lib \
906 $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86-implib.lib \
907 $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16-implib.lib \
908 $(PATH_OBJ)/bs3kit-pp16_32/bs3kit-pp16_32-implib.lib \
909 $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32-implib.lib \
910 $(PATH_OBJ)/bs3kit-pp32_16/bs3kit-pp32_16-implib.lib \
911 $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16-implib.lib \
912 $(PATH_OBJ)/bs3kit-pae16_32/bs3kit-pae16_32-implib.lib \
913 $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32-implib.lib \
914 $(PATH_OBJ)/bs3kit-pae32_16/bs3kit-pae32_16-implib.lib \
915 $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16-implib.lib \
916 $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32-implib.lib \
917 $(PATH_OBJ)/bs3kit-lm64/bs3kit-lm64-implib.lib
918
919TEMPLATE_VBoxBS3KitHighImg_POST_CMDS = $(NO_SUCH_VARIABLE)
920
921# BS3Kit template for 32-bit code.
922TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
923TEMPLATE_VBoxBS3KitImg32_BLD_TRG = os-agnostic
924TEMPLATE_VBoxBS3KitImg32_BLD_TRG_ARCH = x86
925TEMPLATE_VBoxBS3KitImg32_INSTTYPE = none
926TEMPLATE_VBoxBS3KitImg32_ASTOOL = VBoxNasm
927TEMPLATE_VBoxBS3KitImg32_ASOBJSUFF = .o32
928TEMPLATE_VBoxBS3KitImg32_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
929TEMPLATE_VBoxBS3KitImg32_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__ \
930 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
931 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
932TEMPLATE_VBoxBS3KitImg32_DEFS = ARCH_BITS=32 IN_BS3KIT IPRT_NO_CRT
933TEMPLATE_VBoxBS3KitImg32_DEFS.debug = BS3_STRICT
934TEMPLATE_VBoxBS3KitImg32_ARTOOL = Bs3Ow16
935TEMPLATE_VBoxBS3KitImg32_CTOOL = Bs3Ow32
936TEMPLATE_VBoxBS3KitImg32_CXXTOOL = Bs3Ow32
937TEMPLATE_VBoxBS3KitImg32_CFLAGS = \
938 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CLASS32CODE -ecc -q -e125 -wx -zl -mf $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
939TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = \
940 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CLASS32CODE -ecc -q -e125 -wx -zl -mf $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
941TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) .
942TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd
943
944# BS3Kit template for 64-bit code.
945TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
946TEMPLATE_VBoxBS3KitImg64_BLD_TRG = os-agnostic
947TEMPLATE_VBoxBS3KitImg64_BLD_TRG_ARCH = amd64
948TEMPLATE_VBoxBS3KitImg64_INSTTYPE = none
949TEMPLATE_VBoxBS3KitImg64_ASTOOL = VBoxNasm
950TEMPLATE_VBoxBS3KitImg64_ASOBJSUFF = .o64
951TEMPLATE_VBoxBS3KitImg64_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
952TEMPLATE_VBoxBS3KitImg64_ASDEFS = ASM_FORMAT_OMF ASM_CALL64_MSC RT_NOINC_SEGMENTS __NASM__ \
953 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
954 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
955TEMPLATE_VBoxBS3KitImg64_DEFS = IN_BS3KIT ARCH_BITS=64 IPRT_NO_CRT
956TEMPLATE_VBoxBS3KitImg64_DEFS.debug = BS3_STRICT
957TEMPLATE_VBoxBS3KitImg64_ARTOOL = Bs3Ow16
958TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) .
959if1of ($(KBUILD_HOST), win)
960 ifndef TOOL_VCC100AMD64 # For win.x86 builds.
961 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL_STEM)AMD64.kmk
962 endif
963 TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Vcc64
964 TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Vcc64
965 TEMPLATE_VBoxBS3KitImg64_CFLAGS = -Z7 -O1 -Oi -GF -GS- -Gy- -Gs65536
966 TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -Z7 -O1 -Oi -GF -GS- -Gy- -Gs65536
967else
968 TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Gcc64Elf64
969 TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Gcc64Elf64
970 # Note! -mx32 would be exactly what we needed here, however it causes internal compiler errors with 4.8.4 on gentoo.
971 TEMPLATE_VBoxBS3KitImg64_CFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_C) \
972 -msoft-float -fno-exceptions -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
973 TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_CXX) \
974 -msoft-float -fno-exceptions -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
975endif
976TEMPLATE_VBoxBS3KitImg64_LDTOOL = VBoxBsUnusedLd
977
978# BS3Kit template for the bootsector.
979TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
980TEMPLATE_VBoxBS3KitBS_BLD_TRG = os-agnostic
981TEMPLATE_VBoxBS3KitBS_BLD_TRG_ARCH = x86
982TEMPLATE_VBoxBS3KitBS_INST = $(INST_VALIDATIONKIT)bootsectors/
983TEMPLATE_VBoxBS3KitBS_INSTTYPE = none
984TEMPLATE_VBoxBS3KitBS_BINSUFF = .img
985TEMPLATE_VBoxBS3KitBS_MODE = 0644
986TEMPLATE_VBoxBS3KitBS_ASTOOL = YASM
987TEMPLATE_VBoxBS3KitBS_ASFLAGS = -f bin --mapfile
988TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__ \
989 BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
990 BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
991TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) .
992TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd
993
994
995
996#
997# Extends VBoxBS3KitImg
998# User must starts SOURCES with: $(VBOX_PATH_BS3KIT_SRC)/bs3-first-dosexe.asm
999## disable 1014, 1080, 1150
1000#
1001TEMPLATE_VBoxBS3KitUtil = Utility using bs3kit code.
1002TEMPLATE_VBoxBS3KitUtil_EXTENDS = VBoxBS3KitImg
1003TEMPLATE_VBoxBS3KitUtil_BINSUFF = .exe
1004TEMPLATE_VBoxBS3KitUtil_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_IS_DOS_EXE
1005TEMPLATE_VBoxBS3KitUtil_CFLAGS = $(filter-out -zl,$(TEMPLATE_VBoxBS3KitImg_CFLAGS))
1006TEMPLATE_VBoxBS3KitUtil_CXXFLAGS = $(filter-out -zl,$(TEMPLATE_VBoxBS3KitImg_CXXFLAGS))
1007TEMPLATE_VBoxBS3KitUtil_LDFLAGS = system dos \
1008 debug $(BS3_OW_DBG_LDOPT) all \
1009 option quiet, map, statics, verbose, symfile \
1010 disable 1080 \
1011 order \
1012 clname $(BS3KIT_CLASS_CODE16) \
1013 segment BEGTEXT \
1014 segment BS3TEXT16 \
1015 segment _TEXT \
1016 segment BS3TEXT16_NEARSTUBS \
1017 segment BS3TEXT16_FARSTUBS \
1018 segment BS3TEXT16_END \
1019 clname BS3SYSTEM16 \
1020 segment BS3SYSTEM16 \
1021 \
1022 clname BEGDATA \
1023 segment _NULL \
1024 segment _AFTERNULL \
1025 clname DATA \
1026 $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
1027 segment BS3DATA16 \
1028 segment BS3DATA16CONST \
1029 segment CONST \
1030 segment BS3DATA16CONST2 \
1031 segment CONST2 \
1032 , \
1033 segment CONST \
1034 segment CONST2 \
1035 ) \
1036 segment _DATA \
1037 segment XIB \
1038 segment XI \
1039 segment XIE \
1040 segment YIB \
1041 segment YI \
1042 segment YIE \
1043 segment STRINGS \
1044 $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
1045 segment BS3DATA16_DATA \
1046 ,) \
1047 segment DATA \
1048 clname BSS \
1049 segment _BSS \
1050 segment BSS \
1051 segment BS3DATA16_END \
1052 clname STACK \
1053 segment STACK \
1054 \
1055 clname FAR_DATA \
1056 $(if-expr "$(BS3KIT_SEGNM_DATA16)" != "", \
1057 segment BS3DATA16 \
1058 segment BS3DATA16_DATA \
1059 segment BS3DATA16CONST \
1060 segment BS3DATA16CONST2 \
1061 segment FAR_DATA \
1062 segment BS3DATA16_END \
1063 , \
1064 segment FAR_DATA \
1065 ) \
1066 segment BS3DATA32 \
1067 segment BS3DATA32CONST \
1068 segment BS3DATA32CONST2 \
1069 segment BS3DATA32_DATA \
1070 segment BS3DATA32_BSS \
1071 segment BS3DATA32_END \
1072 \
1073 segment BS3DATA64 \
1074 segment BS3DATA64CONST \
1075 segment BS3DATA64_BSS \
1076 segment BS3DATA64_END \
1077 clname BS3CLASS16RMCODE \
1078 segment BS3RMTEXT16_START \
1079 segment BS3RMTEXT16 \
1080 segment BS3RMTEXT16_END \
1081 clname BS3CLASS16X0CODE \
1082 segment BS3X0TEXT16_START \
1083 segment BS3X0TEXT16 \
1084 segment BS3X0TEXT16_END \
1085 clname BS3CLASS16X1CODE \
1086 segment BS3X1TEXT16_START \
1087 segment BS3X1TEXT16 \
1088 segment BS3X1TEXT16_END \
1089 clname BS3CLASSSEPARATE16AND32BITCODE \
1090 segment BS3SEPARATE16AND32BITCODE \
1091 clname BS3CLASS32CODE \
1092 segment BS3TEXT32 \
1093 segment BS3TEXT32_END \
1094 clname BS3CLASSSEPARATE32AND64BITCODE \
1095 segment BS3SEPARATE32AND64BITCODE \
1096 clname BS3CLASS64CODE \
1097 segment BS3TEXT64 \
1098 segment BS3TEXT64_END
1099# clname BS3FLAT segaddr=0x0000 \
1100# segment BS3FLAT segaddr=0x0000
1101
1102TEMPLATE_VBoxBS3KitUtil_LNK_DEPS = $(NO_SUCH_VARIABLE)
1103TEMPLATE_VBoxBS3KitUtil_POST_CMDS = $(NO_SUCH_VARIABLE)
1104
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette