64-bit Kernel Running 32-bit ELF Executables – How It Works

32bit64bitcpu-architecturelinux

The output from uname:

root@debian:~ # uname -a
Linux 5asnb 2.6.32-5-amd64 #1 SMP Mon Jun 13 05:49:32 UTC 2011 x86_64 GNU/Linux

However the /sbin/init executable shows up as 32-bit:

root@debian:~ # file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

Other aspects of the system seem to contradict things as well:

root@debian:~ # echo $HOSTTYPE
i486

root@debian:~ # getconf LONG_BIT
32

Best Answer

The 64bit kernel can be installed on Debian 32bit. You can see that the amd64 kernel is available for 32bit Debian on it's package page. This can be used as an alternative to using a PAE enabled kernel to support more than 4G of total RAM. Note that 32bit binaries still can not access more than roughly 3G of RAM per process.

Related Question