The capabilities of the Solaris operating environment continue to expand to meet customer needs. The Solaris operating system was designed to fully support both the 32-bit and 64-bit architectures. The Solaris operating environment provides an environment for building and running 64-bit applications that can use large files and large virtual address spaces. At the same time, the Solaris operating environment continues to provide maximum source compatibility, maximum binary compatibility, and interoperability for 32-bit applications. In fact, most of the system commands that run and have been built on the Solaris 64-bit implementation are 32-bit programs.
Note - This Solaris release supports systems that use the SPARC and x86 families of processor architectures: UltraSPARC, SPARC64, AMD64, Pentium, and Xeon EM64T. The supported systems appear in the Solaris 10 Hardware Compatibility List at http://www.sun.com/bigadmin/hcl. This document cites any implementation differences between the platform types.
In this document the term “x86” refers to 64-bit and 32-bit systems manufactured using processors compatible with the AMD64 or Intel Xeon/Pentium product families. For supported systems, see the Solaris 10 Hardware Compatibility List.
The major differences between the 32-bit and the 64-bit application development environments are that 32-bit applications are based on the ILP32 data model, where ints, longs, and pointers are 32 bits, while 64-bit applications are based on the LP64 model, where longs and pointers are 64 bits and the other fundamental types are the same as in ILP32.
Most applications can remain as 32-bit programs with no changes required. Conversion is necessary only if the application has one or more of the following requirements:
Needs more than 4 gigabytes of virtual address space
Reads and interprets kernel memory through use of the libkvm library, and /dev/mem, or /dev/kmem files
Uses a library that has only a 64-bit version
Needs full 64-bit registers to do efficient 64-bit arithmetic
Specific interoperability issues can also require code changes. For example, if your application uses files that are larger than 2 gigabytes, you might want to convert the application to 64-bit.
In some cases, you might want to convert applications to 64-bit for performance reasons. For example, you might need the 64-bit registers to do efficient 64-bit arithmetic or you might want to take advantage of other performance improvements that a 64–bit instruction set provides.
This document is written for C and C++ developers and provides guidance on how to determine whether an application is 32-bit or 64-bit. This document provides
A list of the similarities and differences between the 32-bit and 64-bit application environments
An explanation of how to write code that is portable between the two environments
A description of the tools provided by the operating system for developing 64-bit applications
This book is organized into the following chapters.
Chapter 1, 64-bit Computing describes the motivation behind 64–bit computing and gives an overview of the benefits of 64–bit applications.
Chapter 2, When to Use 64-bit explains the differences between the Solaris 32-bit and 64-bit build and runtime environments. The information is written to help the application developer determine if and when converting code to be 64-bit safe is appropriate.
Chapter 3, Comparing 32-bit Interfaces and 64-bit Interfaces focuses on the similarities between 32-bit applications and 64-bit applications as well as the 64-bit interfaces.
Chapter 4, Converting Applications describes how to convert current 32–bit code to 64-bit safe code and the tools available for making this process easier. The focus of this chapter is on writing portable code. The information applies to converting existing applications or writing new applications that are capable of running in both 32-bit and 64-bit environments.
Chapter 5, The Development Environment focuses on the build environment, including headers, compilers, and libraries, as well as packaging guidelines and debugging tools.
Chapter 6, Advanced Topics is an overview of 64–bit systems programming, the ABI, and some performance issues.
Appendix A, Changes in Derived Types highlights many of the derived types that have changed in the 64-bit application development environment.
Appendix B, Frequently Asked Questions (FAQs) provides answers to the most commonly asked questions about the 64-bit implementation and application development environment.
For further reading, the following texts are recommended:
American National Standard for Information Systems Programming Language - C, ANSI X3.159-1989
SPARC Architecture Manual, Version 9, SPARC International
SPARC Compliance Definition, Version 2.4, SPARC International
Large Files in Solaris: A White Paper, Part No: 96115-001
Solaris 10 Reference Manual
Writing Device Drivers, Part No: 816–4854
Sun Studio 10: C User's Guide, Part No: 819-0494-10
The docs.sun.com Web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. The URL is http://docs.sun.com.
The following table describes the typographic changes that are used in this book.
Table P-1 Typographic Conventions
The following table shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.
Table P-2 Shell Prompts