1 | ; $Id: bootsector2-api.mac 69111 2017-10-17 14:26:02Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; Bootsector2 API definition for use by split images (kernel < 1MB < image).
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2007-2017 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 | %ifndef ___bootsector2_api_mac
|
---|
28 | %define ___bootsector2_api_mac
|
---|
29 |
|
---|
30 | ;*******************************************************************************
|
---|
31 | ;* Header Files *
|
---|
32 | ;*******************************************************************************
|
---|
33 | %include "iprt/asmdefs.mac"
|
---|
34 | %include "iprt/x86.mac"
|
---|
35 | %include "bootsector2-structures.mac"
|
---|
36 |
|
---|
37 | ;;
|
---|
38 | ; The load address for big images.
|
---|
39 | %define BS2_BIG_LOAD_ADDR 0x120000
|
---|
40 |
|
---|
41 |
|
---|
42 | ;;
|
---|
43 | ; API Template for lazy birds.
|
---|
44 | ;
|
---|
45 | %macro BS2_API_TEMPLATE 0,
|
---|
46 |
|
---|
47 | BS2_API_TEMPLATE_ACTION(Bs2DisableA20)
|
---|
48 | BS2_API_TEMPLATE_ACTION(Bs2DisableA20ViaKbd)
|
---|
49 | BS2_API_TEMPLATE_ACTION(Bs2DisableA20ViaPortA)
|
---|
50 | BS2_API_TEMPLATE_ACTION(Bs2DisableNX)
|
---|
51 | BS2_API_TEMPLATE_ACTION(Bs2EnableA20)
|
---|
52 | BS2_API_TEMPLATE_ACTION(Bs2EnableA20ViaKbd)
|
---|
53 | BS2_API_TEMPLATE_ACTION(Bs2EnableA20ViaPortA)
|
---|
54 | BS2_API_TEMPLATE_ACTION(Bs2EnableNX)
|
---|
55 | BS2_API_TEMPLATE_ACTION(Bs2IsNXSupported)
|
---|
56 | BS2_API_TEMPLATE_ACTION(Bs2KbdRead)
|
---|
57 | BS2_API_TEMPLATE_ACTION(Bs2KbdWait)
|
---|
58 | BS2_API_TEMPLATE_ACTION(Bs2KbdWrite)
|
---|
59 | BS2_API_TEMPLATE_ACTION(Bs2PanicIfVMMDevTestingIsMissing)
|
---|
60 | BS2_API_TEMPLATE_ACTION(Bs2SetupNX)
|
---|
61 | BS2_API_TEMPLATE_ACTION(CalcBenchmarkIterations)
|
---|
62 | BS2_API_TEMPLATE_ACTION(CalcTestPerSecond)
|
---|
63 | BS2_API_TEMPLATE_ACTION(GetElapsedNanoTS)
|
---|
64 | BS2_API_TEMPLATE_ACTION(GetNanoTS)
|
---|
65 | BS2_API_TEMPLATE_ACTION(PrintChr)
|
---|
66 | BS2_API_TEMPLATE_ACTION(PrintF)
|
---|
67 | BS2_API_TEMPLATE_ACTION(PrintStr)
|
---|
68 | BS2_API_TEMPLATE_ACTION(PrintStrColonSpaces)
|
---|
69 | BS2_API_TEMPLATE_ACTION(PrintStrSpacesColonSpace)
|
---|
70 | BS2_API_TEMPLATE_ACTION(PrintU32)
|
---|
71 | BS2_API_TEMPLATE_ACTION(ReportResult)
|
---|
72 | BS2_API_TEMPLATE_ACTION(Shutdown)
|
---|
73 | BS2_API_TEMPLATE_ACTION(StrFormatF)
|
---|
74 | BS2_API_TEMPLATE_ACTION(StrFormatV)
|
---|
75 | BS2_API_TEMPLATE_ACTION(StrLen)
|
---|
76 | BS2_API_TEMPLATE_ACTION(TestCheckTrap)
|
---|
77 | BS2_API_TEMPLATE_ACTION(TestDumpCurrentRegisters)
|
---|
78 | BS2_API_TEMPLATE_ACTION(TestDumpRegisters)
|
---|
79 | BS2_API_TEMPLATE_ACTION(TestFailed)
|
---|
80 | BS2_API_TEMPLATE_ACTION(TestFailedF)
|
---|
81 | BS2_API_TEMPLATE_ACTION(TestInit)
|
---|
82 | BS2_API_TEMPLATE_ACTION(TestRestoreRegisters)
|
---|
83 | BS2_API_TEMPLATE_ACTION(TestSaveRegisters)
|
---|
84 | BS2_API_TEMPLATE_ACTION(testSendStrCmd)
|
---|
85 | BS2_API_TEMPLATE_ACTION(TestSkipped)
|
---|
86 | BS2_API_TEMPLATE_ACTION(TestSub)
|
---|
87 | BS2_API_TEMPLATE_ACTION(testSubCleanup)
|
---|
88 | BS2_API_TEMPLATE_ACTION(TestSubDone)
|
---|
89 | BS2_API_TEMPLATE_ACTION(TestSubErrorCount)
|
---|
90 | BS2_API_TEMPLATE_ACTION(TestTerm)
|
---|
91 | BS2_API_TEMPLATE_ACTION(TestValueReg)
|
---|
92 | BS2_API_TEMPLATE_ACTION(TestValueU32)
|
---|
93 | BS2_API_TEMPLATE_ACTION(TestInstallTrapRecs)
|
---|
94 |
|
---|
95 | %endmacro
|
---|
96 |
|
---|
97 |
|
---|
98 | ;;
|
---|
99 | ; This defines the API pointers.
|
---|
100 | ;
|
---|
101 | ABSOLUTE 0x500
|
---|
102 | ;; Start the structure with a magic number.
|
---|
103 | NAME(g_u32Bs2ApiMagic): resd 1
|
---|
104 | ;; And a version number.
|
---|
105 | NAME(g_u32Bs2ApiVersion): resd 1
|
---|
106 |
|
---|
107 | ; The real mode and v8086 mode entry points (far pointers).
|
---|
108 | %undef BS2_API_TEMPLATE_ACTION
|
---|
109 | %define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _r86): resd 1
|
---|
110 | BS2_API_TEMPLATE
|
---|
111 |
|
---|
112 | ; The 16-bit protected mode entry points (far pointers).
|
---|
113 | %undef BS2_API_TEMPLATE_ACTION
|
---|
114 | %define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _p16): resd 1
|
---|
115 | BS2_API_TEMPLATE
|
---|
116 |
|
---|
117 | ; The 32-bit protected mode entry points (flat pointers).
|
---|
118 | %undef BS2_API_TEMPLATE_ACTION
|
---|
119 | %define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _p32): resd 1
|
---|
120 | BS2_API_TEMPLATE
|
---|
121 |
|
---|
122 | ; The 64-bit protected (long) mode entry points.
|
---|
123 | %undef BS2_API_TEMPLATE_ACTION
|
---|
124 | %define BS2_API_TEMPLATE_ACTION(a_Name) NAME(g_pfn %+ a_Name %+ _p64): resq 1
|
---|
125 | BS2_API_TEMPLATE
|
---|
126 |
|
---|
127 | ;; End the structure with a magic so it's integrity can be verified.
|
---|
128 | NAME(g_u32Bs2ApiEndMagic) resd 1
|
---|
129 |
|
---|
130 | ;;
|
---|
131 | ; The current API magic value (Douglas Carl Engelbart).
|
---|
132 | %define BS2_API_MAGIC 0x19250130
|
---|
133 |
|
---|
134 | ;;
|
---|
135 | ; The current API version.
|
---|
136 | %define BS2_API_VERSION 0x00010000
|
---|
137 |
|
---|
138 | BEGINCODE
|
---|
139 |
|
---|
140 |
|
---|
141 | ;; @name Service trap vector interface.
|
---|
142 | ; @{
|
---|
143 | %define BS2_SYSCALL_TO_RING0 0
|
---|
144 | %define BS2_SYSCALL_TO_RING1 1
|
---|
145 | %define BS2_SYSCALL_TO_RING2 2
|
---|
146 | %define BS2_SYSCALL_TO_RING3 3
|
---|
147 |
|
---|
148 | ;; The service vector.
|
---|
149 | %define BS2_TRAP_SYSCALL 20h
|
---|
150 | ;; @}
|
---|
151 |
|
---|
152 | %endif
|
---|