VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-first-pe16.asm@ 60539

Last change on this file since 60539 was 60539, checked in by vboxsync, 9 years ago

bs3kit: Updates.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 KB
Line 
1; $Id: bs3-first-pe16.asm 60539 2016-04-18 14:09:39Z vboxsync $
2;; @file
3; BS3Kit - First Object, calling real-mode main().
4;
5
6;
7; Copyright (C) 2007-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
28;*********************************************************************************************************************************
29;* Header Files *
30;*********************************************************************************************************************************
31
32;
33; Segment defs, grouping and related variables.
34; Defines the entry point 'start' as well, leaving us in BS3TEXT16.
35;
36%include "bs3-first-common.mac"
37
38
39;*********************************************************************************************************************************
40;* External Symbols *
41;*********************************************************************************************************************************
42BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt
43BS3_EXTERN_SYSTEM16 Bs3Lidt_Idt16
44
45extern Bs3SelProtFar32ToFlat32_c64
46extern Bs3PrintChr_c64
47extern Bs3Printf_c64
48extern Bs3TestTerm_c64
49extern Bs3TestSub_c64
50extern Bs3TestInit_c64
51
52BS3_BEGIN_TEXT16
53EXTERN Bs3InitMemory_rm
54
55%if 0
56EXTERN Main_pe16
57EXTERN Bs3SwitchToPE16_rm
58EXTERN Bs3SwitchToRM_pe16
59EXTERN Bs3SwitchToPE32_rm
60EXTERN Bs3SwitchTo32Bit_c16
61EXTERN Bs3SwitchTo32Bit_c32
62EXTERN Bs3SwitchTo16Bit_c16
63EXTERN Bs3SwitchTo16Bit_c32
64EXTERN Bs3SwitchToPP16_rm
65EXTERN Bs3SwitchToPP32_rm
66EXTERN Bs3SwitchToPAE16_rm
67EXTERN Bs3SwitchToPAE32_rm
68EXTERN Bs3SwitchToLM64_rm
69EXTERN Bs3SwitchToRM_pe32
70EXTERN Bs3SwitchToRM_pp16
71EXTERN Bs3SwitchToRM_pp32
72EXTERN Bs3SwitchToRM_pae16
73EXTERN Bs3SwitchToRM_pae32
74extern Bs3SwitchToRM_lm64
75extern _Bs3PrintChr_c16
76extern _Bs3PrintChr_c32
77extern Bs3PrintChr_c64
78%endif
79
80BS3_EXTERN_CMN Bs3Shutdown
81BS3_EXTERN_CMN Bs3Trap32Init
82
83
84BS3_BEGIN_TEXT16
85 ;
86 ; We need to enter 16-bit protected mode before we can call Main_pe16.
87 ;
88 call NAME(Bs3InitMemory_rm) ; Initialize the memory (must be done from real mode).
89 call Bs3Trap32Init
90 sub xSP, 20h ; for 64-bit calls.
91%if 0
92 call NAME(Bs3SwitchToPE16_rm)
93 push '1'
94 call NAME(Bs3PrintChr_c16)
95
96 call NAME(Bs3SwitchTo32Bit_c16)
97 BS3_SET_BITS 32
98 call NAME(Bs3SwitchTo16Bit_c32)
99 BS3_SET_BITS 16
100 push '2'
101 call NAME(Bs3PrintChr_c16)
102
103 call NAME(Bs3SwitchToRM_pe16)
104
105 call NAME(Bs3SwitchToPE32_rm)
106 BS3_SET_BITS 32
107 push '3'
108 call NAME(Bs3PrintChr_c32)
109 call NAME(Bs3SwitchToRM_pe32)
110 BS3_SET_BITS 16
111 push '4'
112 call NAME(Bs3PrintChr_c16)
113
114 call NAME(Bs3SwitchToPE16_rm)
115 push '5'
116 call NAME(Bs3PrintChr_c16)
117
118 call NAME(Bs3SwitchToRM_pe16)
119 push '6'
120 call NAME(Bs3PrintChr_c16)
121
122 call NAME(Bs3SwitchToPP16_rm)
123 push '7'
124 call NAME(Bs3PrintChr_c16)
125
126 call NAME(Bs3SwitchToRM_pp16)
127 push '8'
128 call NAME(Bs3PrintChr_c16)
129
130 call NAME(Bs3SwitchToPP32_rm)
131 BS3_SET_BITS 32
132 push '9'
133 call NAME(Bs3PrintChr_c32)
134
135 call NAME(Bs3SwitchToRM_pp32)
136 BS3_SET_BITS 16
137 push 'a'
138 call NAME(Bs3PrintChr_c16)
139
140 call NAME(Bs3SwitchToPAE32_rm)
141 BS3_SET_BITS 32
142 push 'b'
143 call NAME(Bs3PrintChr_c32)
144
145 call NAME(Bs3SwitchToRM_pae32)
146 BS3_SET_BITS 16
147 push 'c'
148 call NAME(Bs3PrintChr_c16)
149
150 call NAME(Bs3SwitchToPAE16_rm)
151 push 'd'
152 call NAME(Bs3PrintChr_c16)
153
154 call NAME(Bs3SwitchToRM_pae16)
155 push 'e'
156 call NAME(Bs3PrintChr_c16)
157
158 call NAME(Bs3SwitchToLM64_rm)
159 BS3_SET_BITS 64
160 push 'f'
161 BS3_CALL Bs3PrintChr_c64,1
162
163 call Bs3SwitchToRM_lm64
164 BS3_SET_BITS 16
165 push 'g'
166 call NAME(Bs3PrintChr_c16)
167%endif
168
169 ;
170 ; Call main, if it returns shutdown the system.
171 ;
172.halt:
173hlt
174jmp .halt
175; call NAME(Main_pe16)
176 call Bs3Shutdown
177
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