-
October 18th, 2009, 02:53 AM
#1
how to get CPU ID?
How i can get CPU ID.
the OS i use is Fedora 10.
Please rate my post if it was helpful for you. Java, C#, C++, PHP, ASP.NET
SQL Server, MySQL
DirectX
MATH Touraj Ebrahimi
[toraj_e] [at] [yahoo] [dot] [com]
-
October 19th, 2009, 09:49 AM
#2
Re: how to get CPU ID?
CPUid is an optional module in the linux kernel.
http://manpages.courier-mta.org/htmlman4/cpuid.4.html
If you are looking for the Unique processor serial number then this was removed after pentium 3 (Human rights protestors forced intel to remove it on privacy grounds).
Regards
Signature
Please use: [ code ][/ code ] tags and reasonably correct tabbing. They really help us read your code
End Signature
-
October 24th, 2009, 03:55 AM
#3
Re: how to get CPU ID?
thanks for the link.
but i need a solution that i can implement it with both java code and c++.
in my java code i use aspect and i can not invoke c++ dll when i use aspect. so i should write code both in java and c++ that both of them generate same CPU ID or something realted to CPU ID that is unique.
please help me.
Please rate my post if it was helpful for you. Java, C#, C++, PHP, ASP.NET
SQL Server, MySQL
DirectX
MATH Touraj Ebrahimi
[toraj_e] [at] [yahoo] [dot] [com]
-
October 24th, 2009, 07:08 AM
#4
Re: how to get CPU ID?
Originally Posted by toraj58
so i should write code both in java and c++ that both of them generate same CPU ID or something realted to CPU ID that is unique.
Thats exactly what you can't do. Any two processors of the same model will have the same CPUID (unless they're pentium III).
According to Wikipedia (http://en.wikipedia.org/wiki/CPUID#E..._Serial_Number):
The processor serial number was introduced on Intel Pentium III, but due to privacy concern, this feature is no longer implemented on later models (PSN feature bit is always cleared). Transmeta's Efficeon and Crusoe processors also provide this feature. AMD CPUs however, do not implement this feature in any CPU models.
On the off chance that you know the processors you're going to run your code on will support this feature, then you could used the suggested drivers in linux and access the /proc/cpuid file from both java and c++.
Alternative
If you're trying to uniquely identify a computer, you're more likely to be able to do so by taking the hard disk serial number (to avoid ambiguity, try to locate the hard disk containing the root partition). I've never done this myself so Google is your friend here.
Hope this is of some help
Signature
Please use: [ code ][/ code ] tags and reasonably correct tabbing. They really help us read your code
End Signature
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|