1 | ; $Id: bootsector2-cpu-xcpt-1.asm 76553 2019-01-01 01:45:53Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; Bootsector test for basic exception stuff.
|
---|
4 | ;
|
---|
5 | ; Recommended (but not necessary):
|
---|
6 | ; VBoxManage setextradata bs-cpu-xcpt-1 VBoxInternal/Devices/VMMDev/0/Config/TestingEnabled 1
|
---|
7 | ;
|
---|
8 |
|
---|
9 | ;
|
---|
10 | ; Copyright (C) 2007-2019 Oracle Corporation
|
---|
11 | ;
|
---|
12 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
14 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | ; General Public License (GPL) as published by the Free Software
|
---|
16 | ; Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 | ;
|
---|
20 | ; The contents of this file may alternatively be used under the terms
|
---|
21 | ; of the Common Development and Distribution License Version 1.0
|
---|
22 | ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
23 | ; VirtualBox OSE distribution, in which case the provisions of the
|
---|
24 | ; CDDL are applicable instead of those of the GPL.
|
---|
25 | ;
|
---|
26 | ; You may elect to license modified versions of this file under the
|
---|
27 | ; terms and conditions of either the GPL or the CDDL or both.
|
---|
28 | ;
|
---|
29 |
|
---|
30 |
|
---|
31 | ;*******************************************************************************
|
---|
32 | ;* Header Files *
|
---|
33 | ;*******************************************************************************
|
---|
34 | %include "iprt/asmdefs.mac"
|
---|
35 | %include "iprt/x86.mac"
|
---|
36 | %include "VBox/VMMDevTesting.mac"
|
---|
37 |
|
---|
38 |
|
---|
39 | ;*******************************************************************************
|
---|
40 | ;* Defined Constants And Macros *
|
---|
41 | ;*******************************************************************************
|
---|
42 | ;; Base address at which we can start testing page tables and page directories.
|
---|
43 | %define TST_SCRATCH_PD_BASE BS2_MUCK_ABOUT_BASE
|
---|
44 | ;; Base address at which we can start testing the page pointer table.
|
---|
45 | %define TST_SCRATCH_PDPT_BASE (1 << X86_PDPT_SHIFT)
|
---|
46 | ;; Base address at which we can start testing the page map level 4.
|
---|
47 | %define TST_SCRATCH_PML4_BASE ((1 << X86_PML4_SHIFT) + TST_SCRATCH_PD_BASE)
|
---|
48 |
|
---|
49 |
|
---|
50 | ;
|
---|
51 | ; Include and execute the init code.
|
---|
52 | ;
|
---|
53 | %define BS2_INIT_RM
|
---|
54 | %define BS2_WITH_TRAPS
|
---|
55 | %define BS2_INC_RM
|
---|
56 | %define BS2_INC_PE16
|
---|
57 | %define BS2_INC_PE32
|
---|
58 | %define BS2_INC_PP16
|
---|
59 | %define BS2_INC_PP32
|
---|
60 | %define BS2_INC_PAE16
|
---|
61 | %define BS2_INC_PAE32
|
---|
62 | %define BS2_INC_LM16
|
---|
63 | %define BS2_INC_LM32
|
---|
64 | %define BS2_INC_LM64
|
---|
65 | %define BS2_WITH_TRAPRECS
|
---|
66 | %include "bootsector2-common-init-code.mac"
|
---|
67 |
|
---|
68 |
|
---|
69 | ;
|
---|
70 | ; The main() function.
|
---|
71 | ;
|
---|
72 | BEGINPROC main
|
---|
73 | BITS 16
|
---|
74 | ;
|
---|
75 | ; Test prologue.
|
---|
76 | ;
|
---|
77 | mov ax, .s_szTstName
|
---|
78 | call TestInit_r86
|
---|
79 | call Bs2EnableA20_r86
|
---|
80 |
|
---|
81 |
|
---|
82 | ;
|
---|
83 | ; Execute the tests
|
---|
84 | ;
|
---|
85 | %if 1
|
---|
86 | call NAME(DoTestsForMode_rm_pe32)
|
---|
87 | %endif
|
---|
88 | %if 1
|
---|
89 | call NAME(DoTestsForMode_rm_pp32)
|
---|
90 | %endif
|
---|
91 | %if 1
|
---|
92 | call NAME(DoTestsForMode_rm_pae32)
|
---|
93 | %endif
|
---|
94 | %if 1
|
---|
95 | call NAME(DoTestsForMode_rm_lm64)
|
---|
96 | %endif
|
---|
97 |
|
---|
98 | ;
|
---|
99 | ; We're done.
|
---|
100 | ;
|
---|
101 | call TestTerm_r86
|
---|
102 | ret
|
---|
103 |
|
---|
104 | .s_szTstName:
|
---|
105 | db 'tstCpuXcpt1', 0
|
---|
106 | ENDPROC main
|
---|
107 |
|
---|
108 |
|
---|
109 | ;
|
---|
110 | ; Instantiate the template code.
|
---|
111 | ;
|
---|
112 | %include "bootsector2-template-footer.mac" ; reset the initial environemnt.
|
---|
113 |
|
---|
114 | %define TMPL_PE32
|
---|
115 | %include "bootsector2-cpu-xcpt-1-template.mac"
|
---|
116 | %define TMPL_PP32
|
---|
117 | %include "bootsector2-cpu-xcpt-1-template.mac"
|
---|
118 | %define TMPL_PAE32
|
---|
119 | %include "bootsector2-cpu-xcpt-1-template.mac"
|
---|
120 | %define TMPL_LM64
|
---|
121 | %include "bootsector2-cpu-xcpt-1-template.mac"
|
---|
122 |
|
---|
123 |
|
---|
124 | ;
|
---|
125 | ; End sections and image.
|
---|
126 | ;
|
---|
127 | %include "bootsector2-common-end.mac"
|
---|
128 |
|
---|