Tell If Solaris Runs 32-bit or 64-bit with isalist and isainfo
Purpose
isalist prints the instruction sets a Solaris machine can run, as returned by the SI_ISALIST command of sysinfo(2)
. It prints the names on one line, separated by spaces, with the best-performing set first. On an UltraSPARC machine running the 64-bit operating system, sparcv9 comes first.
That order tells you which kernel came up. This is not always clear after a patch run, a change at the ok prompt or a handover from another team. Programs compiled for an instruction set that is not in the list
most likely run slower or do not run at all, so check before any install. isainfo is the companion tool. It tells you whether 64-bit applications are supported and whether the running kernel uses 32-bit or 64-bit device drivers
.
Admins used isalist on Solaris 7 through 10 systems to tell the 32-bit operating system from the 64-bit one. It is one of the commands collected on the Solaris commands and scripts page
.
Code
1isalist
2
3isainfo -v
4isainfo -b
5isainfo -n
6isainfo -vk
7isainfo -x
8
9echo "Welcome to "`isainfo -b`"-bit Oracle Solaris"
Run each line on its own. The isainfo lines follow the Solaris 10 synopsis, isainfo [ [ -v ] [ -b | -n | -k ] | [ -x ]]. Pick one of -b, -n or -k and add -v for more detail, or run -x by itself. The echo line shows how a script puts the bit count into a string.
Code Breakdown
isalist
The output is one line of names, ordered in the sense of best performance . Here is the output from an x86 system with 64-bit enabled :
1$ isalist
2amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
amd64 at the front means the system has 64-bit Solaris capabilities enabled
. The names after it are the other x86 sets the machine can run, from best performance down.
What the instruction set names mean:
sparcis the SPARC V8 instruction set.sparcv9is the SPARC V9 instruction set.sparcv9+visissparcv9plus the UltraSPARC I Visualization Instructions.amd64is the AMD Opteron instruction set.
In the isalist(7) name list
, later names are generally faster. That is the reverse of the order isalist prints.
sparcv9+vis ranks above plain sparcv9. So on an UltraSPARC machine with the 64-bit kernel, the first name can be a sparcv9+ variant instead of bare sparcv9. Any name in the sparcv9 family at the front of the line marks the 64-bit operating system. If no sparcv9 name comes first, the 64-bit operating system is not the one running.
isainfo with no options
With no options, isainfo prints instruction-set names that are a subset of the list returned by isalist(1)
. This is the output from a 64-bit SPARC system
:
1example% isainfo
2sparcv9 sparc
A 64-bit x86 system prints amd64 i386. That output means the system can support 64-bit applications
.
-v
-v prints more detailed information when used with -b, -k or -n
. On its own, it prints the application list in long form, one line per set. This is the output from a SPARC system that supports only 32-bit applications
:
1$ isainfo -v
232-bit sparc applications
A SPARC system running the 64-bit kernel prints two lines:
1$ isainfo -v
264-bit sparcv9 applications
332-bit sparc applications
That system supports both 32-bit and 64-bit applications
. On a 32-bit x86 system, the same command prints 32-bit i386 applications
.
-b
-b prints the number of bits in the address space of the native instruction set
. A SPARC, x86 or UltraSPARC system running the 32-bit Solaris Operating System prints 32
. A 64-bit system returns 64 only
.
A 64-bit UltraSPARC system can run both types of applications, but 64-bit applications are the best kind to run on a 64-bit system .
-n
-n prints the name of the native instruction set used by portable applications
supported by the current version of the operating system. This is the output on a 64-bit SPARC system running Oracle Solaris 11
:
1$ isainfo -n
2sparcv9
illumos
prints the same sparcv9 on a 64-bit SPARC system.
-k and -vk
-k prints the instruction set or sets used by kernel components such as device drivers and STREAMS modules
. This is the flag that reports on the running kernel. -v alone and -n report on applications. This is the output from a 32-bit x86 system
:
1example% isainfo -k
2i386
Add -v for the long form. This is the output from a 64-bit SPARC kernel
:
1example% isainfo -vk
264-bit sparcv9 kernel modules
Read this line before you add a 64-bit driver.
-x
-x prints instruction extensions to the native ABI that the platform supports
. This is the output from an AMD Opteron system
:
1example% isainfo -x
2i386: fpu tsc cx8 sep cmov mmx ammx a3dnow a3dnowx fxsr sse sse2 pause
Each line starts with an ABI name and a colon, followed by the extensions for that ABI. The Oracle Solaris 11.4 example
prints two lines, one starting amd64: and one starting i386:. Do not use -x to check for a 64-bit kernel. Use -b or -vk for that. Run -x when a vendor names a required extension such as sse2.
Key Points
isalistis obsolete in illumos and in Oracle Solaris 11.3 , and it may be removed in a future version of Solaris. For instruction set extensions,isainfo(1)is the better way.isainfoships in theSUNWcsupackage on Solaris 10 . On Solaris 11.3 it ships insystem/core-os, the same package that carriesisalist.- The Oracle Solaris administration guide says the release it covers ships only a 64-bit kernel on SPARC systems
. On x86,
isalistcan also display this information . - Oracle Solaris 11 is a 64-bit only OS , but it still runs 32-bit applications. x86 systems that cannot run the 64-bit kernel cannot run Oracle Solaris 11 .
Insights and Best Practices
Safe usage
Every isainfo option prints information. None of them changes the system. isalist reads its list from sysinfo(2) and prints it.
Read the kernel line, not only the application line. On a 64-bit kernel, isainfo -v still lists 32-bit sparc applications, so a 32-bit line in that output does not mean a 32-bit kernel. isainfo -vk names the kernel modules directly.
isalist vs isainfo
isalist is obsolete on illumos and Oracle Solaris 11.3. For instruction set extensions, isainfo(1) is the better way
. Its output is shorter, and each flag answers one question. The isalist name list has also fallen behind current hardware. The isalist(7) names do not reflect all the extensions modern processors have added
, and getisax(2) is a better way
to handle instruction set extensions in code.
Scripting the check
This echo line
puts the -b output inside a string:
1$ echo "Welcome to "`isainfo -b`"-bit Oracle Solaris"
2Welcome to 64-bit Oracle Solaris
The backticks run isainfo -b and put its number into the line. A script that has to choose between 32-bit and 64-bit should test this number, not the name lists.
A script that has to run on older releases cannot assume isainfo exists. On those releases, check the output of uname(1) or check for the existence of /usr/bin/isainfo
before you call it.
Shared libraries are a separate case. Libraries that depend on instruction set extensions should use the hardware capability facility of the dynamic linker
instead of reading isalist names at run time.
What to log
Save the output of isalist, isainfo -b and isainfo -vk with each patch record and each boot change. If a vendor asks which extensions a server supports, save the isainfo -x line as well.
When to Run This
- After a reboot or a boot change at the OBP
okprompt. On SPARC the 64-bit kernel is the default boot , andisainfo -vkconfirms which kernel came up. - Before you install a 64-bit device driver or STREAMS module.
-knames the instruction set that kernel components use. - Before you install a 64-bit application.
isainfo -vmust print a 64-bit line. - Before you plan an Oracle Solaris 11 upgrade on an x86 box.
- When you take over a box from another team, before you trust any notes about its kernel.
- When a vendor lists required CPU extensions.
isainfo -xshows what the platform supports.
Troubleshooting Common Issues
isainfo exits non-zero with an error
A non-zero exit means the options are not specified correctly, or the command is unable to recognize attributes of the system it runs on
. The error message goes to stderr. Run isainfo -b; echo $? to see the exit code, then compare your flags with the synopsis. -x stands alone, and only one of -b, -n or -k goes on a command line.
isainfo -v shows a 32-bit line on a 64-bit box
This is expected. A 64-bit SPARC system lists both 64-bit sparcv9 applications and 32-bit sparc applications. Run isainfo -vk to see the instruction set of the kernel modules.
isainfo -b prints 64 but 32-bit programs still run
This is also expected. -b returns 64 only on a 64-bit system, even though both kinds of application run there. Run isainfo -v to see the full application list.
isalist is missing on a newer system
isalist is obsolete and may be removed in a future version of Solaris. Run isainfo with no options instead. Its names are a subset of the isalist list.
An x86 box shows only i386
isainfo -k prints i386, and isalist has no amd64 at the front. In that case the system does not have 64-bit Solaris capabilities enabled. Not all x86 systems can run the 64-bit kernel, and a system that cannot run it cannot run Oracle Solaris 11.
isainfo is not found on an old release
Run uname and ls /usr/bin/isainfo. If the file is not there, use isalist and read the first name on the line.
References
- isainfo(1) - Oracle Solaris 10 Reference Manual - synopsis, the -b, -k, -n, -v and -x options, exit status, SUNWcsu package, the -v, -k and -vk sample output
- isainfo(1) - Oracle Solaris 11.3 Reference Library - isainfo in system/core-os on Solaris 11.3
- isalist(1) - Oracle Solaris 11.3 Reference Library - isalist obsolete on Solaris 11.3, system/core-os package
- Oracle Solaris administration guide: 32-bit or 64-bit capabilities - x86 isalist sample, isainfo -v and -b output and its meaning, 64-bit-only SPARC kernel
- Oracle Solaris 11.4 64-bit Developer's Guide: comparison with Solaris 10 - Solaris 11 is 64-bit only, x86 64-bit kernel requirement, -n sample, two-ABI -x sample, the echo script line, uname and /usr/bin/isainfo check, hardware capability facility
- isainfo(1) - illumos man page - plain, -n and -x sample output
- isalist(1) - illumos man page - SI_ISALIST source, output order, unsupported instruction sets, obsolete status, isainfo(1) as the better way for extensions
- isalist(7) - illumos man page - sparc, sparcv9, sparcv9+vis and amd64 definitions, reverse order, getisax(2)