Wednesday, March 20, 2013

Solaris SPARC ABI and register conventions


32 to 64 bit changes

The easiest way to determine which version is running on your system is to use the isainfo command. This new command prints information about the application environments supported on the system.

The following is an example of the isainfo command executed on an UltraSPARC™ system running the 64-bit operating system:

% isainfo -v
64-bit sparcv9 applications
32-bit sparc applications

One useful option of the isainfo(1) command is the -n option, which prints the native instruction set of the running platform:

% isainfo -n
sparcv9

The -b option prints the number of bits in the address space of the corresponding native applications environment:

% echo "Welcome to "`isainfo -b`"-bit Solaris"
Welcome to 64-bit Solaris

A related command, isalist(1), that is more suited for use in shell scripts, can be used to print the complete list of supported instruction sets on the platform. Some of the instruction set architectures listed by isalist are highly platform specific, while isainfo(1) describes only the attributes of the most portable application environments on the system. Both commands are built on the SI_ISALIST suboption of the sysinfo(2) system call. See isalist(5) for further details.

The following is an example of the isalist command executed on an UltraSPARC system running the 64-bit operating system:

% isalist
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8
sparcv8-fsmuld sparcv7 sparc

The basic calling convention is the same. The first six arguments of the caller are placed in the out registers %o0-%o5. The SPARC V9 ABI still uses a register window on a larger register file to make calling a function a "cheap" operation. Results are returned in %o0. Because all registers are now treated as 64-bit quantities, 64-bit values can now be passed in a single register, rather than a register pair.

The layout of the stack is different. Apart from the increase in the basic cell size from 32-bit to 64-bit, various "hidden" parameter words have been removed. The return address is still %o7 + 8.

%o6 is still referred to as the stack pointer register %sp, and %i6 is the frame pointer register %fp. However, the %sp and %fp registers are offset by a constant, known as the stack bias, from the actual memory location of the stack. The size of the stack bias is 2047 bits.

Instruction sizes are still 32 bits. Address constant generation therefore takes more instructions. The call instruction can no longer be used to branch anywhere in the address space, since it can only reach within plus or minus 2 gigabytes of %pc.

Integer multiply and divide functions are now implemented completely in hardware.

Structure passing and return are accomplished differently. Small data structures and some floating point arguments are now passed directly in registers.

User traps allow certain traps from non-privileged code to be handled by a user trap handler (instead of delivering a signal).



Solaris SPARC ABI Register Semantics

Solaris OS Patch Management


Please read the below notes to understand the different Solaris releases
( Marketing / Update / Maintenance ) :
http://www.oracle.com/technetwork/systems/patches/solaris/index.html
http://www.oracle.com/technetwork/systems/articles/patch-faq-jsp-139997.html
https://blogs.oracle.com/patch/entry/solaris_patches

To list all patches applied on a system , run
% showrev -p
% patchadd -p

To look for a specific patch , run
% showrev -p | grep 113964

uname prints the basic information about the system
% uname -a
SunOS dnagac08-3 5.10 Generic_138888-03 sun4v sparc SUNW,T5240

% cat /var/sadm/softinfo/INST_RELEASE
OS=Solaris
VERSION=10
REV=0

If you need to look-up a patch , you can do at support.oracle.com . The below blog should be helpful :
https://blogs.oracle.com/patch/entry/searching_for_oracle_sun_patches

For removing a specific patch , the patchrm command can be used passing the patch id.

To check for the Operating Environment / System updates , run
%cat /etc/release
Solaris 10 10/08 s10s_u6wos_07b SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 27 October 2008 <== This also can be looked-up

The first line summarizes the release details ( broken up below ) :
Solaris 10 : Base OS Level
10/08 : Release Date
s10s_u6wos_07b : Solaris 10 sparc update 6 ...
SPARC : Hardware

SunoS --> Solaris
5.3 --> 2.3
5.4 --> 2.4
5.5 --> 2.5
5.5.1 --> 2.5.1
5.6 --> 2.6
5.7 --> 7
5.8 --> 8
5.9 --> 9
5.10 --> 10