LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-12-2008, 09:27 PM   #1
abhishekrahel
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Rep: Reputation: 0
32 bit or 64 bit (OS or CPU)


Hi All

Could anyone help me in how to find installed operating system linux is 32 bit or 64 bit and how to find CPU is 32 bit or 64 bit ?

i am in confusion regarding this.
What i came to know through the below link:->
http://www.cyberciti.biz/faq/linux-h...64-bit-or-not/

that we can find out about CPU is 32 bit or 64 bit.


But i am in confusion about how to confirm Linux is 32 bit or 64 bit ?

Waiting for response.

Thanks in advance.
 
Old 05-13-2008, 04:52 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
I assume you're asking about an x86 system.

uname -a will tell you if the Linux kernel is 64 bit.

If the output includes x86_64 then the kernel is 64 bit, which means the CPU must be 64 bit.

If there is no X86_64, there should be something like 686 or 486 there to say what 32 bit CPU the kernel was built for. If the kernel is 32 bit, the CPU might still be 64 bit. Try

grep flags /proc/cpuinfo

That should print a long list of cpu flags. If one of those is lm then the CPU is 64 bit.
 
Old 05-14-2008, 02:05 PM   #3
abhishekrahel
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by johnsfine View Post
I assume you're asking about an x86 system.

uname -a will tell you if the Linux kernel is 64 bit.

If the output includes x86_64 then the kernel is 64 bit, which means the CPU must be 64 bit.

If there is no X86_64, there should be something like 686 or 486 there to say what 32 bit CPU the kernel was built for. If the kernel is 32 bit, the CPU might still be 64 bit. Try

grep flags /proc/cpuinfo

That should print a long list of cpu flags. If one of those is lm then the CPU is 64 bit.
Thanks johnsfine for the response.

In other words:->
So now i am having a small doubt that if the output of grep flags /proc/cpuinfo contains lm it means definitely CPU is 64 bit and can handle
both 32 and 64 bit kernel and if the output does not contains lm means CPU is definitely 32 bit and can handle 32 bit kernel and cant handle 64 bit kernel or can handle 64 bit kernel also.


And if the output of uname -a includes x86_64 then the kernel is definitely 64 bit.
And if the output does not include x86_64 means definitely the kernel is 32 bit(contains others like i686 i686 i386 GNU/Linux).

Thanks
Abhishek Rahel.
 
Old 05-14-2008, 10:45 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

If you do a 'most /proc/cpuinfo';
Code:
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 67
model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
stepping        : 3
cpu MHz         : 2009.178
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov$
bogomips        : 4022.19
clflush size    : 64

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 67
model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
stepping        : 3
cpu MHz         : 2009.178
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov$
bogomips        : 4018.27
clflush size    : 64
What part don't you understand? If you do a 'uname -a';

Code:
 uname -a
Linux amd64 2.6.24.5-smp #2 SMP Wed Apr 30 13:41:38 CDT 2008 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux
shows the kernel information with the processor information.
 
Old 05-16-2008, 05:10 PM   #5
abhishekrahel
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by onebuck View Post
Hi,

If you do a 'most /proc/cpuinfo';
Code:
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 67
model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
stepping        : 3
cpu MHz         : 2009.178
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov$
bogomips        : 4022.19
clflush size    : 64

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 67
model name      : AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
stepping        : 3
cpu MHz         : 2009.178
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov$
bogomips        : 4018.27
clflush size    : 64
What part don't you understand? If you do a 'uname -a';

Code:
 uname -a
Linux amd64 2.6.24.5-smp #2 SMP Wed Apr 30 13:41:38 CDT 2008 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux
shows the kernel information with the processor information.
Hi
I have recently bought a notebook Vostro 1000 (AMD Turion 64*2)and installed FC 7 on that.

So
grep flags /proc/cpuinfo is :->

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy 3dnowprefetch ts fid vid ttp tm stc 100mhzsteps

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy 3dnowprefetch ts fid vid ttp tm stc 100mhzsteps



And uname -a is :->

Linux RAHEL 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:35:01 EDT 2007 i686 athlon i386 GNU/Linux


And according to what I got that CPU is 64 bit and kernel is 32 bit.

But if i do getconf LONG_BIT
I got 32
So i am confused i should rely on getconf or on lm in flags, about CPU(64 bit or 32 bit)

and what the meaning of both i686 and i386 in the output of uname -a,
or simply i should understand that as it does not contains x86_64(as it is) kernel installed is 32 bit.

So Could you please guide me to understand this.

Thanks.
 
Old 05-16-2008, 06:56 PM   #6
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by abhishekrahel View Post
according to what I got that CPU is 64 bit and kernel is 32 bit.
Correct.

Quote:
But if i do getconf LONG_BIT
I got 32
So i am confused i should rely on getconf or on lm in flags, about CPU(64 bit or 32 bit)
I did a couple searches to try to find the meaning of LONG_BIT in getconf and failed to find it. Maybe some expert will tell us both.

But I know the meaning of lm in flags. Your CPU is 64 bit.

Quote:
and what the meaning of both i686 and i386 in the output of uname -a,
I forget those details of uname output. But I do recall that it is typical for 32 bit kernels.

Quote:
or simply i should understand that as it does not contains x86_64(as it is) kernel installed is 32 bit.
Your kernel is 32 bit.
 
Old 05-18-2008, 05:08 PM   #7
abhishekrahel
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by johnsfine View Post
Correct.



I did a couple searches to try to find the meaning of LONG_BIT in getconf and failed to find it. Maybe some expert will tell us both.

But I know the meaning of lm in flags. Your CPU is 64 bit.



I forget those details of uname output. But I do recall that it is typical for 32 bit kernels.



Your kernel is 32 bit.

Thanks Johnsfine for your time.This is only 2nd time i posted my doubt here
but no doubt i got a overwhelming response.Really its great to share knowledge and have a healthy discussion.Lets carry on.....again thanks,
Have a good time always...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
64 bit cpu-64 bit Ubuntu-are there 32 bit app issues? sofasurfer Ubuntu 7 04-09-2014 02:02 PM
64-bit or 32-bit Application on 64-bit Linux jjana123 Linux - General 4 05-06-2008 05:27 PM
Triple Boot Suse 10.3 32 bit, suse alpha 11.0 64 bit and Windows XP (32 Bit) 1kyle SUSE / openSUSE 1 02-28-2008 10:25 AM
32 bit or 64 bit install - is 32 bit easier for a newbie? dms05 Linux - Newbie 3 05-19-2006 03:05 PM
64 bit CPU garbo73 Linux From Scratch 2 01-08-2006 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration