LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-07-2008, 02:47 PM   #1
Aleks`
LQ Newbie
 
Registered: Sep 2008
Posts: 19

Rep: Reputation: 0
Linux 32 bit / 64 bit question


Well, I've been running linux, for, I don't know, 2 years maybe and this topic is still a bit blurry to me.

Regarding the 64 BIT CPU architecture, when I install a 64bit distro on a 64 bit PC, is all the software 64 bit on it or is it just the kernel 64 bit and it handles everything else ?

If so, that means that every program written for linux can operate both on a 32 bit CPU and a 64 bit one. Is that statement correct ?

If it's not, if every software is 64 bit, can normal 32bit applications be runned on a 64 bit linux install or it is impossible?

Now, if I have a 64 bit CPU for example, and I have a 32 bit linux distro installed on it, and I add lets say 10GB ram on it, in order for the distro to recognize that amount of RAM I need to have a 64 OS. Can I just replace my current 32bit kernel on the distro with a 64 bit one so I don't have to make a full reinstall ?
 
Old 12-07-2008, 03:18 PM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
A 32 Bits OS runs on 32 bits Box and on 64 bits box
64 Bits OS do not run on 32 bits Box
Having a 64 Bits OS does not mean that all programs are already 64 Bits in this case you find Lib64 and lib32
Why did you like to have 10GB ?
No not only the kernel
Hope this will help
 
Old 12-07-2008, 03:29 PM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
The kernel can be compiled with both the 64 and 32-bit interface (well, for x86_64). So it should be possible to have a 64-bit kernel while libc and most other apps are 32-bit; you just have to make sure your other tools (like udev) are compatible with the version of kernel you are installing.

As ronlau9 already pointed out, 64-bit apps will not run on a 32-bit system.

The 32-bit kernel should also be able to see all your RAM; you will have to compile the kernel and activate the necessary options in the configuration (large memory and PAE). If I recall correctly, the 32-bit kernel was able to address at least 16GB using this scheme about 4 years ago.
 
Old 12-07-2008, 04:08 PM   #4
Aleks`
LQ Newbie
 
Registered: Sep 2008
Posts: 19

Original Poster
Rep: Reputation: 0
I took that 10GBs only as an example.
 
Old 12-08-2008, 02:22 AM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
There are 2 types of 64-bit distros:

1) multilib - here the kernel is 64-bit with 32-bit compatibility enabled, this allows you to run both 64-bit and 32-bit apps, but each much have their own respective libraries and dependencies. So there is a lib/lib32 and lib64, each with their own libraries and dependencies, this is because you cannot link between 32-bit and 64-bit libraries. If setup correctly you can even compile both 32-bit and 64-bit apps.

2) purelib - here the kernel is 64-bit without 32-bit compatibility, you can only run 64-bit apps.

And then there's the 32-bit distro which only runs 32-bit apps.

The CPU, if it is classified as x86_64 can run in 2 modes, a 64-bit mode and a 32-bit mode, this is usually automagic and depends on the kernel's word length. Note that it is advantageous to run in 64-bit mode because it will allow for greater performance when using lots of RAM, and on many processors some SIMD registers are only available in 64-bit mode. Read more here:
http://en.wikipedia.org/wiki/X86_64
 
Old 12-10-2008, 07:59 PM   #6
rob.rice
Senior Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 1,007

Rep: Reputation: 168Reputation: 168
I'm running a 64bit distro other than being a whole lot faster it's the exact same as 32bit
All the apps in the distro are 64bit
I can run 32bit apps
if you have a 64bit machine go for it
 
Old 12-10-2008, 09:09 PM   #7
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Quote:
Originally Posted by Aleks` View Post
when I install a 64bit distro on a 64 bit PC, is all the software 64 bit on it
Probably (but that may depend on what you mean by "software"). Most distributions are built entirely from open source material. Since there is source code available, there is almost never a good reason to use any 32 executables.

Quote:
If so, that means that every program written for linux can operate both on a 32 bit CPU and a 64 bit one. Is that statement correct ?
That's probably true of the type of thing one might include in a distribution. But there are plenty of non open source programs written for Linux that aren't available compiled for 64 bit and even some open source programs that wouldn't work if compiled for 64 bit.

Quote:
can normal 32bit applications be runned on a 64 bit linux install or it is impossible?
Most x86_64 distributions include support for running ordinary 32 bit applications. That support includes some 32 bit library binaries that are the reason I questioned what you meant in your first question.

Quote:
Now, if I have a 64 bit CPU for example, and I have a 32 bit linux distro installed on it, and I add lets say 10GB ram on it, in order for the distro to recognize that amount of RAM I need to have a 64 OS.
Not true. A 32bit Linux kernel can be configured to handle 10GB of ram.

Quote:
Can I just replace my current 32bit kernel on the distro with a 64 bit one so I don't have to make a full reinstall ?
I'm pretty sure you can't use a 64 bit kernel in a 32 bit install.

The ability for 32 bit applications to run under a 64 bit kernel within a 64 bit distribution is not quite enough to mean that 32 bit for everything but the kernel would work with a 64 bit kernel.

I don't know the details of why it wouldn't work. But the various expert comments I've seen on that question all agree it won't work.
 
Old 12-11-2008, 03:29 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by johnsfine View Post
I'm pretty sure you can't use a 64 bit kernel in a 32 bit install.

The ability for 32 bit applications to run under a 64 bit kernel within a 64 bit distribution is not quite enough to mean that 32 bit for everything but the kernel would work with a 64 bit kernel.

I don't know the details of why it wouldn't work. But the various expert comments I've seen on that question all agree it won't work.
Oh, you can use a 64-bit kernel in a 32-bit install, but not a 32-bit kernel in a 64-bit install. Just make sure you enable 32-bit emulation. I don't see why anyone would do this, because there would be very little if any benefit.
 
Old 12-11-2008, 09:39 AM   #9
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Quote:
Originally Posted by H_TeXMeX_H View Post
Oh, you can use a 64-bit kernel in a 32-bit install, but not a 32-bit kernel in a 64-bit install. Just make sure you enable 32-bit emulation. I don't see why anyone would do this, because there would be very little if any benefit.
The reason seems to be clear in this thread, and has been clear in several other threads:

Someone has already installed a 32 bit distribution on 64 bit hardware. They then want to change kernels, either because they added ram or they changed their mind about how they wanted existing ram supported. They don't want to reinstall an entire distribution. Dropping in a new kernel is much simpler.

The answers I recall seeing in the past say you can't do that. If you have installed a 32-bit distribution, you can drop in a differently configured 32-bit kernel (that may support ram over 4GB, even if the original distribution didn't) but you can't drop in a 64-bit kernel.

I haven't tried it myself, nor do I recall seeing any posts from anyone who tried it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
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 03:02 PM
LXer: Running 32-bit Applications on 64-bit Debian GNU/Linux LXer Syndicated Linux News 2 01-06-2010 01:26 PM
64-bit or 32-bit Application on 64-bit Linux jjana123 Linux - General 4 05-06-2008 06:27 PM
LXer: Upgrade from 32-bit to 64-bit Fedora Linux without a system reinstall LXer Syndicated Linux News 0 01-11-2008 10:42 PM
LXer: Community: Why There is Better Driver Support in 64-bit Linux Than 64-bit Windows XP LXer Syndicated Linux News 0 10-18-2006 10:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:12 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration