1 | # $Id: Makefile.kmk 59866 2016-02-29 10:27:53Z 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 | # Make sure our Config.kmk gets included when kmk is running from a parent directory.
|
---|
33 | #
|
---|
34 | ifndef VBOX_BOOTSECTORS_CONFIG_KMK_INCLUDED
|
---|
35 | include $(PATH_SUB_CURRENT)/Config.kmk
|
---|
36 | endif
|
---|
37 |
|
---|
38 |
|
---|
39 | #
|
---|
40 | # Include sub-makefile.
|
---|
41 | #
|
---|
42 | if defined(VBOX_WITH_OPEN_WATCOM)
|
---|
43 | if1of ($(KBUILD_TARGET), win)
|
---|
44 | VBOX_WITH_BS3KIT = 1
|
---|
45 | else if $(VBOX_GCC_VERSION_CC) >= 40400 # ms_abi was added in 4.4
|
---|
46 | if1of ($(KBUILD_TARGET), linux) # Requires patched NASM in tools.
|
---|
47 | VBOX_WITH_BS3KIT = 1
|
---|
48 | endif
|
---|
49 | endif
|
---|
50 | ifdef VBOX_WITH_BS3KIT
|
---|
51 | include $(PATH_SUB_CURRENT)/bs3kit/Makefile.kmk
|
---|
52 | endif
|
---|
53 | endif
|
---|
54 |
|
---|
55 |
|
---|
56 | #
|
---|
57 | # Boot Sector "Linker" tool.
|
---|
58 | #
|
---|
59 | TOOL_VBoxBootSectorLd = Joins one or more BS2 object files into a floppy img.
|
---|
60 | TOOL_VBoxBootSectorLd_LINK_MISCBIN_OUTPUT =
|
---|
61 | TOOL_VBoxBootSectorLd_LINK_MISCBIN_DEPEND =
|
---|
62 | TOOL_VBoxBootSectorLd_LINK_MISCBIN_DEPORD = $(VBoxBs2Linker_1_TARGET)
|
---|
63 | define TOOL_VBoxBootSectorLd_LINK_MISCBIN_CMDS
|
---|
64 | $(VBoxBs2Linker_1_TARGET) -o $(out) $(objs) $(othersrc)
|
---|
65 | endef
|
---|
66 |
|
---|
67 | BLDPROGS += VBoxBs2Linker
|
---|
68 | VBoxBs2Linker_TEMPLATE = VBoxBldProg
|
---|
69 | VBoxBs2Linker_SOURCES = VBoxBs2Linker.cpp
|
---|
70 |
|
---|
71 |
|
---|
72 | #
|
---|
73 | # Makes a boot sector test image.
|
---|
74 | #
|
---|
75 | TEMPLATE_VBoxBsTestImg = kBuild tool config for building boot sector stuff.
|
---|
76 | TEMPLATE_VBoxBsTestImg_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
77 | TEMPLATE_VBoxBsTestImg_BINSUFF = .img
|
---|
78 | TEMPLATE_VBoxBsTestImg_MODE = 0644
|
---|
79 | TEMPLATE_VBoxBsTestImg_ASTOOL = YASM
|
---|
80 | TEMPLATE_VBoxBsTestImg_ASFLAGS:= -f bin -P $(PATH_SUB_CURRENT)/bootsector2-first.mac $(VBOX_YASM_Wno-segreg-in-64bit) --mapfile
|
---|
81 | TEMPLATE_VBoxBsTestImg_ASDEFS = ASM_FORMAT_BIN
|
---|
82 | TEMPLATE_VBoxBsTestImg_INCS = \
|
---|
83 | . \
|
---|
84 | ../../VMM/testcase/Instructions
|
---|
85 | TEMPLATE_VBoxBsTestImg_LDTOOL = VBoxBootSectorLd
|
---|
86 |
|
---|
87 |
|
---|
88 | #
|
---|
89 | # The boot sector tests.
|
---|
90 | #
|
---|
91 | MISCBINS += bootsector-shutdown
|
---|
92 | bootsector-shutdown_TEMPLATE = VBoxBsTestImg
|
---|
93 | bootsector-shutdown_SOURCES = bootsector-shutdown.asm
|
---|
94 |
|
---|
95 | MISCBINS += bootsector-pae
|
---|
96 | bootsector-pae_TEMPLATE = VBoxBsTestImg
|
---|
97 | bootsector-pae_SOURCES = bootsector-pae.asm
|
---|
98 |
|
---|
99 | MISCBINS += bootsector-empty
|
---|
100 | bootsector-empty_TEMPLATE = VBoxBsTestImg
|
---|
101 | bootsector-empty_SOURCES = bootsector-empty.asm
|
---|
102 |
|
---|
103 | MISCBINS += bootsector2-test1
|
---|
104 | bootsector2-test1_TEMPLATE = VBoxBsTestImg
|
---|
105 | bootsector2-test1_SOURCES = bootsector2-test1.asm
|
---|
106 |
|
---|
107 | MISCBINS += bootsector2-cpu-hidden-regs-1
|
---|
108 | bootsector2-cpu-hidden-regs-1_TEMPLATE = VBoxBsTestImg
|
---|
109 | bootsector2-cpu-hidden-regs-1_SOURCES = bootsector2-cpu-hidden-regs-1.asm
|
---|
110 |
|
---|
111 | MISCBINS += bootsector2-cpu-instr-1
|
---|
112 | bootsector2-cpu-instr-1_TEMPLATE = VBoxBsTestImg
|
---|
113 | bootsector2-cpu-instr-1_SOURCES = bootsector2-cpu-instr-1.asm
|
---|
114 |
|
---|
115 | MISCBINS += bootsector2-cpu-pf-1
|
---|
116 | bootsector2-cpu-pf-1_TEMPLATE = VBoxBsTestImg
|
---|
117 | bootsector2-cpu-pf-1_SOURCES = bootsector2-cpu-pf-1.asm
|
---|
118 |
|
---|
119 | MISCBINS += bootsector2-cpu-xcpt-1
|
---|
120 | bootsector2-cpu-xcpt-1_TEMPLATE = VBoxBsTestImg
|
---|
121 | bootsector2-cpu-xcpt-1_SOURCES = bootsector2-cpu-xcpt-1.asm
|
---|
122 |
|
---|
123 | MISCBINS += bootsector2-cpu-xcpt-2
|
---|
124 | bootsector2-cpu-xcpt-2_TEMPLATE = VBoxBsTestImg
|
---|
125 | bootsector2-cpu-xcpt-2_SOURCES = bootsector2-cpu-xcpt-2.asm
|
---|
126 |
|
---|
127 | MISCBINS += bootsector2-cpu-a20-1
|
---|
128 | bootsector2-cpu-a20-1_TEMPLATE = VBoxBsTestImg
|
---|
129 | bootsector2-cpu-a20-1_SOURCES = bootsector2-cpu-a20-1.asm
|
---|
130 |
|
---|
131 | MISCBINS += bootsector2-cpu-basic-1
|
---|
132 | bootsector2-cpu-basic-1_TEMPLATE = VBoxBsTestImg
|
---|
133 | bootsector2-cpu-basic-1_SOURCES = bootsector2-cpu-basic-1.asm
|
---|
134 |
|
---|
135 | MISCBINS += bootsector2-cpu-ac-loop
|
---|
136 | bootsector2-cpu-ac-loop_TEMPLATE = VBoxBsTestImg
|
---|
137 | bootsector2-cpu-ac-loop_SOURCES = bootsector2-cpu-ac-loop.asm
|
---|
138 |
|
---|
139 | MISCBINS += bootsector2-cpu-db-loop
|
---|
140 | bootsector2-cpu-db-loop_TEMPLATE = VBoxBsTestImg
|
---|
141 | bootsector2-cpu-db-loop_SOURCES = bootsector2-cpu-db-loop.asm
|
---|
142 |
|
---|
143 | MISCBINS += bootsector2-boot-registers-1
|
---|
144 | bootsector2-boot-registers-1_TEMPLATE = VBoxBsTestImg
|
---|
145 | bootsector2-boot-registers-1_SOURCES = bootsector2-boot-registers-1.asm
|
---|
146 |
|
---|
147 | MISCBINS += bootsector2-triple-fault-1
|
---|
148 | bootsector2-triple-fault-1_TEMPLATE = VBoxBsTestImg
|
---|
149 | bootsector2-triple-fault-1_SOURCES = bootsector2-triple-fault-1.asm
|
---|
150 |
|
---|
151 |
|
---|
152 | ifeq ($(USERNAME),birdxx)
|
---|
153 | if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
|
---|
154 | #
|
---|
155 | # Generated instruction tests (work in progress).
|
---|
156 | #
|
---|
157 |
|
---|
158 | VBOX_PATH_VBINSTST = $(PATH_ROOT)/src/VBox/VMM/testcase/Instructions
|
---|
159 | VBOX_VBINSTST_GEN = $(VBOX_PATH_VBINSTST)/InstructionTestGen.py
|
---|
160 | VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN = $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) \
|
---|
161 | --split 3 --target bs2-r0-64 --output-base $(bootsectors_0_OUTDIR)/VBInsTst-64 --test-size tiny
|
---|
162 | VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES = $(shell $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN) --makefile-mode)
|
---|
163 |
|
---|
164 | #$$(bootsectors_0_OUTDIR)/VBInsTst.ts + $$(VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES): $(VBOX_VBINSTST_GEN) | $$(dir $$@)
|
---|
165 | # $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_GEN)
|
---|
166 | # $(APPEND) -t $@
|
---|
167 | #
|
---|
168 | #bootsectors_SOURCES += $(bootsectors_0_OUTDIR)/bootsector2-vbinstst-1.img
|
---|
169 | #bootsectors_CLEAN += $(VBOX_BOOTSECTOR2_VBINSTST_AMD64_FILES)
|
---|
170 | #
|
---|
171 | #$$(bootsectors_0_OUTDIR)/bootsector2-vbinstst-1.img: \
|
---|
172 | # $(PATH_SUB_CURRENT)/bootsector2-vbinstst-64-1.asm \
|
---|
173 | # $$(bootsectors_0_OUTDIR)/VBInsTst-64.asm
|
---|
174 | # $(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] $<
|
---|
175 |
|
---|
176 | MISCBINS += bootsector2-vbinstst-kernel
|
---|
177 | bootsector2-vbinstst-kernel_TEMPLATE = VBoxBsTestImg
|
---|
178 | bootsector2-vbinstst-kernel_SOURCES = \
|
---|
179 | bootsector2-vbinstst-kernel.asm
|
---|
180 |
|
---|
181 |
|
---|
182 | MISCBINS += bootsector2-vbinstst-64-1
|
---|
183 | bootsector2-vbinstst-64-1_TEMPLATE = VBoxBsTestImg
|
---|
184 | bootsector2-vbinstst-64-1_DEFS = \
|
---|
185 | BS2_BIG_IMAGE_LM64 \
|
---|
186 | BS2_BIG_IMAGE_GEN_SOURCE_FILE=bs2-vbinstst-64-1.asm \
|
---|
187 | BS2_BIG_IMAGE_GEN_TEST_NAME=\"bs2-vbinstst-64-1\"
|
---|
188 | bootsector2-vbinstst-64-1_INCS = $(bootsector2-vbinstst-64-1_0_OUTDIR)/
|
---|
189 | bootsector2-vbinstst-64-1_SOURCES = \
|
---|
190 | bootsector2-vbinstst-kernel.asm \
|
---|
191 | bootsector2-vbinstst-big-template.asm
|
---|
192 | bootsector2-vbinstst-64-1_INTERMEDIATES = \
|
---|
193 | $(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm
|
---|
194 | bootsector2-vbinstst-64-1_CLEAN = \
|
---|
195 | $(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm
|
---|
196 |
|
---|
197 | $$(bootsector2-vbinstst-64-1_0_OUTDIR)/bs2-vbinstst-64-1.asm: $(VBOX_VBINSTST_GEN) | $$(dir $$@)
|
---|
198 | $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) --target bs2-r0-64-big --output-base $(basename $@) --test-size medium
|
---|
199 |
|
---|
200 | MISCBINS += bootsector2-vbinstst-32-1
|
---|
201 | bootsector2-vbinstst-32-1_TEMPLATE = VBoxBsTestImg
|
---|
202 | bootsector2-vbinstst-32-1_DEFS = \
|
---|
203 | BS2_BIG_IMAGE_PP32 \
|
---|
204 | BS2_BIG_IMAGE_GEN_SOURCE_FILE=bs2-vbinstst-32-1.asm \
|
---|
205 | BS2_BIG_IMAGE_GEN_TEST_NAME=\"bs2-vbinstst-32-1\"
|
---|
206 | bootsector2-vbinstst-32-1_INCS = $(bootsector2-vbinstst-32-1_0_OUTDIR)/
|
---|
207 | bootsector2-vbinstst-32-1_SOURCES = \
|
---|
208 | bootsector2-vbinstst-kernel.asm \
|
---|
209 | bootsector2-vbinstst-big-template.asm
|
---|
210 | bootsector2-vbinstst-32-1_INTERMEDIATES = \
|
---|
211 | $(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm
|
---|
212 | bootsector2-vbinstst-32-1_CLEAN = \
|
---|
213 | $(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm
|
---|
214 |
|
---|
215 | $$(bootsector2-vbinstst-32-1_0_OUTDIR)/bs2-vbinstst-32-1.asm: $(VBOX_VBINSTST_GEN) | $$(dir $$@)
|
---|
216 | $(VBOX_BLD_PYTHON) $(VBOX_VBINSTST_GEN) --target bs2-r0-32-big --output-base $(basename $@) --test-size medium
|
---|
217 |
|
---|
218 | endif
|
---|
219 | endif # bird-only
|
---|
220 |
|
---|
221 |
|
---|
222 | ifdef VBOX_WITH_BS3KIT
|
---|
223 | #
|
---|
224 | # Bs3kit
|
---|
225 | #
|
---|
226 |
|
---|
227 | # shutdown example.
|
---|
228 | MISCBINS += bs3-cpu-basic-2
|
---|
229 | bs3-cpu-basic-2_TEMPLATE = VBoxBS3KitImg
|
---|
230 | bs3-cpu-basic-2_SOURCES = \
|
---|
231 | bs3kit/bs3-first-rm.asm \
|
---|
232 | bs3-cpu-basic-2-c.c \
|
---|
233 | bs3-cpu-basic-2.asm
|
---|
234 | endif
|
---|
235 |
|
---|
236 |
|
---|
237 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
238 |
|
---|