How can I get the machine serial number and CPU ID in a Linux system?
Sample code is highly appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is what the Linux kernel seems to use:
which one then can use as e.g.:
Where a good reference on how to use the
CPUIDinstruction is in this Wikipedia article.EDIT The Wikipedia article says that the serial number was introduced with the Pentium III but was not anymore implemented in later models due to privacy concerns. On a Linux system you can check for the presence of this feature (PSN bit) by doing:
if this does not show anything, your system does not support a processor serial number.