0

I want to detect the cpu type while the kernel is booting (viz. x86 or x86_64) so that I can do a task differently based on the cpu type. Is there a simple way to know the CPU type?

sashoalm
  • 75,001
  • 122
  • 434
  • 781
maths-help-seeker
  • 946
  • 1
  • 10
  • 30

2 Answers2

2

You can read /proc/cpuinfo to get cpu type

Rahul R Dhobi
  • 5,668
  • 1
  • 29
  • 38
1

How about the cpuid instruction ?

There is a module interfacing it, source code is here.

If interested, also have a look here or here or here for other examples.

Also have a look at this question for using cpuid to know if your system supports SSE.

Community
  • 1
  • 1
Antoine
  • 13,494
  • 6
  • 40
  • 52