VirtualBox

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

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

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

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1; $Id: bs3-cmn-A20Disable.asm 59287 2016-01-08 10:08:40Z vboxsync $
2;; @file
3; BS3Kit - Bs3A20Disable.
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; Disables the A20 gate.
37;
38; @uses Nothing.
39;
40BS3_PROC_BEGIN_CMN Bs3A20Disable
41 ; Must call both because they may be ORed together on real HW.
42 BS3_ONLY_64BIT_STMT sub rsp, 20h
43 call BS3_CMN_NM(Bs3A20DisableViaKbd)
44 call BS3_CMN_NM(Bs3A20DisableViaPortA)
45 BS3_ONLY_64BIT_STMT add rsp, 20h
46 ret
47BS3_PROC_END_CMN Bs3A20Disable
48
49
50;;
51; Disables the A20 gate via control port A (PS/2 style).
52;
53; @uses Nothing.
54;
55BS3_PROC_BEGIN_CMN Bs3A20DisableViaPortA
56 push xAX
57
58 ; Use Control port A, assuming a PS/2 style system.
59 in al, 092h
60 test al, 02h
61 jz .done ; avoid trouble writing back the same value.
62 and al, 0fdh ; disable the A20 gate.
63 out 092h, al
64
65.done:
66 pop xAX
67 ret
68BS3_PROC_END_CMN Bs3A20DisableViaPortA
69
70
71;;
72; Disables the A20 gate via the keyboard controller.
73;
74; @uses Nothing.
75;
76BS3_PROC_BEGIN_CMN Bs3A20DisableViaKbd
77 push xBP
78 mov xBP, xSP
79 push xAX
80 pushf
81 cli
82 BS3_ONLY_64BIT_STMT sub rsp, 20h
83
84 call Bs3KbdWait
85 push 0d0h ; KBD_CCMD_READ_OUTPORT
86 call Bs3KbdRead
87
88 and al, 0fdh ; ~2
89 push xAX
90 push 0d1h ; KBD_CCMD_WRITE_OUTPORT
91 call Bs3KbdWrite
92
93 add xSP, xCB*3 ; Clean up both the above calls.
94
95 mov al, 0ffh ; KBD_CMD_RESET
96 out 64h, al
97 call Bs3KbdWait
98
99 BS3_ONLY_64BIT_STMT add rsp, 20h
100 popf
101 pop xAX
102 leave
103 ret
104BS3_PROC_END_CMN Bs3A20DisableViaKbd
105
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