[OSUNIX-dev] Re: [hpcdev-discuss] OpenSolaris open64 port - 1st round patch review

John Martin John.M.Martin at Sun.COM
Tue Mar 3 13:05:54 GMT 2009


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.




More information about the OSUNIX-dev mailing list