VirtualBox

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

Last change on this file since 60291 was 60291, checked in by vboxsync, 9 years ago

bs3kit: A bunch of changes to be able to test the effects of a GDT page being read-only or not-present.

  • Extended the GDT so we get a whole page to play paging tricks with.
  • Added syscall for restoring a context from ring-0 so we can safely get out of bogus test context that aren't in ring-0 (non-standard CS value causing trouble here). Implemented the string print syscall since the restore syscall forced me to sort out pointers.
  • Changed most string printers to do more than one char at a time (usually a line) to save context switches (screen priting is done via INT 10h in real mode).
  • Test the CS access bit handling during INT XXh.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.7 KB
Line 
1# $Id: Makefile.kmk 60291 2016-04-01 20:51:29Z vboxsync $
2## @file
3# VirtualBox Validation Kit - Bootsector Kit v3
4#
5
6#
7# Copyright (C) 2006-2016 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_SOURCES = $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3ObjConverter.cpp
42
43
44# The boot sector.
45MISCBINS += bs3-bootsector
46bs3-bootsector_TEMPLATE = VBoxBS3KitBS
47bs3-bootsector_SOURCES = bs3-bootsector.asm
48
49
50#
51# Common sources to be compiled into _p16, _p32 and _p64 versions.
52#
53VBOX_BS3KIT_COMMON_SOURCES = \
54 bs3-cmn-A20Disable.asm \
55 bs3-cmn-A20Enable.asm \
56 bs3-cmn-KbdRead.asm \
57 bs3-cmn-KbdWait.asm \
58 bs3-cmn-KbdWrite.asm \
59 bs3-cmn-Shutdown.asm \
60 bs3-cmn-Panic.asm \
61 bs3-cmn-PrintChr.asm \
62 bs3-cmn-Printf.c \
63 bs3-cmn-PrintU32.asm \
64 bs3-cmn-PrintX32.asm \
65 bs3-cmn-PrintStr.c \
66 bs3-cmn-PrintStrN.asm \
67 bs3-cmn-PrintStrColonSpaces.asm \
68 bs3-cmn-PrintStrSpacesColonSpace.c \
69 bs3-cmn-StrFormatV.c \
70 bs3-cmn-StrPrintf.c \
71 bs3-cmn-StrLen.c \
72 bs3-cmn-StrNLen.c \
73 bs3-cmn-StrCpy.c \
74 bs3-cmn-MemCpy.c \
75 bs3-cmn-MemPCpy.c \
76 bs3-cmn-MemMove.c \
77 bs3-cmn-MemZero.asm \
78 bs3-cmn-MemAlloc.c \
79 bs3-cmn-MemAllocZ.c \
80 bs3-cmn-MemFree.c \
81 bs3-cmn-PagingData.c \
82 bs3-cmn-PagingInitRootForPP.c \
83 bs3-cmn-PagingInitRootForPAE.c \
84 bs3-cmn-PagingInitRootForLM.c \
85 bs3-cmn-PagingProtect.c \
86 bs3-cmn-RegCtxRestore.asm \
87 bs3-cmn-RegCtxConvertToRingX.c \
88 bs3-cmn-RegCtxPrint.c \
89 bs3-cmn-RegCtxSave.asm \
90 bs3-cmn-SelFar32ToFlat32.c \
91 bs3-cmn-SelProtFar32ToFlat32.c \
92 bs3-cmn-SlabInit.c \
93 bs3-cmn-SlabAlloc.c \
94 bs3-cmn-SlabAllocEx.c \
95 bs3-cmn-SlabFree.c \
96 bs3-cmn-SlabListInit.c \
97 bs3-cmn-SlabListAdd.c \
98 bs3-cmn-SlabListAlloc.c \
99 bs3-cmn-SlabListAllocEx.c \
100 bs3-cmn-SlabListFree.c \
101 bs3-cmn-SwitchToRing0.asm \
102 bs3-cmn-SwitchToRing1.asm \
103 bs3-cmn-SwitchToRing2.asm \
104 bs3-cmn-SwitchToRing3.asm \
105 bs3-cmn-SwitchToRingX.asm \
106 bs3-cmn-SwitchTo16Bit.asm \
107 bs3-cmn-SwitchTo16BitV86.asm \
108 bs3-cmn-SwitchTo32Bit.asm \
109 bs3-cmn-SwitchTo64Bit.asm \
110 bs3-cmn-Syscall.asm \
111 bs3-cmn-TestData.c \
112 bs3-cmn-TestInit.c \
113 bs3-cmn-TestFailed.c \
114 bs3-cmn-TestSkipped.c \
115 bs3-cmn-TestSub.c \
116 bs3-cmn-TestSubDone.c \
117 bs3-cmn-TestSubErrorCount.c \
118 bs3-cmn-TestTerm.c \
119 bs3-cmn-TestSendCmdWithStr.asm \
120 bs3-cmn-TestSendCmdWithU32.asm \
121 bs3-cmn-TestIsVmmDevTestingPresent.asm \
122 bs3-cmn-TestCheckRegCtxEx.c \
123 bs3-cmn-TestPrintf.c \
124 bs3-cmn-Trap16Init.c \
125 bs3-cmn-Trap16SetGate.c \
126 bs3-cmn-Trap32Init.c \
127 bs3-cmn-Trap32SetGate.c \
128 bs3-cmn-Trap64Init.c \
129 bs3-cmn-Trap64SetGate.c \
130 bs3-cmn-TrapDefaultHandler.c \
131 bs3-cmn-TrapPrintFrame.c \
132 bs3-cmn-TrapSetHandler.c \
133 bs3-cmn-TrapSetJmp.asm \
134 bs3-cmn-TrapSetJmpAndRestore.c \
135 bs3-cmn-TrapUnsetJmp.c \
136 ../../../Runtime/common/asm/ASMBitFirstClear.asm \
137 ../../../Runtime/common/asm/ASMBitFirstSet.asm \
138 ../../../Runtime/common/asm/ASMBitNextClear.asm \
139 ../../../Runtime/common/asm/ASMBitNextSet.asm \
140 ../../../Runtime/common/asm/ASMBitFirstSetU16.asm \
141 ../../../Runtime/common/asm/ASMBitFirstSetU32.asm \
142 ../../../Runtime/common/asm/ASMBitFirstSetU64.asm \
143 ../../../Runtime/common/asm/ASMBitLastSetU16.asm \
144 ../../../Runtime/common/asm/ASMBitLastSetU32.asm \
145 ../../../Runtime/common/asm/ASMBitLastSetU64.asm \
146 ../../../Runtime/common/asm/ASMMemFirstMismatchingU8.asm \
147 ../../../Runtime/common/asm/ASMSerializeInstruction-cpuid.asm \
148 ../../../Runtime/common/asm/ASMSerializeInstruction-iret.asm \
149 ../../../Runtime/common/asm/ASMSerializeInstruction-rdtscp.asm \
150
151# The 16-bit BS3Kit library.
152LIBRARIES += bs3kit-common-16
153bs3kit-common-16_TEMPLATE = VBoxBS3KitImg
154bs3kit-common-16_INSTTYPE = none
155bs3kit-common-16_DEFS = TMPL_PE16 BS3_CMN_ONLY
156bs3kit-common-16_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
157bs3kit-common-16_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
158 bs3-system-data.asm \
159 bs3-rm-InitAll.c \
160 bs3-rm-InitMemory.c \
161 bs3-cmn-hexdigits.c \
162 bs3-cmn-CpuDetectData.c \
163 bs3-cmn-PerCpuData.c \
164 bs3-cmn-ConvertRMStackToP16UsingCxReturnToAx.asm \
165 bs3-wc16-U8DR.asm \
166 bs3-wc16-U8DQ.asm \
167 bs3-wc16-I8DR.asm \
168 bs3-wc16-I8DQ.asm \
169 bs3-wc16-I8RS.asm \
170 bs3-wc16-U8RS.asm \
171 bs3-wc16-U8LS.asm \
172 bs3-wc16-U4D.asm \
173 bs3-wc16-I4D.asm \
174 bs3-c16-Trap16Generic.asm
175
176# The 32-bit BS3Kit library.
177LIBRARIES += bs3kit-common-32
178bs3kit-common-32_TEMPLATE = VBoxBS3KitImg32
179bs3kit-common-32_INSTTYPE = none
180bs3kit-common-32_DEFS = TMPL_PE32 BS3_CMN_ONLY
181bs3kit-common-32_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
182bs3kit-common-32_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
183 bs3-wc32-U8D.asm \
184 bs3-wc32-I8D.asm \
185 bs3-wc32-I8RS.asm \
186 bs3-wc32-U8RS.asm \
187 bs3-wc32-U8LS.asm \
188 bs3-c32-Trap32Generic.asm
189
190# The 64-bit BS3Kit library.
191LIBRARIES += bs3kit-common-64
192bs3kit-common-64_TEMPLATE = VBoxBS3KitImg64
193bs3kit-common-64_INSTTYPE = none
194bs3kit-common-64_DEFS = TMPL_LM64 BS3_CMN_ONLY
195bs3kit-common-64_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
196bs3kit-common-64_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
197 bs3-c64-Trap64Generic.asm \
198 ../../../Runtime/common/asm/ASMGetIDTR.asm \
199 ../../../Runtime/common/asm/ASMSetIDTR.asm \
200 ../../../Runtime/common/asm/ASMGetGDTR.asm \
201 ../../../Runtime/common/asm/ASMSetGDTR.asm \
202
203
204#
205# Common sources to be compiled for each CPU mode.
206#
207VBOX_BS3KIT_MODE_SOURCES = \
208 bs3-mode-Name.asm \
209 bs3-mode-SwitchToRM.asm \
210 bs3-mode-SwitchToPE16.asm \
211 bs3-mode-SwitchToPE16_32.asm \
212 bs3-mode-SwitchToPE16_V86.asm \
213 bs3-mode-SwitchToPE32.asm \
214 bs3-mode-SwitchToPE32_16.asm \
215 bs3-mode-SwitchToPEV86.asm \
216 bs3-mode-SwitchToPP16.asm \
217 bs3-mode-SwitchToPP16_32.asm \
218 bs3-mode-SwitchToPP16_V86.asm \
219 bs3-mode-SwitchToPP32.asm \
220 bs3-mode-SwitchToPP32_16.asm \
221 bs3-mode-SwitchToPPV86.asm \
222 bs3-mode-SwitchToPAE16.asm \
223 bs3-mode-SwitchToPAE16_32.asm \
224 bs3-mode-SwitchToPAE16_V86.asm \
225 bs3-mode-SwitchToPAE32.asm \
226 bs3-mode-SwitchToPAE32_16.asm \
227 bs3-mode-SwitchToPAEV86.asm \
228 bs3-mode-SwitchToLM64.asm \
229 bs3-mode-SwitchToLM32.asm \
230 bs3-mode-SwitchToLM16.asm \
231 bs3-mode-EnteredMode.asm \
232 bs3-mode-PagingGetRootForPP16.asm \
233 bs3-mode-PagingGetRootForPP32.asm \
234 bs3-mode-PagingGetRootForPAE16.asm \
235 bs3-mode-PagingGetRootForPAE32.asm \
236 bs3-mode-PagingGetRootForLM64.asm \
237 bs3-mode-TrapInit.c \
238 bs3-mode-TrapSystemCallHandler.asm \
239 bs3-mode-TestDoModes.c \
240 bs3-mode-TestDoModesHlp.asm \
241
242# The 16-bit real mode BS3Kit library.
243LIBRARIES += bs3kit-rm
244bs3kit-rm_TEMPLATE = VBoxBS3KitImg
245bs3kit-rm_INSTTYPE = none
246bs3kit-rm_DEFS = TMPL_MODE=BS3_MODE_RM
247bs3kit-rm_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
248 bs3-first-rm.asm \
249 bs3-mode-CpuDetect.asm
250
251
252# The 16-bit BS3Kit library for 16-bit protected kernel+tss.
253LIBRARIES += bs3kit-pe16
254bs3kit-pe16_TEMPLATE = VBoxBS3KitImg
255bs3kit-pe16_INSTTYPE = none
256bs3kit-pe16_DEFS = TMPL_MODE=BS3_MODE_PE16
257bs3kit-pe16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
258 bs3-first-pe16.asm \
259# bs3-mode-CpuDetect.asm
260
261# The 32-bit BS3Kit library for 16-bit protected kernel+tss.
262LIBRARIES += bs3kit-pe16_32
263bs3kit-pe16_32_TEMPLATE = VBoxBS3KitImg32
264bs3kit-pe16_32_INSTTYPE = none
265bs3kit-pe16_32_DEFS = TMPL_MODE=BS3_MODE_PE16_32
266bs3kit-pe16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
267
268# The v86 BS3Kit library for 16-bit protected kernel+tss.
269LIBRARIES += bs3kit-pe16_v86
270bs3kit-pe16_v86_TEMPLATE = VBoxBS3KitImg
271bs3kit-pe16_v86_INSTTYPE = none
272bs3kit-pe16_v86_DEFS = TMPL_MODE=BS3_MODE_PE16_V86
273bs3kit-pe16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
274
275# The 32-bit BS3Kit library for 32-bit protected kernel+tss.
276LIBRARIES += bs3kit-pe32
277bs3kit-pe32_TEMPLATE = VBoxBS3KitImg32
278bs3kit-pe32_INSTTYPE = none
279bs3kit-pe32_DEFS = TMPL_MODE=BS3_MODE_PE32
280bs3kit-pe32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
281
282# The 16-bit BS3Kit library for 32-bit protected kernel+tss.
283LIBRARIES += bs3kit-pe32_16
284bs3kit-pe32_16_TEMPLATE = VBoxBS3KitImg
285bs3kit-pe32_16_INSTTYPE = none
286bs3kit-pe32_16_DEFS = TMPL_MODE=BS3_MODE_PE32_16
287bs3kit-pe32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
288
289# The v8086 BS3Kit library for 32-bit protected kernel+tss.
290LIBRARIES += bs3kit-pev86
291bs3kit-pev86_TEMPLATE = VBoxBS3KitImg
292bs3kit-pev86_INSTTYPE = none
293bs3kit-pev86_DEFS = TMPL_MODE=BS3_MODE_PEV86
294bs3kit-pev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
295
296
297# The 16-bit BS3Kit library for 16-bit paged protected kernel+tss.
298LIBRARIES += bs3kit-pp16
299bs3kit-pp16_TEMPLATE = VBoxBS3KitImg
300bs3kit-pp16_INSTTYPE = none
301bs3kit-pp16_DEFS = TMPL_MODE=BS3_MODE_PP16
302bs3kit-pp16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
303 bs3-mode-CpuDetect.asm
304
305# The 32-bit BS3Kit library for 16-bit paged protected kernel+tss.
306LIBRARIES += bs3kit-pp16_32
307bs3kit-pp16_32_TEMPLATE = VBoxBS3KitImg32
308bs3kit-pp16_32_INSTTYPE = none
309bs3kit-pp16_32_DEFS = TMPL_MODE=BS3_MODE_PP16_32
310bs3kit-pp16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
311
312# The v8086 BS3Kit library for 16-bit paged protected kernel+tss.
313LIBRARIES += bs3kit-pp16_v86
314bs3kit-pp16_v86_TEMPLATE = VBoxBS3KitImg
315bs3kit-pp16_v86_INSTTYPE = none
316bs3kit-pp16_v86_DEFS = TMPL_MODE=BS3_MODE_PP16_V86
317bs3kit-pp16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
318
319# The 32-bit BS3Kit library for 32-bit paged protected kernel+tss.
320LIBRARIES += bs3kit-pp32
321bs3kit-pp32_TEMPLATE = VBoxBS3KitImg32
322bs3kit-pp32_INSTTYPE = none
323bs3kit-pp32_DEFS = TMPL_MODE=BS3_MODE_PP32
324bs3kit-pp32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
325
326# The 16-bit BS3Kit library for 32-bit paged protected kernel+tss.
327LIBRARIES += bs3kit-pp32_16
328bs3kit-pp32_16_TEMPLATE = VBoxBS3KitImg
329bs3kit-pp32_16_INSTTYPE = none
330bs3kit-pp32_16_DEFS = TMPL_MODE=BS3_MODE_PP32_16
331bs3kit-pp32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
332
333# The v8086 BS3Kit library for 32-bit paged protected kernel+tss.
334LIBRARIES += bs3kit-ppv86
335bs3kit-ppv86_TEMPLATE = VBoxBS3KitImg
336bs3kit-ppv86_INSTTYPE = none
337bs3kit-ppv86_DEFS = TMPL_MODE=BS3_MODE_PPV86
338bs3kit-ppv86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
339
340
341# The 16-bit BS3Kit library for 16-bit PAE paged protected kernel+tss.
342LIBRARIES += bs3kit-pae16
343bs3kit-pae16_TEMPLATE = VBoxBS3KitImg
344bs3kit-pae16_INSTTYPE = none
345bs3kit-pae16_DEFS = TMPL_MODE=BS3_MODE_PAE16
346bs3kit-pae16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES) \
347 bs3-mode-CpuDetect.asm
348
349# The 16-bit BS3Kit library for 16-bit PAE paged protected kernel+tss.
350LIBRARIES += bs3kit-pae16_32
351bs3kit-pae16_32_TEMPLATE = VBoxBS3KitImg32
352bs3kit-pae16_32_INSTTYPE = none
353bs3kit-pae16_32_DEFS = TMPL_MODE=BS3_MODE_PAE16_32
354bs3kit-pae16_32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
355
356# The v8086 BS3Kit library for 16-bit PAE paged protected kernel+tss.
357LIBRARIES += bs3kit-pae16_v86
358bs3kit-pae16_v86_TEMPLATE = VBoxBS3KitImg
359bs3kit-pae16_v86_INSTTYPE = none
360bs3kit-pae16_v86_DEFS = TMPL_MODE=BS3_MODE_PAE16_V86
361bs3kit-pae16_v86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
362
363# The 32-bit BS3Kit library for 32-bit PAE paged protected kernel+tss.
364LIBRARIES += bs3kit-pae32
365bs3kit-pae32_TEMPLATE = VBoxBS3KitImg32
366bs3kit-pae32_INSTTYPE = none
367bs3kit-pae32_DEFS = TMPL_MODE=BS3_MODE_PAE32
368bs3kit-pae32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
369
370# The 16-bit BS3Kit library for 32-bit PAE paged protected kernel+tss.
371LIBRARIES += bs3kit-pae32_16
372bs3kit-pae32_16_TEMPLATE = VBoxBS3KitImg
373bs3kit-pae32_16_INSTTYPE = none
374bs3kit-pae32_16_DEFS = TMPL_MODE=BS3_MODE_PAE32_16
375bs3kit-pae32_16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
376
377# The v8086 BS3Kit library for 32-bit PAE paged protected kernel+tss.
378LIBRARIES += bs3kit-paev86
379bs3kit-paev86_TEMPLATE = VBoxBS3KitImg
380bs3kit-paev86_INSTTYPE = none
381bs3kit-paev86_DEFS = TMPL_MODE=BS3_MODE_PAEV86
382bs3kit-paev86_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
383
384
385# The 16-bit long mode BS3Kit library.
386LIBRARIES += bs3kit-lm16
387bs3kit-lm16_TEMPLATE = VBoxBS3KitImg
388bs3kit-lm16_INSTTYPE = none
389bs3kit-lm16_DEFS = TMPL_MODE=BS3_MODE_LM16
390bs3kit-lm16_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
391
392# The 32-bit long mode BS3Kit library.
393LIBRARIES += bs3kit-lm32
394bs3kit-lm32_TEMPLATE = VBoxBS3KitImg32
395bs3kit-lm32_INSTTYPE = none
396bs3kit-lm32_DEFS = TMPL_MODE=BS3_MODE_LM32
397bs3kit-lm32_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
398
399# The 64-bit long mode BS3Kit library.
400LIBRARIES += bs3kit-lm64
401bs3kit-lm64_TEMPLATE = VBoxBS3KitImg64
402bs3kit-lm64_INSTTYPE = none
403bs3kit-lm64_DEFS = TMPL_MODE=BS3_MODE_LM64
404bs3kit-lm64_SOURCES = $(VBOX_BS3KIT_MODE_SOURCES)
405
406
407#
408# shutdown example.
409#
410MISCBINS += bs3-shutdown
411bs3-shutdown_TEMPLATE = VBoxBS3KitImg
412bs3-shutdown_SOURCES = \
413 bs3-first-pe16.asm \
414 bs3-shutdown.c
415
416
417include $(FILE_KBUILD_SUB_FOOTER)
418
419.PRECIOUS: $(PATH_OBJ)/bs3-shutdown/bs3-shutdown.map
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