Solaris 32bit / 64bit confusion

32-bit64-bitsolaris

I have a Solaris on a AMD-

uname -a gives

OS Solaris 10 x86_64 (SunOS goldtpus34 5.10 Generic_144489-11

I wanted to find whether it has a 32bit or 64 bit kernel so
I did

/usr/bin/isainfo -k

it says

amd64

but when i do

file /sbin/init 

it says

ELF 32-bit LSB executable 80386 Version 1, dynamically linked, stripped

Also if I do file it says

ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE FXSR FPU], dynamically linked, not stripped 

So is it possible to have a Kernel working in 64bit mode but System utils/process spawner(init) in 32bit mode.

I am confused.

How to accurately get if the OS Kernel is in 64/32 bit mode on Solaris and on Linux?

Best Answer

The output of isainfo -k shows you in what mode the kernel is running. In your case you are running a 64-bit kernel. Everything inside the kernel is run in 64-bit mode (device drivers, system calls, etc. etc.)

The beauty of Solaris (and plenty other OSs, I assume) is that it can natively execute 32-bit binaries as well. Most programs, tools, utilities that come with the Solaris OS are 32-bit tools. The only exceptions are the ones you can find in /usr/bin/amd64. Those are usually the ones that have to work with kernel structures directly or want to take advantage of the bigger directly addressable memory space. They are chosen automatically (their 32-bit counterparts can be found in /usr/bin/i86) through /usr/lib/isaexec which the tools in question are hard-linked to (/usr/bin/ps, for example, is a hard link to /usr/lib/isaexec).

init only comes in the shape of a 32-bit binary, which is a-okay. It doesn't say anything about what kernel you are running. I am quite sure that the same init from a Solaris 2.3 image will still run perfectly fine under Solaris 11 (under SPARC, that is). It doesn't really do anything exciting.

Related Question