Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I was wondering how to get information about the following things from the command line in Linux:

  • word (i.e. the size that the CPU can process at one time, which may not be the OS bit-depth),
  • address size (i.e. the number of bits in an actual address),
  • address bus size (not sure if it is the same as address size by definition, but I think they are different and may not agree),
  • data bus size,
  • instruction size?
share|improve this question
    
Many of these are not well-defined (there is more than one bus and they don't all have the same sizes). Even things like “CPU word size” aren't clearly defined, some CPUs (e.g. all PC CPUs) have several word sizes. –  Gilles Aug 4 '11 at 22:59
add comment

2 Answers 2

up vote 2 down vote accepted

Do a cat /proc/cpuinfo and look at the results:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 23
model name      : Genuine Intel(R) CPU           U4100  @ 1.30GHz
stepping        : 10
cpu MHz         : 1200.000
cache size      : 2048 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm xsave lahf_lm
bogomips        : 2593.48
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

A lot of the information that you are looking for can be inferred from this.

share|improve this answer
    
Thanks! (1) About the physical address size, is it possible that it may not be the address bus size? (2) Is it right that the output doesn't give CPU word? –  Tim Aug 4 '11 at 1:18
    
@Tim The output gives the CPU word size in a cryptic way: all i386 CPUs can do 8, 16 and 32, and the lm flag indicates an amd64 CPU, i.e. the CPU can do 64. The word size for integer arithmetic is the same as for addresses on this CPU family (unless you count segment registers, but that's a whole other story). –  Gilles Aug 4 '11 at 22:58
    
@Gilles: Thanks! (1) What does lm literally mean? (2) What do you mean by "unless you count segment registers"? –  Tim Aug 4 '11 at 23:07
    
@Tim CPU flag names tend to be obscure and sometimes inaccurate because the flag name was settled before its exact function. Check out the Linux x86 CPU feature list; lm is “long mode”. Segment registers are best left to PC historians (no modern OS uses them); but PAE, which raises address sizes to 36 bits on 686 platforms, is supported by most major modern PC OSes. –  Gilles Aug 4 '11 at 23:15
add comment
  1. getconf WORD_BIT
  2. getconf LONG_BIT (the size of long integers)
  3. arch

For example, on a Fedora 14 x64 system:

% uname -a
Linux grinchy 2.6.35.14-106.fc14.x86_64 #1 SMP Wed Nov 23 13:07:52 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

% getconf WORD_BIT
32

% getconf LONG_BIT
64

% arch
x86_64
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.