1 | /* $Id: Global.cpp 15064 2008-12-07 15:34:34Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VirtualBox COM global definitions
|
---|
6 | *
|
---|
7 | * NOTE: This file is part of both VBoxC.dll and VBoxSVC.exe.
|
---|
8 | */
|
---|
9 |
|
---|
10 | /*
|
---|
11 | * Copyright (C) 2008 Sun Microsystems, Inc.
|
---|
12 | *
|
---|
13 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
14 | * available from http://www.virtualbox.org. This file is free software;
|
---|
15 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
16 | * General Public License (GPL) as published by the Free Software
|
---|
17 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
18 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
19 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
20 | *
|
---|
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
22 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
23 | * additional information or have any questions.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #include "Global.h"
|
---|
27 |
|
---|
28 | #include <iprt/assert.h>
|
---|
29 |
|
---|
30 | /* static */
|
---|
31 | const Global::OSType Global::sOSTypes [SchemaDefs::OSTypeId_COUNT] =
|
---|
32 | {
|
---|
33 | /* NOTE1: we assume that unknown is always the first entry!
|
---|
34 | * NOTE2: please use powers of 2 when specifying the size of harddisks since
|
---|
35 | * '2GB' looks better than '1.95GB' (= 2000MB) */
|
---|
36 | { "Other", "Other", SchemaDefs_OSTypeId_Other, "Other/Unknown",
|
---|
37 | VBOXOSTYPE_Unknown, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
38 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows31, "Windows 3.1",
|
---|
39 | VBOXOSTYPE_Win31, VBOXOSHINT_NONE, 32, 4, 1 * _1K, NetworkAdapterType_Am79C973 },
|
---|
40 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows95, "Windows 95",
|
---|
41 | VBOXOSTYPE_Win95, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
42 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows98, "Windows 98",
|
---|
43 | VBOXOSTYPE_Win98, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
44 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsMe, "Windows Me",
|
---|
45 | VBOXOSTYPE_WinMe, VBOXOSHINT_NONE, 64, 4, 4 * _1K, NetworkAdapterType_Am79C973 },
|
---|
46 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsNT4, "Windows NT 4",
|
---|
47 | VBOXOSTYPE_WinNT4, VBOXOSHINT_NONE, 128, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
48 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2000, "Windows 2000",
|
---|
49 | VBOXOSTYPE_Win2k, VBOXOSHINT_NONE, 168, 12, 4 * _1K, NetworkAdapterType_Am79C973 },
|
---|
50 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsXP, "Windows XP",
|
---|
51 | VBOXOSTYPE_WinXP, VBOXOSHINT_NONE, 192, 12, 10 * _1K, NetworkAdapterType_Am79C973 },
|
---|
52 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsXP_64, "Windows XP (64 bit)",
|
---|
53 | VBOXOSTYPE_WinXP_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 192, 12, 10 * _1K, NetworkAdapterType_I82540EM },
|
---|
54 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2003, "Windows 2003",
|
---|
55 | VBOXOSTYPE_Win2k3, VBOXOSHINT_NONE, 256, 12, 20 * _1K, NetworkAdapterType_Am79C973 },
|
---|
56 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2003_64, "Windows 2003 (64 bit)",
|
---|
57 | VBOXOSTYPE_Win2k3_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 20 * _1K, NetworkAdapterType_I82540EM },
|
---|
58 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsVista, "Windows Vista",
|
---|
59 | VBOXOSTYPE_WinVista, VBOXOSHINT_NONE, 512, 12, 20 * _1K, NetworkAdapterType_Am79C973 },
|
---|
60 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsVista_64, "Windows Vista (64 bit)",
|
---|
61 | VBOXOSTYPE_WinVista_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 512, 12, 20 * _1K, NetworkAdapterType_I82540EM },
|
---|
62 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2008, "Windows 2008",
|
---|
63 | VBOXOSTYPE_Win2k8, VBOXOSHINT_NONE, 512, 12, 20 * _1K, NetworkAdapterType_Am79C973 },
|
---|
64 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_Windows2008_64, "Windows 2008 (64 bit)",
|
---|
65 | VBOXOSTYPE_Win2k8_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 512, 12, 20 * _1K, NetworkAdapterType_I82540EM },
|
---|
66 | { "Windows", "Microsoft Windows", SchemaDefs_OSTypeId_WindowsNT, "Other Windows",
|
---|
67 | VBOXOSTYPE_WinNT, VBOXOSHINT_NONE, 512, 12, 20 * _1K, NetworkAdapterType_Am79C973 },
|
---|
68 | { "Linux", "Linux", SchemaDefs_OSTypeId_Linux22, "Linux 2.2",
|
---|
69 | VBOXOSTYPE_Linux22, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
70 | { "Linux", "Linux", SchemaDefs_OSTypeId_Linux24, "Linux 2.4",
|
---|
71 | VBOXOSTYPE_Linux24, VBOXOSHINT_NONE, 128, 4, 4 * _1K, NetworkAdapterType_Am79C973 },
|
---|
72 | { "Linux", "Linux", SchemaDefs_OSTypeId_Linux24_64, "Linux 2.4 (64 bit)",
|
---|
73 | VBOXOSTYPE_Linux24_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 128, 4, 4 * _1K, NetworkAdapterType_I82540EM },
|
---|
74 | { "Linux", "Linux", SchemaDefs_OSTypeId_Linux26, "Linux 2.6",
|
---|
75 | VBOXOSTYPE_Linux26, VBOXOSHINT_NONE, 256, 4, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
76 | { "Linux", "Linux", SchemaDefs_OSTypeId_Linux26_64, "Linux 2.6 (64 bit)",
|
---|
77 | VBOXOSTYPE_Linux26_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 4, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
78 | { "Linux", "Linux", SchemaDefs_OSTypeId_ArchLinux, "Arch Linux",
|
---|
79 | VBOXOSTYPE_ArchLinux, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
80 | { "Linux", "Linux", SchemaDefs_OSTypeId_ArchLinux_64, "Arch Linux (64 bit)",
|
---|
81 | VBOXOSTYPE_ArchLinux_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
82 | { "Linux", "Linux", SchemaDefs_OSTypeId_Debian, "Debian",
|
---|
83 | VBOXOSTYPE_Debian, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
84 | { "Linux", "Linux", SchemaDefs_OSTypeId_Debian_64, "Debian (64 bit)",
|
---|
85 | VBOXOSTYPE_Debian_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
86 | { "Linux", "Linux", SchemaDefs_OSTypeId_OpenSUSE, "openSUSE",
|
---|
87 | VBOXOSTYPE_OpenSUSE, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
88 | { "Linux", "Linux", SchemaDefs_OSTypeId_OpenSUSE_64, "openSUSE (64 bit)",
|
---|
89 | VBOXOSTYPE_OpenSUSE_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
90 | { "Linux", "Linux", SchemaDefs_OSTypeId_Fedora, "Fedora",
|
---|
91 | VBOXOSTYPE_FedoraCore, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
92 | { "Linux", "Linux", SchemaDefs_OSTypeId_Fedora_64, "Fedora (64 bit)",
|
---|
93 | VBOXOSTYPE_FedoraCore_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
94 | { "Linux", "Linux", SchemaDefs_OSTypeId_Gentoo, "Gentoo",
|
---|
95 | VBOXOSTYPE_Gentoo, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
96 | { "Linux", "Linux", SchemaDefs_OSTypeId_Gentoo_64, "Gentoo (64 bit)",
|
---|
97 | VBOXOSTYPE_Gentoo_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
98 | { "Linux", "Linux", SchemaDefs_OSTypeId_Mandriva, "Mandriva",
|
---|
99 | VBOXOSTYPE_Mandriva, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
100 | { "Linux", "Linux", SchemaDefs_OSTypeId_Mandriva_64, "Mandriva (64 bit)",
|
---|
101 | VBOXOSTYPE_Mandriva_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
102 | { "Linux", "Linux", SchemaDefs_OSTypeId_RedHat, "Red Hat",
|
---|
103 | VBOXOSTYPE_RedHat, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
104 | { "Linux", "Linux", SchemaDefs_OSTypeId_RedHat_64, "Red Hat (64 bit)",
|
---|
105 | VBOXOSTYPE_RedHat_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
106 | { "Linux", "Linux", SchemaDefs_OSTypeId_Ubuntu, "Ubuntu",
|
---|
107 | VBOXOSTYPE_Ubuntu, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
108 | { "Linux", "Linux", SchemaDefs_OSTypeId_Ubuntu_64, "Ubuntu (64 bit)",
|
---|
109 | VBOXOSTYPE_Ubuntu_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
110 | { "Linux", "Linux", SchemaDefs_OSTypeId_Xandros, "Xandros",
|
---|
111 | VBOXOSTYPE_Xandros, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
112 | { "Linux", "Linux", SchemaDefs_OSTypeId_Xandros_64, "Xandros (64 bit)",
|
---|
113 | VBOXOSTYPE_Xandros_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 256, 12, 8 * _1K, NetworkAdapterType_I82540EM },
|
---|
114 | { "Linux", "Linux", SchemaDefs_OSTypeId_Linux, "Other Linux",
|
---|
115 | VBOXOSTYPE_Linux, VBOXOSHINT_NONE, 256, 12, 8 * _1K, NetworkAdapterType_Am79C973 },
|
---|
116 | { "Solaris", "Solaris", SchemaDefs_OSTypeId_Solaris, "Solaris",
|
---|
117 | VBOXOSTYPE_Solaris, VBOXOSHINT_NONE, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM },
|
---|
118 | { "Solaris", "Solaris", SchemaDefs_OSTypeId_Solaris_64, "Solaris (64 bit)",
|
---|
119 | VBOXOSTYPE_Solaris_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM },
|
---|
120 | { "Solaris", "Solaris", SchemaDefs_OSTypeId_OpenSolaris, "OpenSolaris",
|
---|
121 | VBOXOSTYPE_OpenSolaris, VBOXOSHINT_NONE, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM },
|
---|
122 | { "Solaris", "Solaris", SchemaDefs_OSTypeId_OpenSolaris_64, "OpenSolaris (64 bit)",
|
---|
123 | VBOXOSTYPE_OpenSolaris_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 512, 12, 16 * _1K, NetworkAdapterType_I82540EM },
|
---|
124 | { "BSD", "BSD", SchemaDefs_OSTypeId_FreeBSD, "FreeBSD",
|
---|
125 | VBOXOSTYPE_FreeBSD, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
126 | { "BSD", "BSD", SchemaDefs_OSTypeId_FreeBSD_64, "FreeBSD (64 bit)",
|
---|
127 | VBOXOSTYPE_FreeBSD_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 64, 4, 2 * _1K, NetworkAdapterType_I82540EM },
|
---|
128 | { "BSD", "BSD", SchemaDefs_OSTypeId_OpenBSD, "OpenBSD",
|
---|
129 | VBOXOSTYPE_OpenBSD, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
130 | { "BSD", "BSD", SchemaDefs_OSTypeId_OpenBSD_64, "OpenBSD (64 bit)",
|
---|
131 | VBOXOSTYPE_OpenBSD_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 64, 4, 2 * _1K, NetworkAdapterType_I82540EM },
|
---|
132 | { "BSD", "BSD", SchemaDefs_OSTypeId_NetBSD, "NetBSD",
|
---|
133 | VBOXOSTYPE_NetBSD, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
134 | { "BSD", "BSD", SchemaDefs_OSTypeId_NetBSD_64, "NetBSD (64 bit)",
|
---|
135 | VBOXOSTYPE_NetBSD_x64, VBOXOSHINT_64BIT | VBOXOSHINT_HWVIRTEX | VBOXOSHINT_IOAPIC, 64, 4, 2 * _1K, NetworkAdapterType_I82540EM },
|
---|
136 | { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp3, "OS/2 Warp 3",
|
---|
137 | VBOXOSTYPE_OS2Warp3, VBOXOSHINT_HWVIRTEX, 48, 4, 1 * _1K, NetworkAdapterType_Am79C973 },
|
---|
138 | { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp4, "OS/2 Warp 4",
|
---|
139 | VBOXOSTYPE_OS2Warp4, VBOXOSHINT_HWVIRTEX, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
140 | { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2Warp45, "OS/2 Warp 4.5",
|
---|
141 | VBOXOSTYPE_OS2Warp45, VBOXOSHINT_HWVIRTEX, 96, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
142 | { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2eCS, "eComStation",
|
---|
143 | VBOXOSTYPE_ECS, VBOXOSHINT_HWVIRTEX, 96, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
144 | { "OS2", "IBM OS/2", SchemaDefs_OSTypeId_OS2, "Other OS/2",
|
---|
145 | VBOXOSTYPE_OS2, VBOXOSHINT_HWVIRTEX, 96, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
146 | { "Other", "Other", SchemaDefs_OSTypeId_DOS, "DOS",
|
---|
147 | VBOXOSTYPE_DOS, VBOXOSHINT_NONE, 32, 4, 512, NetworkAdapterType_Am79C973 },
|
---|
148 | { "Other", "Other", SchemaDefs_OSTypeId_Netware, "Netware",
|
---|
149 | VBOXOSTYPE_Netware, VBOXOSHINT_NONE, 512, 4, 4 * _1K, NetworkAdapterType_Am79C973 },
|
---|
150 | { "Other", "Other", SchemaDefs_OSTypeId_L4, "L4",
|
---|
151 | VBOXOSTYPE_L4, VBOXOSHINT_NONE, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 },
|
---|
152 | { "Other", "Other", SchemaDefs_OSTypeId_QNX, "QNX",
|
---|
153 | VBOXOSTYPE_QNX, VBOXOSHINT_HWVIRTEX, 64, 4, 2 * _1K, NetworkAdapterType_Am79C973 }
|
---|
154 | };
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * Returns an OS Type ID for the given VBOXOSTYPE value.
|
---|
158 | *
|
---|
159 | * The returned ID will correspond to the IGuestOSType::id value of one of the
|
---|
160 | * objects stored in the IVirtualBox::guestOSTypes
|
---|
161 | * (VirtualBoxImpl::COMGETTER(GuestOSTypes)) collection.
|
---|
162 | */
|
---|
163 | /* static */
|
---|
164 | const char *Global::OSTypeId (VBOXOSTYPE aOSType)
|
---|
165 | {
|
---|
166 | for (size_t i = 0; i < RT_ELEMENTS (sOSTypes); ++ i)
|
---|
167 | {
|
---|
168 | if (sOSTypes [i].osType == aOSType)
|
---|
169 | return sOSTypes [i].id;
|
---|
170 | }
|
---|
171 |
|
---|
172 | AssertMsgFailed (("No record for VBOXOSTYPE %d\n", aOSType));
|
---|
173 | return sOSTypes [0].id;
|
---|
174 | }
|
---|
175 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|