GIDForums  

Go Back   GIDForums > Computer Programming Forums > Assembly Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Dec-2008, 22:59
vikramaditya vikramaditya is offline
New Member
 
Join Date: Dec 2008
Posts: 2
vikramaditya is on a distinguished road
Unhappy

Porting from Linux 32 bit to 64 bit


Hey,

i got this piece of code that will detect VMWare but this is for Linux 32 bit:

Code:
int vmInfo, vmVer; asm("mov $0x564D5868, %eax"); /* magic number */ asm("movw $0x0A, %cx"); asm("movw $0x5658, %dx"); /* VMware I/O port */ asm("in %dx, %eax"); //(or outl %eax, %dx) asm("mov %%ebx, %0": "=r"(vmInfo)); asm("movandq %%ecx, %0": "=r"(vmVer));

It works perfectly fine on Linux 32 bit and will generate a crash while implementing "in" command.

I want to make it work on Linux 64 bit. It doesnt crash on 64 bit machine.


The only thing that i could that i came across was to replace eax with rax, ecx and rcx and ebx with rbx. i have tried that but it didn't work.

please help me making it work on Linux 64 bit machine....

Thanks
 
 

Recent GIDBlogProblems with the Navy (Officers) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Remove Linux And Install Windows? rockaway Computer Software Forum - Windows 3 06-Mar-2008 21:00
Help Old Computer Linux Network Planning 6795 Computer Software Forum - Linux 1 09-Dec-2007 21:56
Problem with porting of Linux code to Windows, FORTRAN/C. stormlab C Programming Language 2 15-Oct-2005 03:53
Problem with porting of Linux code to Windows, FORTRAN/C. stormlab Computer Software Forum - Linux 0 14-Oct-2005 12:25
Linux Kernel Upgrade Mini Howto dsmith Computer Software Forum - Linux 3 05-Apr-2004 22:10

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:52.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.