VirtualBox

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

最後變更 在這個檔案從59865是 59287,由 vboxsync 提交於 9 年 前

bs3kit: Working 16 and 64 bit PrintChr system call, fixed/documented 64-bit calls.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.7 KB
 
1; $Id: bs3-first-pe16.asm 59287 2016-01-08 10:08:40Z 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.alldomusa.eu.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%include "bs3kit.mac"
32
33;
34; Segment defs, grouping and related variables.
35; Defines the entry point 'start' as well, leaving us in BS3TEXT16.
36;
37%include "bs3-first-common.mac"
38
39
40;*********************************************************************************************************************************
41;* External Symbols *
42;*********************************************************************************************************************************
43BS3_EXTERN_SYSTEM16 Bs3Lgdt_Gdt
44BS3_EXTERN_SYSTEM16 Bs3Lidt_Idt16
45
46BS3_BEGIN_TEXT16
47EXTERN Main_pe16
48EXTERN Bs3SwitchToPE16_rm
49EXTERN Bs3SwitchToRM_pe16
50EXTERN Bs3SwitchToPE32_rm
51EXTERN Bs3SwitchTo32Bit_c16
52EXTERN Bs3SwitchTo32Bit_c32
53EXTERN Bs3SwitchTo16Bit_c16
54EXTERN Bs3SwitchTo16Bit_c32
55EXTERN Bs3SwitchToPP16_rm
56EXTERN Bs3SwitchToPP32_rm
57EXTERN Bs3SwitchToPAE16_rm
58EXTERN Bs3SwitchToPAE32_rm
59EXTERN Bs3SwitchToLM64_rm
60EXTERN Bs3SwitchToRM_pe32
61EXTERN Bs3SwitchToRM_pp16
62EXTERN Bs3SwitchToRM_pp32
63EXTERN Bs3SwitchToRM_pae16
64EXTERN Bs3SwitchToRM_pae32
65extern Bs3SwitchToRM_lm64
66EXTERN Bs3InitMemory_rm
67BS3_EXTERN_CMN Bs3Shutdown
68BS3_EXTERN_CMN Bs3Trap32Init
69
70extern _Bs3PrintChr_c16
71extern _Bs3PrintChr_c32
72extern Bs3PrintChr_c64
73
74BS3_BEGIN_TEXT16
75 ;
76 ; We need to enter 16-bit protected mode before we can call Main_pe16.
77 ;
78 call NAME(Bs3InitMemory_rm) ; Initialize the memory (must be done from real mode).
79 call Bs3Trap32Init
80 sub xSP, 20h ; for 64-bit calls.
81 call NAME(Bs3SwitchToPE16_rm)
82 push '1'
83 call NAME(Bs3PrintChr_c16)
84
85 call NAME(Bs3SwitchTo32Bit_c16)
86 BS3_SET_BITS 32
87 call NAME(Bs3SwitchTo16Bit_c32)
88 BS3_SET_BITS 16
89 push '2'
90 call NAME(Bs3PrintChr_c16)
91
92 call NAME(Bs3SwitchToRM_pe16)
93
94 call NAME(Bs3SwitchToPE32_rm)
95 BS3_SET_BITS 32
96 push '3'
97 call NAME(Bs3PrintChr_c32)
98 call NAME(Bs3SwitchToRM_pe32)
99 BS3_SET_BITS 16
100 push '4'
101 call NAME(Bs3PrintChr_c16)
102
103 call NAME(Bs3SwitchToPE16_rm)
104 push '5'
105 call NAME(Bs3PrintChr_c16)
106
107 call NAME(Bs3SwitchToRM_pe16)
108 push '6'
109 call NAME(Bs3PrintChr_c16)
110
111 call NAME(Bs3SwitchToPP16_rm)
112 push '7'
113 call NAME(Bs3PrintChr_c16)
114
115 call NAME(Bs3SwitchToRM_pp16)
116 push '8'
117 call NAME(Bs3PrintChr_c16)
118
119 call NAME(Bs3SwitchToPP32_rm)
120 BS3_SET_BITS 32
121 push '9'
122 call NAME(Bs3PrintChr_c32)
123
124 call NAME(Bs3SwitchToRM_pp32)
125 BS3_SET_BITS 16
126 push 'a'
127 call NAME(Bs3PrintChr_c16)
128
129 call NAME(Bs3SwitchToPAE32_rm)
130 BS3_SET_BITS 32
131 push 'b'
132 call NAME(Bs3PrintChr_c32)
133
134 call NAME(Bs3SwitchToRM_pae32)
135 BS3_SET_BITS 16
136 push 'c'
137 call NAME(Bs3PrintChr_c16)
138
139 call NAME(Bs3SwitchToPAE16_rm)
140 push 'd'
141 call NAME(Bs3PrintChr_c16)
142
143 call NAME(Bs3SwitchToRM_pae16)
144 push 'e'
145 call NAME(Bs3PrintChr_c16)
146
147 call NAME(Bs3SwitchToLM64_rm)
148 BS3_SET_BITS 64
149 push 'f'
150 BS3_CALL Bs3PrintChr_c64,1
151
152 call Bs3SwitchToRM_lm64
153 BS3_SET_BITS 16
154 push 'g'
155 call NAME(Bs3PrintChr_c16)
156
157 ;
158 ; Call main, if it returns shutdown the system.
159 ;
160.halt:
161hlt
162jmp .halt
163 call NAME(Main_pe16)
164 call Bs3Shutdown
165
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette