1 | # $Id: Makefile.kmk 58588 2015-11-05 15:45:36Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VirtualBox Validation Kit - Bootsector Tests for Test Drivers or standalone testing.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2015 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 |
|
---|
27 | SUB_DEPTH = ../../../..
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Boot Sector "Linker" tool.
|
---|
33 | #
|
---|
34 | TOOL_VBoxBootSectorLd = Joins one or more BS2 object files into a floppy img.
|
---|
35 | TOOL_VBoxBootSectorLd_LINK_MISCBIN_OUTPUT =
|
---|
36 | TOOL_VBoxBootSectorLd_LINK_MISCBIN_DEPEND =
|
---|
37 | TOOL_VBoxBootSectorLd_LINK_MISCBIN_DEPORD = $(VBoxBs2Linker_1_TARGET)
|
---|
38 | define TOOL_VBoxBootSectorLd_LINK_MISCBIN_CMDS
|
---|
39 | $(VBoxBs2Linker_1_TARGET) -o $(out) $(objs) $(othersrc)
|
---|
40 | endef
|
---|
41 |
|
---|
42 | BLDPROGS += VBoxBs2Linker
|
---|
43 | VBoxBs2Linker_TEMPLATE = VBoxBldProg
|
---|
44 | VBoxBs2Linker_SOURCES = VBoxBs2Linker.cpp
|
---|
45 |
|
---|
46 |
|
---|
47 | #
|
---|
48 | # Makes a boot sector test image.
|
---|
49 | #
|
---|
50 | TEMPLATE_VBoxBsTestImg = kBuild tool config for building boot sector stuff.
|
---|
51 | TEMPLATE_VBoxBsTestImg_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
52 | TEMPLATE_VBoxBsTestImg_BINSUFF = .img
|
---|
53 | TEMPLATE_VBoxBsTestImg_MODE = 0644
|
---|
54 | TEMPLATE_VBoxBsTestImg_ASTOOL = YASM
|
---|
55 | TEMPLATE_VBoxBsTestImg_ASFLAGS:= -f bin -P $(PATH_SUB_CURRENT)/bootsector2-first.mac $(VBOX_YASM_Wno-segreg-in-64bit) --mapfile
|
---|
56 | TEMPLATE_VBoxBsTestImg_ASDEFS = ASM_FORMAT_BIN
|
---|
57 | TEMPLATE_VBoxBsTestImg_INCS = \
|
---|
58 | . \
|
---|
59 | ../../VMM/testcase/Instructions
|
---|
60 | TEMPLATE_VBoxBsTestImg_LDTOOL = VBoxBootSectorLd
|
---|
61 |
|
---|
62 |
|
---|
63 | #
|
---|
64 | # The boot sector tests.
|
---|
65 | #
|
---|
66 | MISCBINS += bootsector-shutdown
|
---|
67 | bootsector-shutdown_TEMPLATE = VBoxBsTestImg
|
---|
68 | bootsector-shutdown_SOURCES = bootsector-shutdown.asm
|
---|
69 |
|
---|
70 | MISCBINS += bootsector-pae
|
---|
71 | bootsector-pae_TEMPLATE = VBoxBsTestImg
|
---|
72 | bootsector-pae_SOURCES = bootsector-pae.asm
|
---|
73 |
|
---|
74 | MISCBINS += bootsector-empty
|
---|
75 | bootsector-empty_TEMPLATE = VBoxBsTestImg
|
---|
76 | bootsector-empty_SOURCES = bootsector-empty.asm
|
---|
77 |
|
---|
78 | MISCBINS += bootsector2-test1
|
---|
79 | bootsector2-test1_TEMPLATE = VBoxBsTestImg
|
---|
80 | bootsector2-test1_SOURCES = bootsector2-test1.asm
|
---|
81 |
|
---|
82 | MISCBINS += bootsector2-cpu-hidden-regs-1
|
---|
83 | bootsector2-cpu-hidden-regs-1_TEMPLATE = VBoxBsTestImg
|
---|
84 | bootsector2-cpu-hidden-regs-1_SOURCES = bootsector2-cpu-hidden-regs-1.asm
|
---|
85 |
|
---|
86 | MISCBINS += bootsector2-cpu-instr-1
|
---|
87 | bootsector2-cpu-instr-1_TEMPLATE = VBoxBsTestImg
|
---|
88 | bootsector2-cpu-instr-1_SOURCES = bootsector2-cpu-instr-1.asm
|
---|
89 |
|
---|
90 | MISCBINS += bootsector2-cpu-pf-1
|
---|
91 | bootsector2-cpu-pf-1_TEMPLATE = VBoxBsTestImg
|
---|
92 | bootsector2-cpu-pf-1_SOURCES = bootsector2-cpu-pf-1.asm
|
---|
93 |
|
---|
94 | MISCBINS += bootsector2-cpu-xcpt-1
|
---|
95 | bootsector2-cpu-xcpt-1_TEMPLATE = VBoxBsTestImg
|
---|
96 | bootsector2-cpu-xcpt-1_SOURCES = bootsector2-cpu-xcpt-1.asm
|
---|
97 |
|
---|
98 | MISCBINS += bootsector2-cpu-xcpt-2
|
---|
99 | bootsector2-cpu-xcpt-2_TEMPLATE = VBoxBsTestImg
|
---|
100 | bootsector2-cpu-xcpt-2_SOURCES = bootsector2-cpu-xcpt-2.asm
|
---|
101 |
|
---|
102 | MISCBINS += bootsector2-cpu-a20-1
|
---|
103 | bootsector2-cpu-a20-1_TEMPLATE = VBoxBsTestImg
|
---|
104 | bootsector2-cpu-a20-1_SOURCES = bootsector2-cpu-a20-1.asm
|
---|
105 |
|
---|
106 | MISCBINS += bootsector2-cpu-basic-1
|
---|
107 | bootsector2-cpu-basic-1_TEMPLATE = VBoxBsTestImg
|
---|
108 | bootsector2-cpu-basic-1_SOURCES = bootsector2-cpu-basic-1.asm
|
---|
109 |
|
---|
110 | MISCBINS += bootsector2-boot-registers-1
|
---|
111 | bootsector2-boot-registers-1_TEMPLATE = VBoxBsTestImg
|
---|
112 | bootsector2-boot-registers-1_SOURCES = bootsector2-boot-registers-1.asm
|
---|
113 |
|
---|
114 | MISCBINS += bootsector2-triple-fault-1
|
---|
115 | bootsector2-triple-fault-1_TEMPLATE = VBoxBsTestImg
|
---|
116 | bootsector2-triple-fault-1_SOURCES = bootsector2-triple-fault-1.asm
|
---|
117 |
|
---|
118 |
|
---|
119 | ifeq ($(USERNAME),birdxx)
|
---|
120 | if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
|
---|
121 | #
|
---|
122 | # Generated instruction tests (work in progress).
|
---|
123 | #
|
---|
124 |
|
---|
125 | VBOX_PATH_VBINSTST = $(PATH_ROOT)/src/VBox/VMM/testcase/Instructions
|
---|
126 | VBOX_VBINSTST_GEN = $(VBOX_PATH_VBINSTST)/InstructionTestGen.py
|
---|
127 | VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN = $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) \
|
---|
128 | --split 3 --target bs2-r0-64 --output-base $(bootsectors_0_OUTDIR)/VBInsTst-64 --test-size tiny
|
---|
129 | VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES = $(shell $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN) --makefile-mode)
|
---|
130 |
|
---|
131 | #$$(bootsectors_0_OUTDIR)/VBInsTst.ts + $$(VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES): $(VBOX_VBINSTST_GEN) | $$(dir $$@)
|
---|
132 | # $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN)
|
---|
133 | # $(APPEND) -t $@
|
---|
134 | #
|
---|
135 | #bootsectors_SOURCES += $(bootsectors_0_OUTDIR)/bootsector2-vbinstst-1.img
|
---|
136 | #bootsectors_CLEAN += $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES)
|
---|
137 | #
|
---|
138 | #$$(bootsectors_0_OUTDIR)/bootsector2-vbinstst-1.img: \
|
---|
139 | # $(PATH_SUB_CURRENT)/bootsector2-vbinstst-64-1.asm \
|
---|
140 | # $$(bootsectors_0_OUTDIR)/VBInsTst-64.asm
|
---|
141 | # $(TOOL_$(VBOX_ASTOOL)_AS) -f bin -D ASM_FORMAT_BIN -I $(dir $@) -I $(PATH_ROOT)/include -I $(VBOX_PATH_VBINSTST) -o $@ -L nasm -l [email protected] $<
|
---|
142 |
|
---|
143 | MISCBINS += bootsector2-vbinstst-kernel
|
---|
144 | bootsector2-vbinstst-kernel_TEMPLATE = VBoxBsTestImg
|
---|
145 | bootsector2-vbinstst-kernel_SOURCES = \
|
---|
146 | bootsector2-vbinstst-kernel.asm
|
---|
147 |
|
---|
148 |
|
---|
149 | MISCBINS += bootsector2-vbinstst-64-1
|
---|
150 | bootsector2-vbinstst-64-1_TEMPLATE = VBoxBsTestImg
|
---|
151 | bootsector2-vbinstst-64-1_DEFS = \
|
---|
152 | BS2_BIG_IMAGE_LM64 \
|
---|
153 | BS2_BIG_IMAGE_GEN_SOURCE_FILE=bs2-vbinstst-64-1.asm \
|
---|
154 | BS2_BIG_IMAGE_GEN_TEST_NAME=\"bs2-vbinstst-64-1\"
|
---|
155 | bootsector2-vbinstst-64-1_INCS = $(bootsector2-vbinstst-64-1_0_OUTDIR)/
|
---|
156 | bootsector2-vbinstst-64-1_SOURCES = \
|
---|
157 | bootsector2-vbinstst-kernel.asm \
|
---|
158 | bootsector2-vbinstst-big-template.asm
|
---|
159 | bootsector2-vbinstst-64-1_INTERMEDIATES = \
|
---|
160 | $(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm
|
---|
161 | bootsector2-vbinstst-64-1_CLEAN = \
|
---|
162 | $(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm
|
---|
163 |
|
---|
164 | $$(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm: $(VBOX_VBINSTST_GEN) | $$(dir $$@)
|
---|
165 | $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) --target bs2-r0-64-big --output-base $(basename $@) --test-size medium
|
---|
166 |
|
---|
167 | MISCBINS += bootsector2-vbinstst-32-1
|
---|
168 | bootsector2-vbinstst-32-1_TEMPLATE = VBoxBsTestImg
|
---|
169 | bootsector2-vbinstst-32-1_DEFS = \
|
---|
170 | BS2_BIG_IMAGE_PP32 \
|
---|
171 | BS2_BIG_IMAGE_GEN_SOURCE_FILE=bs2-vbinstst-32-1.asm \
|
---|
172 | BS2_BIG_IMAGE_GEN_TEST_NAME=\"bs2-vbinstst-32-1\"
|
---|
173 | bootsector2-vbinstst-32-1_INCS = $(bootsector2-vbinstst-32-1_0_OUTDIR)/
|
---|
174 | bootsector2-vbinstst-32-1_SOURCES = \
|
---|
175 | bootsector2-vbinstst-kernel.asm \
|
---|
176 | bootsector2-vbinstst-big-template.asm
|
---|
177 | bootsector2-vbinstst-32-1_INTERMEDIATES = \
|
---|
178 | $(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm
|
---|
179 | bootsector2-vbinstst-32-1_CLEAN = \
|
---|
180 | $(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm
|
---|
181 |
|
---|
182 | $$(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm: $(VBOX_VBINSTST_GEN) | $$(dir $$@)
|
---|
183 | $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) --target bs2-r0-32-big --output-base $(basename $@) --test-size medium
|
---|
184 |
|
---|
185 | endif
|
---|
186 | endif # bird-only
|
---|
187 |
|
---|
188 |
|
---|
189 | ifeq ($(USER),bird) # work in progress.
|
---|
190 |
|
---|
191 | #
|
---|
192 | # BS3Kit
|
---|
193 | #
|
---|
194 |
|
---|
195 | # Dummy CP "linker" tool.
|
---|
196 | TOOL_VBoxBsCpLd = Dummy copy linker.
|
---|
197 | TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
|
---|
198 | TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
|
---|
199 | TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
|
---|
200 | define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
|
---|
201 | $(CP) -- $(objs) $(othersrc) "$(out)"
|
---|
202 | endef
|
---|
203 |
|
---|
204 | # Dummy exit 1 "linker" tool.
|
---|
205 | TOOL_VBoxBsUnusedLd = Dummy unused linker.
|
---|
206 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
|
---|
207 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
|
---|
208 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
|
---|
209 | define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
|
---|
210 | echo "cannot use this template for linking"
|
---|
211 | exit 1
|
---|
212 | endef
|
---|
213 |
|
---|
214 | # BS3Kit template for assembly and 16-bit code.
|
---|
215 | TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
|
---|
216 | TEMPLATE_VBoxBS3KitImg_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
217 | TEMPLATE_VBoxBS3KitImg_BINSUFF = .img
|
---|
218 | TEMPLATE_VBoxBS3KitImg_MODE = 0644
|
---|
219 | TEMPLATE_VBoxBS3KitImg_ASTOOL = NASM
|
---|
220 | TEMPLATE_VBoxBS3KitImg_ASFLAGS := -f obj -g -w+orphan-labels #-P $(PATH_SUB_CURRENT)/bootsector2-first.mac
|
---|
221 | TEMPLATE_VBoxBS3KitImg_ASDEFS = ASM_FORMAT_OMF __NASM__
|
---|
222 | TEMPLATE_VBoxBS3KitImg_ARTOOL = OPENWATCOM-16
|
---|
223 | TEMPLATE_VBoxBS3KitImg_CTOOL = OPENWATCOM-16
|
---|
224 | TEMPLATE_VBoxBS3KitImg_CXXTOOL = OPENWATCOM-16
|
---|
225 | TEMPLATE_VBoxBS3KitImg_CFLAGS = -nt=TEXT16 -nd=DATA16 -nc=CODE16
|
---|
226 | TEMPLATE_VBoxBS3KitImg_CXXFLAGS = -nt=TEXT16 -nd=DATA16 -nc=CODE16
|
---|
227 | TEMPLATE_VBoxBS3KitImg_INCS = bs3kit .
|
---|
228 | TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL
|
---|
229 | TEMPLATE_VBoxBS3KitImg_LDFLAGS = \
|
---|
230 | output raw offset=0x10000 \
|
---|
231 | order \
|
---|
232 | clname CODE16 \
|
---|
233 | segment TEXT16 segaddr=0x1000 \
|
---|
234 | clname DATA16 \
|
---|
235 | segment DATA16 segaddr=0x1000 \
|
---|
236 | clname CODE32 \
|
---|
237 | segment TEXT32 \
|
---|
238 | clname DATA32 \
|
---|
239 | segment DATA32
|
---|
240 |
|
---|
241 | # BS3Kit template for 32-bit code.
|
---|
242 | TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
|
---|
243 | TEMPLATE_VBoxBS3KitImg32_INSTTYPE = none
|
---|
244 | TEMPLATE_VBoxBS3KitImg32_ASTOOL = NASM
|
---|
245 | TEMPLATE_VBoxBS3KitImg32_ASFLAGS := -f obj -g -w+orphan-labels #-P $(PATH_SUB_CURRENT)/bootsector2-first.mac
|
---|
246 | TEMPLATE_VBoxBS3KitImg32_ASDEFS = ASM_FORMAT_OMF __NASM__
|
---|
247 | TEMPLATE_VBoxBS3KitImg32_ARTOOL = OPENWATCOM
|
---|
248 | TEMPLATE_VBoxBS3KitImg32_CTOOL = OPENWATCOM
|
---|
249 | TEMPLATE_VBoxBS3KitImg32_CXXTOOL = OPENWATCOM
|
---|
250 | TEMPLATE_VBoxBS3KitImg32_CFLAGS = -nt=TEXT32 -nd=DATA32 -nc=CODE32
|
---|
251 | TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = -nt=TEXT32 -nd=DATA32 -nc=CODE32
|
---|
252 | TEMPLATE_VBoxBS3KitImg32_INCS = bs3kit .
|
---|
253 | TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd
|
---|
254 |
|
---|
255 | # BS3Kit template for 64-bit code.
|
---|
256 | TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
|
---|
257 | TEMPLATE_VBoxBS3KitImg64_INSTTYPE = none
|
---|
258 | TEMPLATE_VBoxBS3KitImg64_ASTOOL = NASM
|
---|
259 | TEMPLATE_VBoxBS3KitImg64_ASFLAGS := -f elf64 -g -w+orphan-labels #-P $(PATH_SUB_CURRENT)/bootsector2-first.mac
|
---|
260 | TEMPLATE_VBoxBS3KitImg64_ASDEFS = ASM_FORMAT_ELF __NASM__ TMPL
|
---|
261 | TEMPLATE_VBoxBS3KitImg64_ARTOOL = OPENWATCOM
|
---|
262 | TEMPLATE_VBoxBS3KitImg64_CTOOL = DUMMY
|
---|
263 | TEMPLATE_VBoxBS3KitImg64_CXXTOOL = DUMMY
|
---|
264 | TEMPLATE_VBoxBS3KitImg64_INCS = bs3kit .
|
---|
265 | TEMPLATE_VBoxBS3KitImg64_LDTOOL = VBoxBsUnusedLd
|
---|
266 |
|
---|
267 | # BS3Kit template for the bootsector.
|
---|
268 | TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
|
---|
269 | TEMPLATE_VBoxBS3KitBS_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
270 | TEMPLATE_VBoxBS3KitBS_INSTTYPE = none
|
---|
271 | TEMPLATE_VBoxBS3KitBS_BINSUFF = .img
|
---|
272 | TEMPLATE_VBoxBS3KitBS_MODE = 0644
|
---|
273 | TEMPLATE_VBoxBS3KitBS_ASTOOL = YASM
|
---|
274 | TEMPLATE_VBoxBS3KitBS_ASFLAGS := -f bin --mapfile
|
---|
275 | TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN __YASM__
|
---|
276 | TEMPLATE_VBoxBS3KitBS_INCS = bs3kit
|
---|
277 | TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd
|
---|
278 |
|
---|
279 | # The boot sector.
|
---|
280 | MISCBINS += bs3-bootsector
|
---|
281 | bs3-bootsector_TEMPLATE = VBoxBS3KitBS
|
---|
282 | bs3-bootsector_SOURCES = bs3kit/bs3-bootsector.asm
|
---|
283 |
|
---|
284 | # The BS3Kit library.
|
---|
285 | LIBRARIES += bs3kit-common-16
|
---|
286 | bs3kit-common-16_TEMPLATE = VBoxBS3KitImg
|
---|
287 | bs3kit-common-16_DEFS = TMPL_PE16 BS3_CMN_ONLY
|
---|
288 | bs3kit-common-16_SOURCES = \
|
---|
289 | bs3kit/bs3-shutdown.asm
|
---|
290 |
|
---|
291 | # The 32-bit BS3Kit library.
|
---|
292 | LIBRARIES += bs3kit-common-32
|
---|
293 | bs3kit-common-32_TEMPLATE = VBoxBS3KitImg32
|
---|
294 | bs3kit-common-32_DEFS = TMPL_PE32 BS3_CMN_ONLY
|
---|
295 | bs3kit-common-32_SOURCES = \
|
---|
296 | bs3kit/bs3-shutdown.asm
|
---|
297 |
|
---|
298 | # The 64-bit BS3Kit library.
|
---|
299 | LIBRARIES += bs3kit-common-64
|
---|
300 | bs3kit-common-64_TEMPLATE = VBoxBS3KitImg64
|
---|
301 | bs3kit-common-64_DEFS = TMPL_LM64 BS3_CMN_ONLY
|
---|
302 | bs3kit-common-64_SOURCES = \
|
---|
303 | bs3kit/bs3-shutdown.asm
|
---|
304 |
|
---|
305 | endif # experimental
|
---|
306 |
|
---|
307 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
308 |
|
---|