VirtualBox

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

Last change on this file since 88216 was 83006, checked in by vboxsync, 5 years ago

ValKit: New bootsector test: bs3-cpu-state64-1

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.4 KB
Line 
1# $Id: Makefile.kmk 83006 2020-02-06 13:51:30Z vboxsync $
2## @file
3# VirtualBox Validation Kit - Bootsector Tests for Test Drivers or standalone testing.
4#
5
6#
7# Copyright (C) 2006-2020 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# Make sure our Config.kmk gets included when kmk is running from a parent directory.
33#
34ifndef VBOX_BOOTSECTORS_CONFIG_KMK_INCLUDED
35 include $(PATH_SUB_CURRENT)/Config.kmk
36endif
37
38
39#
40# Include sub-makefile.
41#
42# The VBOX_WITH_BS3KIT feature requires NASM 2.12 and either MSVC or gcc
43# with ms_abi function attribute (gcc v4.4+, MSVC default).
44# Some 32-bit gcc compilers come without 64-bit support (e.g. EL5).
45#
46if defined(VBOX_WITH_OPEN_WATCOM)
47 if1of ($(KBUILD_TARGET), win)
48 VBOX_WITH_BS3KIT = 1
49 else if $(VBOX_GCC_VERSION_CC) >= 40400 # ms_abi was added in 4.4
50 if1of ($(KBUILD_TARGET), linux)
51 ifneq ($(VBOX_GCC_m64),)
52 VBOX_WITH_BS3KIT = 1
53 endif
54 endif
55 endif
56 ifdef VBOX_WITH_BS3KIT
57 include $(PATH_SUB_CURRENT)/bs3kit/Makefile.kmk
58 endif
59endif
60
61
62#
63# Boot Sector "Linker" tool.
64#
65TOOL_VBoxBootSectorLd = Joins one or more BS2 object files into a floppy img.
66TOOL_VBoxBootSectorLd_LINK_MISCBIN_OUTPUT =
67TOOL_VBoxBootSectorLd_LINK_MISCBIN_DEPEND =
68TOOL_VBoxBootSectorLd_LINK_MISCBIN_DEPORD = $(VBoxBs2Linker_1_TARGET)
69define TOOL_VBoxBootSectorLd_LINK_MISCBIN_CMDS
70 $(VBoxBs2Linker_1_TARGET) -o $(out) $(objs) $(othersrc)
71endef
72
73BLDPROGS += VBoxBs2Linker
74VBoxBs2Linker_TEMPLATE = VBoxBldProg
75VBoxBs2Linker_SOURCES = VBoxBs2Linker.cpp
76
77
78#
79# Makes a boot sector test image.
80#
81TEMPLATE_VBoxBsTestImg = kBuild tool config for building boot sector stuff.
82TEMPLATE_VBoxBsTestImg_INST = $(INST_VALIDATIONKIT)bootsectors/
83TEMPLATE_VBoxBsTestImg_BINSUFF = .img
84TEMPLATE_VBoxBsTestImg_MODE = 0644
85TEMPLATE_VBoxBsTestImg_ASTOOL = YASM
86TEMPLATE_VBoxBsTestImg_ASFLAGS = -f bin -P $(VBOX_PATH_BOOTSECTORS_SRC)/bootsector2-first.mac $(VBOX_YASM_Wno-segreg-in-64bit) --mapfile
87TEMPLATE_VBoxBsTestImg_ASDEFS = ASM_FORMAT_BIN
88TEMPLATE_VBoxBsTestImg_INCS = \
89 . \
90 ../../VMM/testcase/Instructions
91TEMPLATE_VBoxBsTestImg_LDTOOL = VBoxBootSectorLd
92
93
94#
95# The boot sector tests.
96#
97MISCBINS += bootsector-shutdown
98bootsector-shutdown_TEMPLATE = VBoxBsTestImg
99bootsector-shutdown_SOURCES = bootsector-shutdown.asm
100
101MISCBINS += bootsector-pae
102bootsector-pae_TEMPLATE = VBoxBsTestImg
103bootsector-pae_SOURCES = bootsector-pae.asm
104
105MISCBINS += bootsector-empty
106bootsector-empty_TEMPLATE = VBoxBsTestImg
107bootsector-empty_SOURCES = bootsector-empty.asm
108
109MISCBINS += bootsector2-test1
110bootsector2-test1_TEMPLATE = VBoxBsTestImg
111bootsector2-test1_SOURCES = bootsector2-test1.asm
112
113MISCBINS += bootsector2-cpu-hidden-regs-1
114bootsector2-cpu-hidden-regs-1_TEMPLATE = VBoxBsTestImg
115bootsector2-cpu-hidden-regs-1_SOURCES = bootsector2-cpu-hidden-regs-1.asm
116
117MISCBINS += bootsector2-cpu-instr-1
118bootsector2-cpu-instr-1_TEMPLATE = VBoxBsTestImg
119bootsector2-cpu-instr-1_SOURCES = bootsector2-cpu-instr-1.asm
120
121MISCBINS += bootsector2-cpu-pf-1
122bootsector2-cpu-pf-1_TEMPLATE = VBoxBsTestImg
123bootsector2-cpu-pf-1_SOURCES = bootsector2-cpu-pf-1.asm
124
125MISCBINS += bootsector2-cpu-xcpt-1
126bootsector2-cpu-xcpt-1_TEMPLATE = VBoxBsTestImg
127bootsector2-cpu-xcpt-1_SOURCES = bootsector2-cpu-xcpt-1.asm
128
129MISCBINS += bootsector2-cpu-xcpt-2
130bootsector2-cpu-xcpt-2_TEMPLATE = VBoxBsTestImg
131bootsector2-cpu-xcpt-2_SOURCES = bootsector2-cpu-xcpt-2.asm
132
133MISCBINS += bootsector2-cpu-a20-1
134bootsector2-cpu-a20-1_TEMPLATE = VBoxBsTestImg
135bootsector2-cpu-a20-1_SOURCES = bootsector2-cpu-a20-1.asm
136
137MISCBINS += bootsector2-cpu-basic-1
138bootsector2-cpu-basic-1_TEMPLATE = VBoxBsTestImg
139bootsector2-cpu-basic-1_SOURCES = bootsector2-cpu-basic-1.asm
140
141MISCBINS += bootsector2-cpu-ac-loop
142bootsector2-cpu-ac-loop_TEMPLATE = VBoxBsTestImg
143bootsector2-cpu-ac-loop_SOURCES = bootsector2-cpu-ac-loop.asm
144
145MISCBINS += bootsector2-cpu-db-loop
146bootsector2-cpu-db-loop_TEMPLATE = VBoxBsTestImg
147bootsector2-cpu-db-loop_SOURCES = bootsector2-cpu-db-loop.asm
148
149MISCBINS += bootsector2-boot-registers-1
150bootsector2-boot-registers-1_TEMPLATE = VBoxBsTestImg
151bootsector2-boot-registers-1_SOURCES = bootsector2-boot-registers-1.asm
152
153MISCBINS += bootsector2-triple-fault-1
154bootsector2-triple-fault-1_TEMPLATE = VBoxBsTestImg
155bootsector2-triple-fault-1_SOURCES = bootsector2-triple-fault-1.asm
156
157
158ifeq ($(USERNAME),birdxx)
159 if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
160#
161# Generated instruction tests (work in progress).
162#
163
164VBOX_PATH_VBINSTST = $(PATH_ROOT)/src/VBox/VMM/testcase/Instructions
165VBOX_VBINSTST_GEN = $(VBOX_PATH_VBINSTST)/InstructionTestGen.py
166VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN = $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) \
167 --split 3 --target bs2-r0-64 --output-base $(bootsectors_0_OUTDIR)/VBInsTst-64 --test-size tiny
168VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES = $(shell $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN) --makefile-mode)
169
170#$$(bootsectors_0_OUTDIR)/VBInsTst.ts + $$(VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES): $(VBOX_VBINSTST_GEN) | $$(dir $$@)
171# $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN)
172# $(APPEND) -t $@
173#
174#bootsectors_SOURCES += $(bootsectors_0_OUTDIR)/bootsector2-vbinstst-1.img
175#bootsectors_CLEAN += $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES)
176#
177#$$(bootsectors_0_OUTDIR)/bootsector2-vbinstst-1.img: \
178# $(PATH_SUB_CURRENT)/bootsector2-vbinstst-64-1.asm \
179# $$(bootsectors_0_OUTDIR)/VBInsTst-64.asm
180# $(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] $<
181
182MISCBINS += bootsector2-vbinstst-kernel
183bootsector2-vbinstst-kernel_TEMPLATE = VBoxBsTestImg
184bootsector2-vbinstst-kernel_SOURCES = \
185 bootsector2-vbinstst-kernel.asm
186
187
188MISCBINS += bootsector2-vbinstst-64-1
189bootsector2-vbinstst-64-1_TEMPLATE = VBoxBsTestImg
190bootsector2-vbinstst-64-1_DEFS = \
191 BS2_BIG_IMAGE_LM64 \
192 BS2_BIG_IMAGE_GEN_SOURCE_FILE=bs2-vbinstst-64-1.asm \
193 BS2_BIG_IMAGE_GEN_TEST_NAME=\"bs2-vbinstst-64-1\"
194bootsector2-vbinstst-64-1_INCS = $(bootsector2-vbinstst-64-1_0_OUTDIR)/
195bootsector2-vbinstst-64-1_SOURCES = \
196 bootsector2-vbinstst-kernel.asm \
197 bootsector2-vbinstst-big-template.asm
198bootsector2-vbinstst-64-1_INTERMEDIATES = \
199 $(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm
200bootsector2-vbinstst-64-1_CLEAN = \
201 $(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm
202
203$$(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm: $(VBOX_VBINSTST_GEN) | $$(dir $$@)
204 $(REDIRECT) -0 /dev/null -- $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) --target bs2-r0-64-big --output-base $(basename $@) --test-size medium
205
206MISCBINS += bootsector2-vbinstst-32-1
207bootsector2-vbinstst-32-1_TEMPLATE = VBoxBsTestImg
208bootsector2-vbinstst-32-1_DEFS = \
209 BS2_BIG_IMAGE_PP32 \
210 BS2_BIG_IMAGE_GEN_SOURCE_FILE=bs2-vbinstst-32-1.asm \
211 BS2_BIG_IMAGE_GEN_TEST_NAME=\"bs2-vbinstst-32-1\"
212bootsector2-vbinstst-32-1_INCS = $(bootsector2-vbinstst-32-1_0_OUTDIR)/
213bootsector2-vbinstst-32-1_SOURCES = \
214 bootsector2-vbinstst-kernel.asm \
215 bootsector2-vbinstst-big-template.asm
216bootsector2-vbinstst-32-1_INTERMEDIATES = \
217 $(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm
218bootsector2-vbinstst-32-1_CLEAN = \
219 $(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm
220
221$$(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm: $(VBOX_VBINSTST_GEN) | $$(dir $$@)
222 $(REDIRECT) -0 /dev/null -- $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) --target bs2-r0-32-big --output-base $(basename $@) --test-size medium
223
224 endif
225endif # bird-only
226
227
228ifdef VBOX_WITH_BS3KIT
229#
230# Bs3kit
231#
232
233# CPU basics #2 (first being bootsector2-cpu-basic-1).
234MISCBINS += bs3-cpu-basic-2
235bs3-cpu-basic-2_TEMPLATE = VBoxBS3KitImg
236bs3-cpu-basic-2_INCS = .
237bs3-cpu-basic-2_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c
238bs3-cpu-basic-2_DEFS += BS3_MODE_INSTANTIATE_FILE1=bs3-cpu-basic-2-template.c
239 ifeq ($(KBUILD_HOST),win)
240bs3-cpu-basic-2_DEFS += HAVE_OMF_CONVERTER
241 endif
242bs3-cpu-basic-2_SOURCES = \
243 bs3kit/bs3-first-rm.asm \
244 bs3-cpu-basic-2.c \
245 bs3-cpu-basic-2-x0.c \
246 bs3-cpu-basic-2-32.c32 \
247 bs3-cpu-basic-2-pf.c32 \
248 bs3-cpu-basic-2-asm.asm \
249 bs3kit/bs3-cmn-instantiate-x0.c16 \
250 bs3kit/bs3-cmn-instantiate.c32 \
251 bs3kit/bs3-cmn-instantiate.c64
252bs3-cpu-basic-2-template.o:: \
253 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate-x0.o16 \
254 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \
255 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 \
256 $$(bs3-cpu-basic-2_0_OUTDIR)/bs3-cpu-basic-2-asm.o16
257
258# CPU weird stuff #1.
259MISCBINS += bs3-cpu-weird-1
260bs3-cpu-weird-1_TEMPLATE = VBoxBS3KitImg
261bs3-cpu-weird-1_INCS = .
262bs3-cpu-weird-1_SOURCES = \
263 bs3kit/bs3-first-rm.asm \
264 bs3-cpu-weird-1.c \
265 bs3-cpu-weird-1-x0.c \
266 bs3-cpu-weird-1-asm.asm
267
268# 64-bit CPU state #1.
269MISCBINS += bs3-cpu-state64-1
270bs3-cpu-state64-1_TEMPLATE = VBoxBS3KitImg
271bs3-cpu-state64-1_INCS = .
272bs3-cpu-state64-1_SOURCES = \
273 bs3kit/bs3-first-init-all-lm64.asm \
274 bs3-cpu-state64-1.c64 \
275 bs3-cpu-state64-1-asm.asm
276
277# FPU state corruption checker.
278MISCBINS += bs3-fpustate-1
279bs3-fpustate-1_TEMPLATE = VBoxBS3KitImg
280bs3-fpustate-1_INCS = .
281bs3-fpustate-1_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-fpustate-1-template.c
282bs3-fpustate-1_DEFS += BS3_MODE_INSTANTIATE_FILE1=bs3-fpustate-1-template.c
283bs3-fpustate-1_SOURCES = \
284 bs3kit/bs3-first-rm.asm \
285 bs3-fpustate-1.c \
286 bs3kit/bs3-cmn-instantiate.c16 \
287 bs3kit/bs3-cmn-instantiate.c32 \
288 bs3kit/bs3-cmn-instantiate.c64 \
289 bs3-fpustate-1-asm.asm
290bs3-fpustate-1-template.o:: \
291 $$(bs3-fpustate-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o16 \
292 $$(bs3-fpustate-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \
293 $$(bs3-fpustate-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 \
294 $$(bs3-fpustate-1_0_OUTDIR)/bs3-fpustate-1-asm.o16
295
296# CPU instruction decoding experiments.
297MISCBINS += bs3-cpu-decoding-1
298bs3-cpu-decoding-1_TEMPLATE = VBoxBS3KitImg
299bs3-cpu-decoding-1_INCS = .
300bs3-cpu-decoding-1_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-decoding-1-template.c
301bs3-cpu-decoding-1_DEFS += BS3_MODE_INSTANTIATE_FILE1=bs3-cpu-decoding-1-template.c
302bs3-cpu-decoding-1_SOURCES = \
303 bs3kit/bs3-first-init-all-pp32.asm \
304 bs3-cpu-decoding-1.c32 \
305 bs3-cpu-decoding-1-asm.asm
306# bs3kit/bs3-cmn-instantiate.c16 \
307# bs3kit/bs3-cmn-instantiate.c32 \
308# bs3kit/bs3-cmn-instantiate.c64
309bs3-cpu-decoding-1-template.o:: \
310 $$(bs3-cpu-decoding-1_0_OUTDIR)/bs3-cpu-decoding-1-asm.o16
311# $$(bs3-cpu-decoding-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o16 \
312# $$(bs3-cpu-decoding-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \
313# $$(bs3-cpu-decoding-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 \
314
315
316# CPU instructions #2 (first being bootsector2-cpu-instr-1).
317MISCBINS += bs3-cpu-instr-2
318bs3-cpu-instr-2_TEMPLATE = VBoxBS3KitImg
319bs3-cpu-instr-2_INCS = .
320bs3-cpu-instr-2_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-instr-2-template.c
321bs3-cpu-instr-2_DEFS += BS3_MODE_INSTANTIATE_FILE1=bs3-cpu-instr-2-template.c
322bs3-cpu-instr-2_SOURCES = \
323 bs3kit/bs3-first-rm.asm \
324 bs3-cpu-instr-2.c \
325 bs3-cpu-instr-2-asm.asm \
326 bs3kit/bs3-cmn-instantiate-x0.c16 \
327 bs3kit/bs3-cmn-instantiate.c32 \
328 bs3kit/bs3-cmn-instantiate.c64
329bs3-cpu-instr-2-template.o:: \
330 $$(bs3-cpu-instr-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate-x0.o16 \
331 $$(bs3-cpu-instr-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \
332 $$(bs3-cpu-instr-2_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 \
333 $$(bs3-cpu-instr-2_0_OUTDIR)/bs3-cpu-instr-2-asm.o16
334
335# CPU generated instruction tests #1
336MISCBINS += bs3-cpu-generated-1
337bs3-cpu-generated-1_TEMPLATE = VBoxBS3KitImg
338bs3-cpu-generated-1_INCS = .
339bs3-cpu-generated-1_DEFS = BS3_CMN_INSTANTIATE_FILE1=bs3-cpu-generated-1-template.c
340bs3-cpu-generated-1_SOURCES = \
341 bs3kit/bs3-first-rm.asm \
342 bs3-cpu-generated-1.c \
343 bs3-cpu-generated-1-asm.asm \
344 bs3kit/bs3-cmn-instantiate-x0.c16 \
345 bs3kit/bs3-cmn-instantiate.c32 \
346 bs3kit/bs3-cmn-instantiate.c64 \
347 $(bs3-cpu-generated-1_0_OUTDIR)/bs3-cpu-generated-1-data.c16
348bs3-cpu-generated-1_CLEAN = $(bs3-cpu-generated-1_0_OUTDIR)/bs3-cpu-generated-1-data.c16
349
350bs3-cpu-generated-1-template.o:: \
351 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate-x0.o16 \
352 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o32 \
353 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3kit/bs3-cmn-instantiate.o64 \
354 $$(bs3-cpu-generated-1_0_OUTDIR)/bs3-cpu-generated-1-asm.o16
355
356$$(bs3-cpu-generated-1_0_OUTDIR)/bs3-cpu-generated-1-data.c16: \
357 $(PATH_SUB_CURRENT)/bs3-cpu-generated-1-data.py \
358 $(PATH_SUB_CURRENT)/../../VMM/VMMAll/IEMAllInstructionsPython.py \
359 $(PATH_SUB_CURRENT)/../../VMM/VMMAll/IEMAllInstructions*.cpp.h \
360 | $$(dir $$@)
361 $(REDIRECT) -0 /dev/null -- $(VBOX_BLD_PYTHON) $< $@
362
363endif # VBOX_WITH_BS3KIT
364
365
366#
367# pylint
368#
369VBOX_VALIDATIONKIT_PYTHON_SOURCES += $(wildcard $(PATH_SUB_CURRENT)/*.py)
370$(evalcall def_vbox_validationkit_process_python_sources)
371
372include $(FILE_KBUILD_SUB_FOOTER)
373
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