VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-A20Enable.asm@ 59244

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

bs3kit: Debugged 16-bit paged protected mode switcher, adding missing A20 enabling.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.7 KB
Line 
1; $Id: bs3-cmn-A20Enable.asm 59239 2016-01-01 01:49:33Z vboxsync $
2;; @file
3; BS3Kit - Bs3A20Enable.
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%include "bs3kit-template-header.mac"
28
29
30BS3_EXTERN_CMN Bs3KbdWait
31BS3_EXTERN_CMN Bs3KbdRead
32BS3_EXTERN_CMN Bs3KbdWrite
33
34
35;;
36; Enables the A20 gate.
37;
38; @uses Nothing.
39;
40BS3_PROC_BEGIN_CMN Bs3A20Enable
41 push xBP
42 mov xBP, xSP
43
44 call BS3_CMN_NM(Bs3A20EnableViaPortA)
45;; @todo real 286 support
46; call TMPL_NM_CMN(Bs3A20EnableViaKbd)
47
48 leave
49 ret
50BS3_PROC_END_CMN Bs3A20Enable
51
52
53;;
54; Enables the A20 gate via the keyboard controller.
55;
56; @uses Nothing.
57;
58BS3_PROC_BEGIN_CMN Bs3A20EnableViaKbd
59 push xBP
60 mov xBP, xSP
61 push xAX
62 pushf
63 cli
64
65 call Bs3KbdWait
66 push 0d0h ; KBD_CCMD_READ_OUTPORT
67 call Bs3KbdRead
68
69 or al, 002h
70 push xAX
71 push 0d1h ; KBD_CCMD_WRITE_OUTPORT
72 call Bs3KbdWrite
73
74 add xSP, xCB*3 ; both the above calls
75
76 mov al, 0ffh ; KBD_CMD_RESET
77 out 64h, al
78 call Bs3KbdWait
79
80 popf
81 pop xAX
82 leave
83 ret
84BS3_PROC_END_CMN Bs3A20EnableViaKbd
85
86
87;;
88; Enables the A20 gate via control port A (PS/2 style).
89;
90; @uses Nothing.
91;
92BS3_PROC_BEGIN_CMN Bs3A20EnableViaPortA
93 push xBP
94 mov xBP, xSP
95 push xAX
96
97 ; Use Control port A, assuming a PS/2 style system.
98 in al, 092h
99 test al, 02h
100 jnz .done ; avoid trouble writing back the same value.
101 or al, 2 ; enable the A20 gate.
102 out 092h, al
103
104.done:
105 pop xAX
106 leave
107 ret
108BS3_PROC_END_CMN Bs3A20EnableViaPortA
109
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