VirtualBox

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

Last change on this file since 72133 was 72133, checked in by vboxsync, 7 years ago

bs3kit: Added some more functions for setting and setting CRx and DRx registers from v8086 mode and such.

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