VirtualBox

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

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

bs3kit: untested paged protected mode switch code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1; $Id: bs3-first-pe16.asm 59237 2015-12-31 21:47:49Z 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%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 Bs3SwitchToRM_pe32
57EXTERN Bs3InitMemory_rm
58BS3_EXTERN_CMN Bs3Shutdown
59
60extern _Bs3Printf_c32
61extern Bs3Printf_c64
62
63BS3_BEGIN_TEXT16
64 ;
65 ; We need to enter 16-bit protected mode before we can call Main_pe16.
66 ;
67 call NAME(Bs3InitMemory_rm) ; Initialize the memory (must be done from real mode).
68 call NAME(Bs3SwitchToPE16_rm)
69
70 call NAME(Bs3SwitchTo32Bit_c16)
71 BS3_SET_BITS 32
72 call NAME(Bs3SwitchTo16Bit_c32)
73 BS3_SET_BITS 16
74
75 call NAME(Bs3SwitchToRM_pe16)
76
77 call NAME(Bs3SwitchToPE32_rm)
78 BS3_SET_BITS 32
79 call NAME(Bs3SwitchToRM_pe32)
80 BS3_SET_BITS 16
81 call NAME(Bs3SwitchToPE16_rm)
82
83 call NAME(Bs3SwitchToPP16_rm)
84
85 ;
86 ; Call main, if it returns shutdown the system.
87 ;
88.halt: hlt
89jmp .halt
90 call NAME(Main_pe16)
91 call Bs3Shutdown
92
Note: See TracBrowser for help on using the repository browser.

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