Image of XSLT 2.0 and XPath 2.0 Programmer's Reference (Programmer to Programmer)
Image of Modern Operating Systems (3rd Edition)
Image of Beginning Google Maps API 3
Image of Android Wireless Application Development

How to Determine Hardware Mode of Intel CPU

Consider the following output:

# grep flags /proc/cpuinfo
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
       mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc pni monitor ssse3 lahf_lm

How can you the maximum size of a long that can be used with this CPU? The answer is 64-bit because of the presence of the lm flag.

The following flags can be used to determine the maximum size of a long for a CPU:

  • lm – Long Mode (64 bits)
  • tm – Protected mode (32-bit)
  • rm – Real Mode (16 bits)

If you wish to see the full list of flags returnable by /proc/cpuinfo, look at the header …/arch/x86/include/asm/cpufeature.h in the Linux kernel sources.

Comments are closed.