VirtualBox

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

Last change on this file since 66112 was 62484, checked in by vboxsync, 8 years ago

(C) 2016

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1; $Id: bs3-cmn-TestIsVmmDevTestingPresent.asm 62484 2016-07-22 18:35:33Z vboxsync $
2;; @file
3; BS3Kit - bs3TestIsVmmDevTestingPresent
4;
5
6;
7; Copyright (C) 2007-2016 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%include "VBox/VMMDevTesting.mac"
29
30;*********************************************************************************************************************************
31;* External Symbols *
32;*********************************************************************************************************************************
33BS3_EXTERN_DATA16 g_uBs3CpuDetected
34TMPL_BEGIN_TEXT
35
36
37;;
38; @cproto BS3_DECL(bool) bs3TestIsVmmDevTestingPresent_c16(void);
39;
40BS3_PROC_BEGIN_CMN bs3TestIsVmmDevTestingPresent, BS3_PBC_HYBRID_0_ARGS
41 BS3_CALL_CONV_PROLOG 2
42 push xBP
43 mov xBP, xSP
44 push xDX
45
46 ; Check the response from the NOP port.
47 mov dx, VMMDEV_TESTING_IOPORT_NOP
48 cmp byte [g_uBs3CpuDetected], BS3CPU_80386
49 jb .ancient_cpu
50 in eax, dx
51 cmp eax, VMMDEV_TESTING_NOP_RET
52.set_ax_and_return:
53 mov ax, 0
54 jne .return
55 mov ax, 1
56
57.return:
58 pop xDX
59 pop xBP
60 BS3_CALL_CONV_EPILOG 2
61 BS3_HYBRID_RET
62
63.ancient_cpu:
64 in ax, dx
65 cmp ax, (VMMDEV_TESTING_NOP_RET & 0xffff)
66 jmp .set_ax_and_return
67BS3_PROC_END_CMN bs3TestIsVmmDevTestingPresent
68
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