VirtualBox

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

Last change on this file since 97320 was 97320, checked in by vboxsync, 2 years ago

ValKit/bs3kit: Added a Bs3SelSetup32BitCode function for quickly setting up a 32-bit code segment.

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