The output from uname:
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bdcfd2d2c9fdd9d8dfd4dcd3">[email protected]</a>:~ # 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:
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4b3924243f0b2f2e29222a25">[email protected]</a>:~ # 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:
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6c1e0303182c08090e050d02">[email protected]</a>:~ # echo $HOSTTYPE i486 <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aedcc1c1daeecacbccc7cfc0">[email protected]</a>:~ # getconf LONG_BIT 32
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
All processors that support the x64 instruction set (also known as x86_64 or amd64) also support the x86 instruction set (also known as i386 or i686, which are strictly speaking specific versions of x86). The same goes for ARM A64 (the new 64-bit instruction set appearing in ARMv8) and A32 (the name for the “classic” 32-bit instruction set), for SPARC64 and SPARC, and I believe for MIPS64 and MIPS. So on all these architecture families, if a processor can run 64-bit code, it can also run 32-bit code.
The Linux kernel supports running 32-bit userland code with a 64-bit kernel (on all the architecture families mentioned above, I think). The kernel must be homogeneous (all 64-bit or all 32-bit), and each process must be homogeneous, but you can have a mixture of 32-bit and 64-bit processes on a 64-bit kernel. The converse is not possible: with a 32-bit kernel, you cannot run 64-bit processes.
This is a design choice in Linux, motivated by the desire to run existing 32-bit binaries on 64-bit installations. Other Unix variants have made different choices: Solaris can run 64-bit programs on a 32-bit kernel as well as the other way round, while OpenBSD cannot run 32-bit programs on a 64-bit kernel.
You can get information about the CPU in /proc/cpuinfo. If your x86 CPU has the lm flag, it’s a 64-bit CPU.
By default, uname -m or arch shows the architecture that the kernel was compiled for. Linux can set the “personality” of a process (with the personality) system call. You can run a subprocess in a different personality with the setarch command; setarch i686 someprogram or linux32 someprogram runs the specified program in an environment where uname -m returns i686 while setarch amd64 someprogram or linux64 someprogram runs the specified program in an environment where uname -m returns amd64.
file /sbin/init tells you what architecture the init program is compiled for. Although it’s possible to mix 32-bit and 64-bit executables in an installation, usually all the core OS programs are from the same architecture, because it’s a lot easier to manage.
$HOSTYPE is a bash variable and tells you what architecture the bash program was compiled for.
getconf LONG_BIT lets you know whether the default C compiler is set up to compile 32-bit or 64-bit programs. A more precise test is to compile a and run a program that prints sizeof(void*) or sizeof(size_t) — calling getconf can only give information about what getconf thinks is the default compiler.
Method 2
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.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0