Solaris 7 64-bit Developer's Guide
この本のみを検索
この本を見る:
PDF 文書ファイルをダウンロードする (150 KB)

Preface

The capabilities of the SolarisTM operating environment continue to expand to meet customer needs. The Solaris 7 release has been designed to fully support both the 32-bit and 64-bit architectures. It provides an environment for building and running 64-bit applications that can use large files and large virtual address spaces. At the same time, this release continues to provide maximum source and 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.

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 using libkvm, /dev/mem, or /dev/kmem

  • Uses /proc to debug 64-bit processes

  • 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. Similarly, if your application uses files larger than 2 gigabytes, you might want to convert it to 64-bit.

The appendixes included in this manual contain a list of changed derived types, as well as a list of frequently asked questions. In addition, for further reading, the following 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 Reference Manual, Part No: 802-5426

  • Writing Device Drivers, Part No: 805-3024

  • Sun WorkShop C User's Guide, Version 5.0, Part No: 805-4952

Who Should Use This Book

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. It lists the similarities and differences between the 32-bit and 64-bit application environments, explains how to write code that is portable between the two environments, and describes the tools provided by the operating system for developing 64-bit applications.

How This Book Is Organized

This book is organized into the following chapters.

  • Chapter 1, 64-bit Computing, "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, "When to Use 64-bit" explains the differences between the Solaris 32-bit and 64-bit build and runtime environments. It is written to help the application developer determine if and when it is appropriate to convert code to be 64-bit safe.

  • Chapter 3, Comparing 32-bit and 64-bit Interfaces, "Comparing 32-bit and 64-bit Interfaces" focuses on the similarities between 32-bit and 64-bit applications and interfaces.

  • Chapter 4, Converting Applications, "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. It applies to converting existing applications or writing new applications capable of running in both 32-bit and 64-bit environments.

  • Chapter 5, The Development Environment, "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, "Advanced Topics" is an overview of 64-bit Systems Programming, the ABI, and looks at some performance issues.

  • Appendix A, Changes in Derived Types, "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 (FAQ), "Frequently Asked Questions" lists the most commonly asked questions and the corresponding answers about the 64-bit implementation and application development environment.

  • Appendix C, 64-bit Developer's Guide Updates, "64-bit Developer's Guide Updates" provides a list of updates to this document.

Ordering Sun Documents

The SunDocsSM program provides more than 250 manuals from Sun MicrosystemsTM, Inc. If you live in the United States, Canada, Europe, or Japan, you can purchase documentation sets or individual manuals using this program.

For a list of documents and how to order them, see the catalog section of the SunExpressTM Internet site at http://www.sun.com/sunexpress.

What Typographic Changes Mean

The following table describes the typographic changes used in this book.

Table P-1 Typographic Conventions

Typeface or Symbol

Meaning

Example

AaBbCc123

The names of commands, files, and directories; on-screen computer output

di_add_intr() registers a device interrupt with the system.

add_drv adds a driver to the system.

AaBbCc123

What you type, contrasted with on-screen computer output

machine_name% su
Password:

AaBbCc123

Command-line placeholder: replace with a real name or value

number is the number of the interrupt to register.

AaBbCc123

Book titles, new words or terms, or words to be emphasized

Read Chapter 6 in Writing Device Drivers. A mutual exclusion lock is....


Note -

The term "x86" refers to the Intel 8086 family of microprocessor chips, including the Pentium and Pentium Pro processors and compatible microprocessor chips made by AMD and Cyrix. In this document the term "x86" refers to the overall platform architecture, whereas "Intel Platform Edition" appears in the product name of x86 products.