John Martin wrote: > Rayson Ho wrote: >> On Mon, Mar 2, 2009 at 7:13 PM, John Martin <John.M.Martin at sun.com> >> wrote: >> >>>> 1) Best way to replace /proc/cpuinfo for OpenSolaris? >>>> >>>> opencc -v >>>> opencc WARNING: cannot read /proc/cpuinfo, defaulting to basic >>>> 32-bit x86. >>>> >>> This code is looking for the plain text processor description, e.g. >>> "Intel(R) Core(TM) i7". On Solaris this can be fetched with smbios. >>> >> >> Another way is to fetch the information from "/dev/cpu/self/cpuid": >> >> http://blogs.sun.com/JoeBonasera/entry/detecting_hardware_virtualization_support_for >> >> >> >> I got the program in the blog entry compiled on snv_86 without any >> modification. I believe the interface should be stable, as it is >> basically returning the information from the CPUID instruction. >> However, we can easily change the code to execute CPUID directly using >> inline assembly if we want to. >> >> Also, with the information returned from "/dev/cpu/self/cpuid" or >> CPUID, we can check for the bits set for any specific hardware >> features, eg. AMD or Intel, support level of MMX or SSEx, 32 or >> 64-bit, etc. >> >> http://en.wikipedia.org/wiki/CPUID >> >> > The code in question wants the SMBIOS Vendor string for the CPU. > Is this available through one of the CPUID functions? > > Otherwise we would would need to rearrange the code to parse > the instruction capability bits, which is what the upstream code is > after anyway. Hi John,
This code has exactly what we want and may be more portable. (Along with if we change it minimally to fit our need we can just continue to merge changes.) http://svn.mplayerhq.hu/mplayer/trunk/cpuinfo.c?view=markup Tracing this back will show how they extracted it.. idstr[12] = 0; printf("vendor_id\t: %s\n", idstr); I have two slightly bigger problems though.. 1) I need to refocus this week so I can start to help write up the gsoc projects (not just open64) 2) .... dbx - core Corefile specified executable: "/usr/local/src/bar/open64/lib/gcc-lib/x86_64-open64-freebsd/4.2/wgen42" For information about new features see `help changes' To remove this message, put `dbxenv suppress_startup_message 7.7' in your .dbxrc Reading wgen42 core file header read successfully Reading ld.so.1 Reading libstdc++.so.6.0.11 dbx: internal error: signal SIGSEGV (no mapping at the fault address) dbx's coredump will appear in /tmp Abort (core dumped) Anyone who can test the patch or look for errors? Thanks ./C