summaryrefslogtreecommitdiff
path: root/testing/archboot/vmware-detect.c
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-07-20 23:12:48 +0000
committerroot <root@rshg047.dnsready.net>2011-07-20 23:12:48 +0000
commit34b339c5913a55cb5bac8a502696fcd3f54aac0f (patch)
tree9713cc16d431b99b598b3d019281b713ab07420a /testing/archboot/vmware-detect.c
parent3da6b13f1eb136d0899bd2e8dd217048bb4d9030 (diff)
Wed Jul 20 23:12:48 UTC 2011
Diffstat (limited to 'testing/archboot/vmware-detect.c')
-rw-r--r--testing/archboot/vmware-detect.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/archboot/vmware-detect.c b/testing/archboot/vmware-detect.c
new file mode 100644
index 000000000..d242a388d
--- /dev/null
+++ b/testing/archboot/vmware-detect.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+int main() {
+ unsigned char idtr[6];
+ asm("sidt %0" : "=m" (idtr));
+ if(0xff==idtr[5])
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+}