VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk@ 100714

Last change on this file since 100714 was 98418, checked in by vboxsync, 22 months ago

ValKit/*.kmk: Automatic scm cleanups. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 26.2 KB
Line 
1# $Id: Makefile.kmk 98418 2023-02-01 21:29:03Z vboxsync $
2## @file
3# VirtualBox Validation Kit - Bootsector Kit v3
4#
5
6#
7# Copyright (C) 2006-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
37SUB_DEPTH = ../../../../..
38include $(KBUILD_PATH)/subheader.kmk
39
40
41
42# Boot Sector post-link tool (used via the parent Config.kmk).
43BLDPROGS += VBoxBs3Linker
44VBoxBs3Linker_TEMPLATE = VBoxBldProg
45VBoxBs3Linker_SOURCES = $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3Linker.cpp
46
47
48# 64-bit relocation conversion tool (used via the parent Config.kmk).
49BLDPROGS += VBoxBs3ObjConverter
50VBoxBs3ObjConverter_TEMPLATE = VBoxBldProg
51VBoxBs3ObjConverter_DEFS = BS3KIT_BS3CLASS16CODE=$(BS3KIT_BS3CLASS16CODE) IN_RT_R3
52VBoxBs3ObjConverter_SOURCES = \
53 $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3ObjConverter.cpp \
54 $(PATH_ROOT)/src/VBox/Runtime/common/sort/shellsort.cpp
55
56
57# The boot sector.
58MISCBINS += bs3-bootsector
59bs3-bootsector_TEMPLATE = VBoxBS3KitBS
60bs3-bootsector_SOURCES = bs3-bootsector.asm
61
62
63#
64# Common sources to be compiled into _p16, _p32 and _p64 versions.
65#
66VBOX_BS3KIT_COMMON_SOURCES = \
67 bs3-cmn-A20Disable.asm \
68 bs3-cmn-A20Enable.asm \
69 bs3-cmn-GetCpuVendor.c \
70 bs3-cmn-GetModeName.c \
71 bs3-cmn-GetModeNameShortLower.c \
72 bs3-cmn-KbdRead.asm \
73 bs3-cmn-KbdWait.asm \
74 bs3-cmn-KbdWrite.asm \
75 bs3-cmn-Shutdown.asm \
76 bs3-cmn-Panic.asm \
77 bs3-cmn-PrintChr.asm \
78 bs3-cmn-Printf.c \
79 bs3-cmn-PrintU32.asm \
80 bs3-cmn-PrintX32.asm \
81 bs3-cmn-PrintStr.c \
82 bs3-cmn-PrintStrN.asm \
83 bs3-cmn-StrFormatV.c \
84 bs3-cmn-StrPrintf.c \
85 bs3-cmn-StrLen.c \
86 bs3-cmn-StrNLen.c \
87 bs3-cmn-StrCpy.c \
88 bs3-cmn-MemChr.asm \
89 bs3-cmn-MemCmp.asm \
90 bs3-cmn-MemCpy.c \
91 bs3-cmn-MemPCpy.c \
92 bs3-cmn-MemMove.c \
93 bs3-cmn-MemSet.asm \
94 bs3-cmn-MemZero.asm \
95 bs3-cmn-MemAlloc.c \
96 bs3-cmn-MemAllocZ.c \
97 bs3-cmn-MemFree.c \
98 bs3-cmn-MemGuardedTestPage.c \
99 bs3-cmn-MemPrintInfo.c \
100 bs3-cmn-PagingData.c \
101 bs3-cmn-PagingInitRootForPP.c \
102 bs3-cmn-PagingInitRootForPAE.c \
103 bs3-cmn-PagingInitRootForLM.c \
104 bs3-cmn-PagingAlias.c \
105 bs3-cmn-PagingProtect.c \
106 bs3-cmn-PagingQueryAddressInfo.c \
107 bs3-cmn-PagingSetupCanonicalTraps.c \
108 bs3-cmn-pic-data.c \
109 bs3-cmn-PicMaskAll.c \
110 bs3-cmn-PicUpdateMask.c \
111 bs3-cmn-PicSetup.c \
112 bs3-cmn-pit.c \
113 bs3-cmn-PitIrqHandler.c \
114 bs3-cmn-RegCtxRestore.asm \
115 bs3-cmn-RegCtxConvertToRingX.c \
116 bs3-cmn-RegCtxConvertV86ToRm.c \
117 bs3-cmn-RegCtxPrint.c \
118 bs3-cmn-RegCtxGetRspSsAsCurPtr.c \
119 bs3-cmn-RegCtxSave.asm \
120 bs3-cmn-RegCtxSaveEx.asm \
121 bs3-cmn-RegCtxSaveForMode.c \
122 bs3-cmn-RegCtxSetGrpSegFromCurPtr.c \
123 bs3-cmn-RegCtxSetGrpSegFromFlat.c \
124 bs3-cmn-RegCtxSetRipCsFromCurPtr.c \
125 bs3-cmn-RegCtxSetRipCsFromFlat.c \
126 bs3-cmn-RegCtxSetRipCsFromLnkPtr.c \
127 bs3-cmn-RegCtxSetGpr.c \
128 bs3-cmn-RegGetCr0.asm \
129 bs3-cmn-RegGetCr2.asm \
130 bs3-cmn-RegGetCr3.asm \
131 bs3-cmn-RegGetCr4.asm \
132 bs3-cmn-RegSetCr0.asm \
133 bs3-cmn-RegSetCr2.asm \
134 bs3-cmn-RegSetCr3.asm \
135 bs3-cmn-RegSetCr4.asm \
136 bs3-cmn-RegGetDr0.asm \
137 bs3-cmn-RegGetDr1.asm \
138 bs3-cmn-RegGetDr2.asm \
139 bs3-cmn-RegGetDr3.asm \
140 bs3-cmn-RegGetDr6.asm \
141 bs3-cmn-RegGetDr7.asm \
142 bs3-cmn-RegGetDrX.asm \
143 bs3-cmn-RegSetDr0.asm \
144 bs3-cmn-RegSetDr1.asm \
145 bs3-cmn-RegSetDr2.asm \
146 bs3-cmn-RegSetDr3.asm \
147 bs3-cmn-RegSetDr6.asm \
148 bs3-cmn-RegSetDr7.asm \
149 bs3-cmn-RegSetDrX.asm \
150 bs3-cmn-RegGetTr.asm \
151 bs3-cmn-RegSetTr.asm \
152 bs3-cmn-RegGetLdtr.asm \
153 bs3-cmn-RegSetLdtr.asm \
154 bs3-cmn-RegGetXcr0.asm \
155 bs3-cmn-RegSetXcr0.asm \
156 bs3-cmn-ExtCtxInit.c \
157 bs3-cmn-ExtCtxSave.asm \
158 bs3-cmn-ExtCtxSaveEx.asm \
159 bs3-cmn-ExtCtxRestore.asm \
160 bs3-cmn-ExtCtxRestoreEx.asm \
161 bs3-cmn-ExtCtxGetSize.c \
162 bs3-cmn-ExtCtxAlloc.c \
163 bs3-cmn-ExtCtxFree.c \
164 bs3-cmn-ExtCtxCopy.c \
165 bs3-cmn-ExtCtxGetFcw.c \
166 bs3-cmn-ExtCtxSetFcw.c \
167 bs3-cmn-ExtCtxGetFsw.c \
168 bs3-cmn-ExtCtxSetFsw.c \
169 bs3-cmn-ExtCtxGetAbridgedFtw.c \
170 bs3-cmn-ExtCtxSetAbridgedFtw.c \
171 bs3-cmn-ExtCtxGetMxCsr.c \
172 bs3-cmn-ExtCtxSetMxCsr.c \
173 bs3-cmn-ExtCtxGetMxCsrMask.c \
174 bs3-cmn-ExtCtxSetMxCsrMask.c \
175 bs3-cmn-ExtCtxGetMm.c \
176 bs3-cmn-ExtCtxSetMm.c \
177 bs3-cmn-ExtCtxGetXmm.c \
178 bs3-cmn-ExtCtxSetXmm.c \
179 bs3-cmn-ExtCtxGetYmm.c \
180 bs3-cmn-ExtCtxSetYmm.c \
181 bs3-cmn-SelFar32ToFlat32.c \
182 bs3-cmn-SelFar32ToFlat32NoClobber.asm \
183 bs3-cmn-SelProtFar32ToFlat32.c \
184 bs3-cmn-SelProtModeCodeToRealMode.asm \
185 bs3-cmn-SelRealModeCodeToProtMode.asm \
186 bs3-cmn-SelFlatCodeToRealMode.asm \
187 bs3-cmn-SelFlatCodeToProtFar16.asm \
188 bs3-cmn-SelRealModeDataToProtFar16.asm \
189 bs3-cmn-SelProtFar16DataToRealMode.asm \
190 bs3-cmn-SelRealModeDataToFlat.asm \
191 bs3-cmn-SelProtFar16DataToFlat.asm \
192 bs3-cmn-SelFlatDataToProtFar16.asm \
193 bs3-cmn-SelFlatDataToRealMode.asm \
194 bs3-cmn-SelLnkPtrToCurPtr.c \
195 bs3-cmn-SelLnkPtrToFlat.c \
196 bs3-cmn-SelSetup16BitData.c \
197 bs3-cmn-SelSetup16BitCode.c \
198 bs3-cmn-SelSetup32BitCode.c \
199 bs3-cmn-SelSetupGate.c \
200 bs3-cmn-SelSetupGate64.c \
201 bs3-cmn-SlabInit.c \
202 bs3-cmn-SlabAlloc.c \
203 bs3-cmn-SlabAllocEx.c \
204 bs3-cmn-SlabFree.c \
205 bs3-cmn-SlabListInit.c \
206 bs3-cmn-SlabListAdd.c \
207 bs3-cmn-SlabListAlloc.c \
208 bs3-cmn-SlabListAllocEx.c \
209 bs3-cmn-SlabListFree.c \
210 bs3-cmn-SwitchHlpConvRealModeRetfPopBpDecBpAndReturn.asm \
211 bs3-cmn-SwitchHlpConvProtModeRetfPopBpDecBpAndReturn.asm \
212 bs3-cmn-SwitchToRing0.asm \
213 bs3-cmn-SwitchToRing1.asm \
214 bs3-cmn-SwitchToRing2.asm \
215 bs3-cmn-SwitchToRing3.asm \
216 bs3-cmn-SwitchToRingX.asm \
217 bs3-cmn-SwitchTo16Bit.asm \
218 bs3-cmn-SwitchTo16BitV86.asm \
219 bs3-cmn-SwitchTo32Bit.asm \
220 bs3-cmn-SwitchTo64Bit.asm \
221 bs3-cmn-Syscall.asm \
222 bs3-cmn-TestData.c \
223 bs3-cmn-TestInit.c \
224 bs3-cmn-TestFailed.c \
225 bs3-cmn-TestNow.asm \
226 bs3-cmn-TestSkipped.c \
227 bs3-cmn-TestSub.c \
228 bs3-cmn-TestSubDone.c \
229 bs3-cmn-TestSubErrorCount.c \
230 bs3-cmn-TestTerm.c \
231 bs3-cmn-TestSendCmdWithStr.asm \
232 bs3-cmn-TestSendCmdWithU32.asm \
233 bs3-cmn-TestIsVmmDevTestingPresent.asm \
234 bs3-cmn-TestCheckRegCtxEx.c \
235 bs3-cmn-TestCheckExtCtx.c \
236 bs3-cmn-TestQueryCfgU8.asm \
237 bs3-cmn-TestQueryCfgU32.asm \
238 bs3-cmn-TestHostPrintf.c \
239 bs3-cmn-TestPrintf.c \
240 bs3-cmn-TestValue.c \
241 bs3-cmn-TrapReInit.c \
242 bs3-cmn-TrapRmV86Init.c \
243 bs3-cmn-TrapRmV86SetGate.c \
244 bs3-cmn-Trap16Init.c \
245 bs3-cmn-Trap16SetGate.c \
246 bs3-cmn-Trap32Init.c \
247 bs3-cmn-Trap32SetGate.c \
248 bs3-cmn-Trap64Init.c \
249 bs3-cmn-Trap64SetGate.c \
250 bs3-cmn-TrapSetDpl.c \
251 bs3-cmn-TrapDefaultHandler.c \
252 bs3-cmn-TrapHandlersData.asm \
253 bs3-cmn-TrapPrintFrame.c \
254 bs3-cmn-TrapSetHandler.c \
255 bs3-cmn-TrapSetHandlerEx.c \
256 bs3-cmn-TrapSetJmp.asm \
257 bs3-cmn-TrapSetJmpAndRestore.c \
258 bs3-cmn-TrapSetJmpAndRestoreInRm.c \
259 bs3-cmn-TrapSetJmpAndRestoreWithRm.c \
260 bs3-cmn-TrapSetJmpAndRestoreWithExtCtx.c \
261 bs3-cmn-TrapSetJmpAndRestoreWithExtCtxAndRm.c \
262 bs3-cmn-TrapUnsetJmp.c \
263 bs3-cmn-UtilSetFullGdtr.asm \
264 bs3-cmn-UtilSetFullIdtr.asm \
265 bs3-cmn-TestDoModesByOneHlp.asm \
266 ../../../Runtime/common/asm/ASMBitFirstClear.asm \
267 ../../../Runtime/common/asm/ASMBitFirstSet.asm \
268 ../../../Runtime/common/asm/ASMBitNextClear.asm \
269 ../../../Runtime/common/asm/ASMBitNextSet.asm \
270 ../../../Runtime/common/asm/ASMBitFirstSetU16.asm \
271 ../../../Runtime/common/asm/ASMBitFirstSetU32.asm \
272 ../../../Runtime/common/asm/ASMBitFirstSetU64.asm \
273 ../../../Runtime/common/asm/ASMBitLastSetU16.asm \
274 ../../../Runtime/common/asm/ASMBitLastSetU32.asm \
275 ../../../Runtime/common/asm/ASMBitLastSetU64.asm \
276 ../../../Runtime/common/asm/ASMMemFirstMismatchingU8.asm \
277 ../../../Runtime/common/asm/ASMSerializeInstruction-cpuid.asm \
278 ../../../Runtime/common/asm/ASMSerializeInstruction-iret.asm \
279 ../../../Runtime/common/asm/ASMSerializeInstruction-rdtscp.asm \
280 ../../../Runtime/common/asm/ASMCpuIdExSlow.asm \
281 ../../../Runtime/common/asm/ASMCpuId.asm \
282 ../../../Runtime/common/asm/ASMCpuId_Idx_ECX.asm \
283 ../../../Runtime/common/asm/ASMWrMsr.asm \
284 ../../../Runtime/common/asm/ASMGetXcr0.asm \
285 ../../../Runtime/common/asm/ASMSetXcr0.asm \
286 ../../../Runtime/common/asm/ASMSetFlags.asm \
287 ../../../Runtime/common/asm/ASMGetFlags.asm \
288 ../../../Runtime/common/asm/ASMMultU64ByU32DivByU32.asm
289
290# The 16-bit BS3Kit library.
291LIBRARIES += bs3kit-common-16
292bs3kit-common-16_TEMPLATE = VBoxBS3KitImg
293bs3kit-common-16_INSTTYPE = none
294bs3kit-common-16_DEFS = TMPL_PE16 BS3_CMN_ONLY
295bs3kit-common-16_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
296bs3kit-common-16_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
297 bs3-system-data.asm \
298 bs3-rm-InitAll.c \
299 bs3-rm-InitMemory.c \
300 bs3-rm-InitGdt.c \
301 bs3-cmn-hexdigits.c \
302 bs3-cmn-CpuDetectData.c \
303 bs3-cmn-PerCpuData.c \
304 bs3-cmn-ConvertRMStackToP16UsingCxReturnToAx.asm \
305 bs3-cmn-UInt64Div.c \
306 bs3-cmn-UInt32Div.c \
307 bs3-wc16-U8DR.asm \
308 bs3-wc16-U8DQ.asm \
309 bs3-wc16-I8DR.asm \
310 bs3-wc16-I8DQ.asm \
311 bs3-wc16-I8RS.asm \
312 bs3-wc16-U8RS.asm \
313 bs3-wc16-U8LS.asm \
314 bs3-wc16-U4D.asm \
315 bs3-wc16-I4D.asm \
316 bs3-c16-SwitchFromV86To16BitAndCallC.asm \
317 bs3-c16-Trap16Generic.asm \
318 bs3-c16-TrapRmV86Generic.asm \
319 bs3-c16-TrapRmV86Data.c \
320 bs3-c16-CreateHybridFarRet.asm
321bs3kit-common-16_bs3-cmn-UInt64Div.c_CFLAGS = -oh -d0 # -d1+ vs -d0 saves 0x6a3-0x577 = 0x12C (300)!
322
323$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstMismatchingU8,8)
324$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstNonZero,6)
325$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMCpuIdExSlow,32)
326$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMCpuId,20)
327$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMWrMsr,12)
328$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMSetXcr0,8)
329$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMGetXcr0,0)
330-include $(PATH_SUB_CURRENT)/bs3kit-autostubs.kmk # manually generated from headers, see bottom of this file.
331
332# The 32-bit BS3Kit library.
333LIBRARIES += bs3kit-common-32
334bs3kit-common-32_TEMPLATE = VBoxBS3KitImg32
335bs3kit-common-32_INSTTYPE = none
336bs3kit-common-32_DEFS = TMPL_PE32 BS3_CMN_ONLY
337bs3kit-common-32_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
338bs3kit-common-32_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
339 bs3-cmn-PagingMapRamAbove4GForLM.c \
340 bs3-cmn-SwitchHlpConvFlatRetToRetfProtMode.asm \
341 bs3-cmn-UInt64Div.c \
342 bs3-wc32-U8D.asm \
343 bs3-wc32-I8D.asm \
344 bs3-wc32-I8RS.asm \
345 bs3-wc32-U8RS.asm \
346 bs3-wc32-U8LS.asm \
347 bs3-wc32-U8M.asm \
348 bs3-c32-Trap32Generic.asm
349
350# The 64-bit BS3Kit library.
351LIBRARIES += bs3kit-common-64
352bs3kit-common-64_TEMPLATE = VBoxBS3KitImg64
353bs3kit-common-64_INSTTYPE = none
354bs3kit-common-64_DEFS = TMPL_LM64 BS3_CMN_ONLY
355bs3kit-common-64_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
356bs3kit-common-64_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
357 bs3-cmn-PagingMapRamAbove4GForLM.c \
358 bs3-cmn-SwitchHlpConvFlatRetToRetfProtMode.asm \
359 bs3-c64-Trap64Generic.asm \
360 ../../../Runtime/common/asm/ASMGetIDTR.asm \
361 ../../../Runtime/common/asm/ASMSetIDTR.asm \
362 ../../../Runtime/common/asm/ASMGetGDTR.asm \
363 ../../../Runtime/common/asm/ASMSetGDTR.asm
364
365
366#
367# Common sources to be compiled for each CPU mode.
368#
369VBOX_BS3KIT_MODE_SOURCES = \
370 bs3-mode-Name.asm \
371 bs3-mode-NameShortLower.asm \
372 bs3-mode-SwitchToRM.asm \
373 bs3-mode-SwitchToPE16.asm \
374 bs3-mode-SwitchToPE16_32.asm \
375 bs3-mode-SwitchToPE16_V86.asm \
376 bs3-mode-SwitchToPE32.asm \
377 bs3-mode-SwitchToPE32_16.asm \
378 bs3-mode-SwitchToPEV86.asm \
379 bs3-mode-SwitchToPP16.asm \
380 bs3-mode-SwitchToPP16_32.asm \
381 bs3-mode-SwitchToPP16_V86.asm \
382 bs3-mode-SwitchToPP32.asm \
383 bs3-mode-SwitchToPP32_16.asm \
384 bs3-mode-SwitchToPPV86.asm \
385 bs3-mode-SwitchToPAE16.asm \
386 bs3-mode-SwitchToPAE16_32.asm \
387 bs3-mode-SwitchToPAE16_V86.asm \
388 bs3-mode-SwitchToPAE32.asm \
389 bs3-mode-SwitchToPAE32_16.asm \
390 bs3-mode-SwitchToPAEV86.asm \
391 bs3-mode-SwitchToLM64.asm \
392 bs3-mode-SwitchToLM32.asm \
393 bs3-mode-SwitchToLM16.asm \
394 bs3-mode-SwitchTo32BitAndCallC.asm \
395 bs3-mode-EnteredMode.asm \
396 bs3-mode-PagingGetRootForPP16.asm \
397 bs3-mode-PagingGetRootForPP32.asm \
398 bs3-mode-PagingGetRootForPAE16.asm \
399 bs3-mode-PagingGetRootForPAE32.asm \
400 bs3-mode-PagingGetRootForLM64.asm \
401 bs3-mode-TrapInit.c \
402 bs3-mode-TrapSystemCallHandler.asm \
403 bs3-mode-TrapSetJmpAndRestoreInRmAsm.asm \
404 bs3-mode-TestDoModes.c \
405 bs3-mode-TestDoModesByOne.c \
406 bs3-mode-TestDoModesByMax.c \
407 bs3-mode-TestDoModesHlp.asm \
408 bs3-mode-BiosInt15hE820.asm
409
410# The 16-bit real mode BS3Kit library.
411LIBRARIES += bs3kit-rm
412bs3kit-rm_TEMPLATE = VBoxBS3KitImg
413bs3kit-rm_INSTTYPE = none
414bs3kit-rm_DEFS = TMPL_MODE=BS3_MODE_RM
415bs3kit-rm_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
416 bs3-first-rm.asm \
417 bs3-mode-CpuDetect.asm \
418 bs3-mode-TestDoModesStub.asm \
419 bs3-mode-TestDoModesByOneStub.asm \
420 bs3-mode-TestDoModesByMaxStub.asm
421
422
423# The 16-bit BS3Kit library for 16-bit protected kernel+tss.
424LIBRARIES += bs3kit-pe16
425bs3kit-pe16_TEMPLATE = VBoxBS3KitImg
426bs3kit-pe16_INSTTYPE = none
427bs3kit-pe16_DEFS = TMPL_MODE=BS3_MODE_PE16
428bs3kit-pe16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
429 bs3-first-pe16.asm \
430 bs3-mode-TestDoModesStub.asm \
431 bs3-mode-TestDoModesByOneStub.asm \
432 bs3-mode-TestDoModesByMaxStub.asm
433# bs3-mode-CpuDetect.asm
434
435# The 32-bit BS3Kit library for 16-bit protected kernel+tss.
436LIBRARIES += bs3kit-pe16_32
437bs3kit-pe16_32_TEMPLATE = VBoxBS3KitImg32
438bs3kit-pe16_32_INSTTYPE = none
439bs3kit-pe16_32_DEFS = TMPL_MODE=BS3_MODE_PE16_32
440bs3kit-pe16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
441 bs3-mode-TestDoModesStub.asm \
442 bs3-mode-TestDoModesByOneStub.asm \
443 bs3-mode-TestDoModesByMaxStub.asm
444
445# The v86 BS3Kit library for 16-bit protected kernel+tss.
446LIBRARIES += bs3kit-pe16_v86
447bs3kit-pe16_v86_TEMPLATE = VBoxBS3KitImg
448bs3kit-pe16_v86_INSTTYPE = none
449bs3kit-pe16_v86_DEFS = TMPL_MODE=BS3_MODE_PE16_V86
450bs3kit-pe16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
451 bs3-mode-TestDoModesStub.asm \
452 bs3-mode-TestDoModesByOneStub.asm \
453 bs3-mode-TestDoModesByMaxStub.asm
454
455# The 32-bit BS3Kit library for 32-bit protected kernel+tss.
456LIBRARIES += bs3kit-pe32
457bs3kit-pe32_TEMPLATE = VBoxBS3KitImg32
458bs3kit-pe32_INSTTYPE = none
459bs3kit-pe32_DEFS = TMPL_MODE=BS3_MODE_PE32
460bs3kit-pe32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
461 bs3-first-init-all-pe32.asm
462
463# The 16-bit BS3Kit library for 32-bit protected kernel+tss.
464LIBRARIES += bs3kit-pe32_16
465bs3kit-pe32_16_TEMPLATE = VBoxBS3KitImg
466bs3kit-pe32_16_INSTTYPE = none
467bs3kit-pe32_16_DEFS = TMPL_MODE=BS3_MODE_PE32_16
468bs3kit-pe32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
469 bs3-mode-TestDoModesStub.asm \
470 bs3-mode-TestDoModesByOneStub.asm \
471 bs3-mode-TestDoModesByMaxStub.asm
472
473# The v8086 BS3Kit library for 32-bit protected kernel+tss.
474LIBRARIES += bs3kit-pev86
475bs3kit-pev86_TEMPLATE = VBoxBS3KitImg
476bs3kit-pev86_INSTTYPE = none
477bs3kit-pev86_DEFS = TMPL_MODE=BS3_MODE_PEV86
478bs3kit-pev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
479
480# The 16-bit BS3Kit library for 16-bit paged protected kernel+tss.
481LIBRARIES += bs3kit-pp16
482bs3kit-pp16_TEMPLATE = VBoxBS3KitImg
483bs3kit-pp16_INSTTYPE = none
484bs3kit-pp16_DEFS = TMPL_MODE=BS3_MODE_PP16
485bs3kit-pp16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
486 bs3-mode-CpuDetect.asm \
487 bs3-mode-TestDoModesStub.asm \
488 bs3-mode-TestDoModesByOneStub.asm \
489 bs3-mode-TestDoModesByMaxStub.asm
490
491# The 32-bit BS3Kit library for 16-bit paged protected kernel+tss.
492LIBRARIES += bs3kit-pp16_32
493bs3kit-pp16_32_TEMPLATE = VBoxBS3KitImg32
494bs3kit-pp16_32_INSTTYPE = none
495bs3kit-pp16_32_DEFS = TMPL_MODE=BS3_MODE_PP16_32
496bs3kit-pp16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
497
498# The v8086 BS3Kit library for 16-bit paged protected kernel+tss.
499LIBRARIES += bs3kit-pp16_v86
500bs3kit-pp16_v86_TEMPLATE = VBoxBS3KitImg
501bs3kit-pp16_v86_INSTTYPE = none
502bs3kit-pp16_v86_DEFS = TMPL_MODE=BS3_MODE_PP16_V86
503bs3kit-pp16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
504
505# The 32-bit BS3Kit library for 32-bit paged protected kernel+tss.
506LIBRARIES += bs3kit-pp32
507bs3kit-pp32_TEMPLATE = VBoxBS3KitImg32
508bs3kit-pp32_INSTTYPE = none
509bs3kit-pp32_DEFS = TMPL_MODE=BS3_MODE_PP32
510bs3kit-pp32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
511 bs3-first-init-all-pp32.asm
512
513# The 16-bit BS3Kit library for 32-bit paged protected kernel+tss.
514LIBRARIES += bs3kit-pp32_16
515bs3kit-pp32_16_TEMPLATE = VBoxBS3KitImg
516bs3kit-pp32_16_INSTTYPE = none
517bs3kit-pp32_16_DEFS = TMPL_MODE=BS3_MODE_PP32_16
518bs3kit-pp32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
519 bs3-mode-TestDoModesStub.asm \
520 bs3-mode-TestDoModesByOneStub.asm \
521 bs3-mode-TestDoModesByMaxStub.asm
522
523# The v8086 BS3Kit library for 32-bit paged protected kernel+tss.
524LIBRARIES += bs3kit-ppv86
525bs3kit-ppv86_TEMPLATE = VBoxBS3KitImg
526bs3kit-ppv86_INSTTYPE = none
527bs3kit-ppv86_DEFS = TMPL_MODE=BS3_MODE_PPV86
528bs3kit-ppv86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
529
530
531# The 16-bit BS3Kit library for 16-bit PAE paged protected kernel+tss.
532LIBRARIES += bs3kit-pae16
533bs3kit-pae16_TEMPLATE = VBoxBS3KitImg
534bs3kit-pae16_INSTTYPE = none
535bs3kit-pae16_DEFS = TMPL_MODE=BS3_MODE_PAE16
536bs3kit-pae16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
537 bs3-mode-CpuDetect.asm \
538 bs3-mode-TestDoModesStub.asm \
539 bs3-mode-TestDoModesByOneStub.asm \
540 bs3-mode-TestDoModesByMaxStub.asm
541
542# The 16-bit BS3Kit library for 16-bit PAE paged protected kernel+tss.
543LIBRARIES += bs3kit-pae16_32
544bs3kit-pae16_32_TEMPLATE = VBoxBS3KitImg32
545bs3kit-pae16_32_INSTTYPE = none
546bs3kit-pae16_32_DEFS = TMPL_MODE=BS3_MODE_PAE16_32
547bs3kit-pae16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
548
549# The v8086 BS3Kit library for 16-bit PAE paged protected kernel+tss.
550LIBRARIES += bs3kit-pae16_v86
551bs3kit-pae16_v86_TEMPLATE = VBoxBS3KitImg
552bs3kit-pae16_v86_INSTTYPE = none
553bs3kit-pae16_v86_DEFS = TMPL_MODE=BS3_MODE_PAE16_V86
554bs3kit-pae16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
555
556# The 32-bit BS3Kit library for 32-bit PAE paged protected kernel+tss.
557LIBRARIES += bs3kit-pae32
558bs3kit-pae32_TEMPLATE = VBoxBS3KitImg32
559bs3kit-pae32_INSTTYPE = none
560bs3kit-pae32_DEFS = TMPL_MODE=BS3_MODE_PAE32
561bs3kit-pae32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
562
563# The 16-bit BS3Kit library for 32-bit PAE paged protected kernel+tss.
564LIBRARIES += bs3kit-pae32_16
565bs3kit-pae32_16_TEMPLATE = VBoxBS3KitImg
566bs3kit-pae32_16_INSTTYPE = none
567bs3kit-pae32_16_DEFS = TMPL_MODE=BS3_MODE_PAE32_16
568bs3kit-pae32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
569 bs3-mode-TestDoModesStub.asm \
570 bs3-mode-TestDoModesByOneStub.asm \
571 bs3-mode-TestDoModesByMaxStub.asm
572
573# The v8086 BS3Kit library for 32-bit PAE paged protected kernel+tss.
574LIBRARIES += bs3kit-paev86
575bs3kit-paev86_TEMPLATE = VBoxBS3KitImg
576bs3kit-paev86_INSTTYPE = none
577bs3kit-paev86_DEFS = TMPL_MODE=BS3_MODE_PAEV86
578bs3kit-paev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
579
580
581# The 16-bit long mode BS3Kit library.
582LIBRARIES += bs3kit-lm16
583bs3kit-lm16_TEMPLATE = VBoxBS3KitImg
584bs3kit-lm16_INSTTYPE = none
585bs3kit-lm16_DEFS = TMPL_MODE=BS3_MODE_LM16
586bs3kit-lm16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
587 bs3-mode-TestDoModesStub.asm \
588 bs3-mode-TestDoModesByOneStub.asm \
589 bs3-mode-TestDoModesByMaxStub.asm
590
591# The 32-bit long mode BS3Kit library.
592LIBRARIES += bs3kit-lm32
593bs3kit-lm32_TEMPLATE = VBoxBS3KitImg32
594bs3kit-lm32_INSTTYPE = none
595bs3kit-lm32_DEFS = TMPL_MODE=BS3_MODE_LM32
596bs3kit-lm32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
597
598# The 64-bit long mode BS3Kit library.
599LIBRARIES += bs3kit-lm64
600bs3kit-lm64_TEMPLATE = VBoxBS3KitImg64
601bs3kit-lm64_INSTTYPE = none
602bs3kit-lm64_DEFS = TMPL_MODE=BS3_MODE_LM64
603bs3kit-lm64_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
604 bs3-first-init-all-lm64.asm
605
606
607#
608# shutdown example.
609#
610MISCBINS += bs3-shutdown
611bs3-shutdown_TEMPLATE = VBoxBS3KitImg
612bs3-shutdown_SOURCES = \
613 bs3-first-pe16.asm \
614 bs3-shutdown.c
615
616
617#
618# DOS Utilities / Testcases.
619#
620MISCBINS += bs3cpudt
621bs3cpudt_TEMPLATE = VBoxBS3KitUtil
622bs3cpudt_SOURCES = \
623 bs3-first-dosexe.asm \
624 bs3cpudt.c
625
626
627#
628# Rule for regenerating bs3kit-mangling-functions-undef.h.
629#
630bs3kit-mangling-code-undef.h: $(PATH_SUB_CURRENT)/bs3kit-mangling-code-define.h $(MAKEFILE)
631 $(SED) \
632 -e 's/#\( *\)define \([a-zA-Z_][a-zA-Z0-9_]*\) .*$(DOLLAR)/#\1undef \2/' \
633 -e 's/Function needing mangling.*$(DOLLAR)/Undefining function mangling - automatically generated by the $@ makefile rule./' \
634 --output $(dir $<)bs3kit-mangling-code-undef.h \
635 $<
636
637#
638# Rule for regenerating bs3kit-mangling-functions-define.h.
639#
640bs3kit-mangling-code-define.h: \
641 $(PATH_SUB_CURRENT)/bs3kit.h \
642 $(PATH_SUB_CURRENT)/bs3-cmn-paging.h \
643 $(PATH_SUB_CURRENT)/bs3-cmn-test.h \
644 $(MAKEFILE)
645 $(APPEND) -tn "$(dir $<)$@" \
646 '/* $(DOLLAR)Id: $(DOLLAR) */' \
647 '/** @file' \
648 ' * BS3Kit - Function needing mangling - generated by the $@ makefile rule.' \
649 ' */' \
650 '' \
651 '/*' \
652 ' * Copyright (C) 2007-$(VBOX_C_YEAR) Oracle and/or its affiliates.' \
653 ' *' \
654 ' * This file is part of VirtualBox base platform packages, as' \
655 ' * available from https://www.virtualbox.org.' \
656 ' *' \
657 ' * This program is free software; you can redistribute it and/or' \
658 ' * modify it under the terms of the GNU General Public License' \
659 ' * as published by the Free Software Foundation, in version 3 of the' \
660 ' * License.' \
661 ' *' \
662 ' * This program is distributed in the hope that it will be useful, but' \
663 ' * WITHOUT ANY WARRANTY; without even the implied warranty of' \
664 ' * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU' \
665 ' * General Public License for more details.' \
666 ' *' \
667 ' * You should have received a copy of the GNU General Public License' \
668 ' * along with this program; if not, see <https://www.gnu.org/licenses>.' \
669 ' *' \
670 ' * The contents of this file may alternatively be used under the terms' \
671 ' * of the Common Development and Distribution License Version 1.0' \
672 ' * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included' \
673 ' * in the VirtualBox distribution, in which case the provisions of the' \
674 ' * CDDL are applicable instead of those of the GPL.' \
675 ' *' \
676 ' * You may elect to license modified versions of this file under the' \
677 ' * terms and conditions of either the GPL or the CDDL or both.' \
678 ' *' \
679 ' * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0' \
680 ' */' \
681 ''
682 $(SED) -n \
683 -e 's/^ *BS3_CMN_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \
684 -e 's/^ *BS3_CMN_PROTO_NOSB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \
685 -e 's/^ *BS3_CMN_PROTO_FARSTUB([^,]*,[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \
686 $(filter %.h,$^) | sort >> "$(dir $<)bs3kit-mangling-code-define.h"
687 $(APPEND) -n "$(dir $<)$@" '#ifndef BS3_CMN_ONLY'
688 $(SED) -n \
689 -e 's/^ *BS3_MODE_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \
690 -e 's/^ *BS3_MODE_PROTO_NOSB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \
691 -e 's/^ *BS3_MODE_PROTO_FARSTUB([^,]*,[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \
692 $(filter %.h,$^) | sort >> "$(dir $<)bs3kit-mangling-code-define.h"
693 $(APPEND) -n "$(dir $<)$@" '#endif /* !BS3_CMN_ONLY */'
694
695#
696# Rule for regenerating bs3kit-autostubs.kmk.
697#
698bs3kit-autostubs.kmk: \
699 $(PATH_SUB_CURRENT)/bs3kit.h \
700 $(PATH_SUB_CURRENT)/bs3-cmn-memory.h \
701 $(PATH_SUB_CURRENT)/bs3-cmn-paging.h \
702 $(PATH_SUB_CURRENT)/bs3-cmn-test.h \
703 $(MAKEFILE)
704 $(APPEND) -tn "$(dir $<)$@" \
705 '# $(DOLLAR)Id: $(DOLLAR)' \
706 '## @file' \
707 '# BS3Kit - Automatic near/far stubs - generated by the $@ makefile rule.' \
708 '#' \
709 '' \
710 '#' \
711 '# Copyright (C) 2007-$(VBOX_C_YEAR) Oracle and/or its affiliates.' \
712 '#' \
713 '# This file is part of VirtualBox base platform packages, as' \
714 '# available from https://www.virtualbox.org.' \
715 '#' \
716 '# This program is free software; you can redistribute it and/or' \
717 '# modify it under the terms of the GNU General Public License' \
718 '# as published by the Free Software Foundation, in version 3 of the' \
719 '# License.' \
720 '#' \
721 '# This program is distributed in the hope that it will be useful, but' \
722 '# WITHOUT ANY WARRANTY; without even the implied warranty of' \
723 '# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU' \
724 '# General Public License for more details.' \
725 '#' \
726 '# You should have received a copy of the GNU General Public License' \
727 '# along with this program; if not, see <https://www.gnu.org/licenses>.' \
728 '#' \
729 '# The contents of this file may alternatively be used under the terms' \
730 '# of the Common Development and Distribution License Version 1.0' \
731 '# (CDDL), a copy of it is provided in the "COPYING.CDDL" file included' \
732 '# in the VirtualBox distribution, in which case the provisions of the' \
733 '# CDDL are applicable instead of those of the GPL.' \
734 '#' \
735 '# You may elect to license modified versions of this file under the' \
736 '# terms and conditions of either the GPL or the CDDL or both.' \
737 '#' \
738 '# SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0' \
739 '#' \
740 ''
741 $(SED) -n \
742 -e '/^ *BS3_CMN_PROTO_STUB/p' \
743 -e '/^ *BS3_CMN_PROTO_FARSTUB/p' \
744 -e '/^ *BS3_MODE_PROTO_STUB/p' \
745 -e '/^ *BS3_MODE_PROTO_FARSTUB/p' \
746 $(filter %.h,$^) \
747 | sort \
748 | $(SED) -n \
749 -e 's/^ *BS3_CMN_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,\1)/p' \
750 -e 's/^ *BS3_MODE_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,\1)/p' \
751 -e 's/^ *BS3_CMN_PROTO_FARSTUB( *\([^,]*\),[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,\2,\1)/p' \
752 -e 's/^ *BS3_MODE_PROTO_FARSTUB( *\([^,]*\),[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_MODE_FARSTUB,bs3kit-common-16,\2,\1)/p' \
753 --append "$(dir $<)$@"
754
755bs3kit-update:: bs3kit-autostubs.kmk bs3kit-mangling-code-define.h bs3kit-mangling-code-undef.h
756.NOTPARALLEL: bs3kit-autostubs.kmk bs3kit-mangling-code-define.h bs3kit-mangling-code-undef.h
757
758
759include $(FILE_KBUILD_SUB_FOOTER)
760
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