tycho / cpuid Goto Github PK
View Code? Open in Web Editor NEWA simple CPUID decoder/dumper for x86/x86_64
License: ISC License
A simple CPUID decoder/dumper for x86/x86_64
License: ISC License
Can we cross compile the cpuid tool for arm64 architecture ??
Last week I used you project as an alternative to the CPUID functionality included into AIDA64.
Today I learned that there two different projects using the same name, another one being https://www.etallen.com/cpuid.html (under the GPL v2).
Now as it was born some years earlier:
Mon Feb 6 2006 Todd Allen <[email protected]>
* Initial public release.
... and is included into at least Debian (IIRC), I guess something need to be done about the situation.
I doubt both project will merge. I think it would be nice to adjust name of the newer project, this repo.
At least this project seems to be cross-platform, so maybe it could be renamed into cross-cpuid
, cpuid-new
or something alike?
I would be helpful to have cpuid
man page.
I created one for the OpenIndiana project based on your README.md
: OpenIndiana/oi-userland#4345
The source is cpuid.ronn
which can be parsed via ronn to cpuid.1
. The latter one can be edited manually as well.
[sanity.c:252]: (error) Memory leak: apic_ids
[sanity.c:252]: (error) Memory leak: apic_copy
Hello,
I have an issue building the tool:
$ make
GEN license.h
GEN build.h
* rebuilding cpuid: new build flags or prefix
CC cache.o
CC clock.o
CC cpuid.o
CC feature.o
CC handlers.o
CC main.o
CC sanity.o
CC threads.o
CC util.o
CC version.o
LD cpuid
/bin/ld: cache.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/bin/ld: cpuid.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/bin/ld: feature.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/bin/ld: handlers.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/bin/ld: main.o: relocation R_X86_64_32S against symbol `cpuid_dump_normal' can not be used when making a shared object; recompile with -fPIC
/bin/ld: sanity.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/bin/ld: threads.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/bin/ld: version.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make[1]: *** [GNUmakefile:130: cpuid] Error 1
make: *** [GNUmakefile:52: top-level-make] Error 2
Here are the version I am using on my tools:
$ gcc --version
gcc (GCC) 7.2.1 20171224
$ ld --version
GNU ld (GNU Binutils) 2.29.1
$ make --version
GNU Make 4.2.1
$ perl --version
This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-thread-multi
I tried to append the -fPIC
flag to the CFLAGS
variable in the GNUmakefile but that did not solve the issue.
However after another test, I noticed that there is a line explicitly removing the -fPIC
option (https://github.com/tycho/cpuid/blob/master/GNUmakefile#L77)
By changing it to -fPIC
I could build properly.
Is it possible to output whether the CPU supports TSC non-stop (see http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/#311-cpu-tsc-capabilities )?
how to compile to support both i386 & x64bit?
Thanks
In handlers.c, the functions handle_dump_std_0F and handle_dump_std_10 both read EAX 0xf, so it's not dumping cpuid 0x10, and is dumping 0xf twice.
Hi Steven,
If I didn't miss it, any chance you could add 0x80000008 EBX for AMD?
see: http://elixir.free-electrons.com/linux/v4.15-rc9/source/arch/x86/include/asm/cpufeatures.h
/* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
#define X86_FEATURE_CLZERO (13*32+ 0) /* CLZERO instruction */
#define X86_FEATURE_IRPERF (13*32+ 1) /* Instructions Retired Count */
#define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* Always save/restore FP error pointers */
and: http://support.amd.com/TechDocs/54945_PPR_Family_17h_Models_00h-0Fh.pdf
under: CPUID_Fn80000008_EBX [Extended Feature Extensions ID EBX] (FeatureExtIdEbx)
Much obliged!
1>------ Rebuild All started: Project: CPUID, Configuration: Debug Win32 ------
1> prefix.c
1> version.c
1> util.c
1> threads.c
1> sanity.c
1>g:\projects\macsfancontrol\cpuid-master\clock.h(29): error C2065: '__asm__' : undeclared identifier
1>g:\projects\macsfancontrol\cpuid-master\clock.h(29): error C2146: syntax error : missing ';' before identifier '__volatile__'
1>g:\projects\macsfancontrol\cpuid-master\clock.h(29): warning C4013: '__volatile__' undefined; assuming extern returning int
1>g:\projects\macsfancontrol\cpuid-master\clock.h(29): error C2143: syntax error : missing ')' before ':'
1> main.c
1> handlers.c
1>g:\projects\macsfancontrol\cpuid-master\handlers.c(709): warning C4018: '>=' : signed/unsigned mismatch
1>g:\projects\macsfancontrol\cpuid-master\handlers.c(1361): error C2143: syntax error : missing ':' before '...'
1> getopt_long.c
1> feature.c
1>g:\projects\macsfancontrol\cpuid-master\feature.c(1068): warning C4013: 'snprintf' undefined; assuming extern returning int
1> cpuid.c
1> cache.c
1>g:\projects\macsfancontrol\cpuid-master\cache.c(174): warning C4244: 'initializing' : conversion from 'double' to 'uint32_t', possible loss of data
1> Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.