Solaris SPARC to Solaris x86 Porting Guide
keyboard, display, and mouse attached to the system. The kdmconfig command can determine this
information interactively from the user or can obtain configuration information from the JumpStart
server or from a file.
Custom code migration
Processor architectural difference and porting issues
To achieve the goal of multiple-platform and multiple-instruction-set architecture portability, the first
dependency issue to address is the endianness (or byte ordering) of the processor. The method of
storing information in memory is referred to as endianness. When the most significant byte (MSB) of
any multi-byte data field is stored at the lowest memory address, which is also the address of the
larger field, then the system is referred to as big-endian. When the least significant byte (LSB) of any
multi-byte data field is stored at the lowest memory address, then the system is referred to as little-
endian.
For example, consider the integer 260 (hexadecimal equivalent is 0x0104), for which you are storing
the value of at address 100 and 101.
If the system is big-endian, the system stores the integer as follows.
Address
0x100 0x101 0x102 0x103
Value
0 0 01 04
If the system is little-endian, the system stores the integer as follows.
Address
0x100 0x101 0x102 0x103
Value
04 01 0 0
Numeric data is stored in memory in a different format depending on whether the target
implementation platform is based on x86 or UltraSPARC technology. The SPARC processor-based
systems implement the MSB first and are called big-endian. The x86 systems implement the LSB first
and are called little-endian.
The Solaris OS can be used both in big-endian mode (SPARC version) and in little-endian mode (x86
versions). Endianness is mandated by the hardware platform used. Solaris OS handles the endianness
issue, so that ISVs or developers do not need to be concerned about how quickly applications are
available on x86 platforms. Sun software architecture enables big-endian applications for the Solaris
SPARC Platform Edition to run on the little-endian Solaris x86 Platform when they are recompiled. In
general, no re-engineering is needed. However, the endianness difference might cause issues,
particularly if an application uses low-level code that takes optimal advantage of the hardware
capabilities.
Porting issues based on endianness
Sending data over the network
Applications running on Solaris systems interoperate with other systems over the network using
standard network protocols that have enabled communication between big-endian and little-endian
systems. However, if the applications transfer data (numeric data) over the network directly without
any protocol, then an issue might arise.
Solution: Most of the modern protocols incorporate the External Data Representation (XDR) layer,
which byte swaps data if needed during transfers. HP recommends taking advantage of these
4