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