Introduction to the Oracle Solaris Developer Documentation

Chapter 1 Introduction to the Oracle Solaris Developer Documentation

The Oracle Solaris Operating System (Oracle Solaris OS) provides developers with numerous interfaces, frameworks, and tools to take advantage of Oracle Solaris technologies. This manual provides a roadmap for developers to learn about the Oracle Solaris OS and provides links to sources of further information. The following topics are covered:

Which Oracle Solaris Distribution is Right for You?

The Oracle Solaris OS distribution you choose depends on how you want to use the system.

Oracle Solaris 10 Operating System

Use the Oracle Solaris 10 OS for mission critical activities and production, such as in a large enterprise.

For information about the Oracle Solaris 10 OS, see the Oracle Solaris product site.

To get the Oracle Solaris 10 OS, see Get It: Oracle Solaris 10. You can download the Oracle Solaris 10 OS, you can download the Oracle Solaris 10 appliance image for VirtualBox, or you can order a DVD media kit. You can also get information about Oracle Premier Support for Operating Systems.

OpenSolaris Operating System

Download the OpenSolaris OS in a slim install configuration that fits on a single CD. Install the base OS from the CD, and then install additional software packages of your choice from the OpenSolaris package repository. Alternatively, use Automated Installer to install the OpenSolaris OS and your complete working environment on multiple machines.

For more information about the OpenSolaris OS, or to get the OpenSolaris OS, see the OpenSolaris product site. You can download the LiveCD image, you can download the Automated Installer bootable image, or you can order media. You can also download VirtualBox.

For information about Automated Installer, see OpenSolaris 2010.05 Automated Installer Guide and Migrating From Solaris Custom JumpStart to OpenSolaris Automated Installer.

Learning About Development on the Oracle Solaris OS

The various vehicles for getting information about developing applications in the Oracle Solaris OS are:

Map to the Oracle Solaris OS Man Page Collection

The Oracle Solaris OS provides detailed information about system internals through man pages. If you are unfamiliar with the man page concept, see the man page for the man(1) command itself or type man man on the command line. The Oracle Solaris OS provides more than 13,000 man pages. Man page collections are separated into sections, which vary slightly from vendor to vendor or even from one release to another release. Large sections are sometimes divided into volumes. References to commands often include the reference manual section or volume number next to the command. For example the man command might be referred to as man(1).

Viewing man pages at docs.sun.com offers several advantages over viewing man pages from the command line. Each section or volume is presented as a book with an index and preface, and an alphabetized list of items with their short descriptions. In some sections, an introductory page provides an overview of the section.

The man pages for the Oracle Solaris OS are organized into sections and volumes as follows:

Building Applications in the Oracle Solaris OS

This section provides information on Oracle Solaris facilities for developing applications, including compiling, debugging, tuning, and packaging applications.

Oracle Solaris Developer Tools

The Oracle Solaris OS includes a number of developer software packages, which are available when you install the appropriate Oracle Solaris software group for developers. For installation purposes, the Oracle Solaris OS is logically divided into software groups, which are collections of Oracle Solaris packages.

When you install the Oracle Solaris OS, you must select one of the following software groups, which contain the developer packages:

With these software groups, you get compilers such as the GNU C compiler (gcc) and the Java compiler (javac). Also installed are the GNU source-level debugger (gdb) and the modular debugger (mdb and kmdb), a linker (ld), source control utilities (sccs), and build utilities such as make. See the article Building Software on the Solaris OS for a quick lesson in using some of the standard tools.


Note –

Most developers should use the more powerful Oracle Solaris Studio and NetBeans development and build tools. See Using the Oracle Solaris Studio Tools and Using the NetBeans IDE.


Using the Runtime Linker and Link Editor

The Oracle Solaris OS provides a link editor and runtime linker. The Linker and Libraries Guide covers the link editor ld(1), the runtime linker ld.so.1(1), the ELF object file format, and shared objects, which are sometimes referred to as shared libraries.

The manual is intended for a range of programmers who are interested in the Oracle Solaris linkers, from the beginner to the advanced user. Beginners learn the principal operations of the link editor and runtime linker. Intermediate programmers learn to create and use efficient custom libraries. Advanced programmers, such as language-tools developers, learn how to interpret and generate object files. A chapter on application binary interfaces describes how to manage the evolution of an interface that is provided by a dynamic object. Other chapters cover thread-local storage and mapfile directives.

Kernel-Level Debugging

The Modular Debugger mdb is an extensible, general purpose debugging tool for the Oracle Solaris OS. The Oracle Solaris Modular Debugger Guide describes how to use the mdb(1) command to debug complex software systems. The guide emphasizes the facilities that are available for debugging the Oracle Solaris kernel and associated device drivers and modules. The guide includes a complete reference for the mdb language syntax, debugger features, and the mdb module programming API.

The Oracle Solaris Modular Debugger Guide also features information on kmdb, the kernel-level analogue to mdb.

Using the Oracle Solaris Studio Tools

The Oracle Solaris Studio software provides modules for creating, editing, building, debugging, and analyzing the performance of a C, C++, or Fortran application. Many Oracle Solaris Studio tools have both a GUI and command-line equivalent. Those tools with GUIs provide online help. For the command-line versions, use the associated man pages. If you start dbx from the command line, type commands at the (dbx) prompt to get a brief description of each dbx command.

Download Oracle Solaris Studio software from Sun Studio Downloads.

The Oracle Solaris Studio Express program offers early access releases of the next Oracle Solaris Studio release in development. Download Oracle Solaris Studio Express from Oracle Solaris Studio Express Downloads.

Note that the Oracle Solaris Studio IDE installs its own version of the NetBeans IDE. This NetBeans installation is not intended to be used independently of the Oracle Solaris Studio software, and you might experience errors if you use it separately. If you want to use the NetBeans IDE, you should install the NetBeans IDE separately from installing Oracle Solaris Studio or Oracle Solaris Studio Express software.

The Oracle Solaris Studio software includes the following tools:

See the following web sites for Oracle Solaris Studio documentation:

Using the NetBeans IDE

NetBeans IDE (Integrated Development Environment) provides tools to help you build cross-platform applications for the Oracle Solaris OS and other operating platforms. The NetBeans IDE is available from netbeans.org. To see the installation guide, go to the Releases & Planning page, click the “General Info” link for the release you want, and then find the Installation Instructions on that page.

The NetBeans IDE contains the following features:

Visit the netbeans.org web site for more information. New users might find the following pages particularly useful:

AMP Stack for Web Application Development and Deployment

Web Stack software is a collection of popular open source web technologies that enable developers to easily build and deploy web applications. Web Stack includes an AMP (Apache/MySQL/Perl or PHP) stack that has been optimized for the Oracle Solaris OS. See Sun GlassFish Web Stack Documentation for more information.

The Web Stack components include the following technologies:

Using Oracle Message Passing Toolkit

The Oracle Message Passing Toolkit, formerly Sun HPC ClusterTools, is a set of development tools that you can use to develop parallel applications designed to run on distributed-memory systems.

For Oracle Solaris 10, the latest Oracle Message Passing Toolkit can be downloaded from the Oracle Message Passing Toolkit page.

Oracle Message Passing Toolkit includes the following technologies:

The Oracle Message Passing Toolkit can be used with the Oracle Solaris Studio compilers for C, C++, and Fortran. The Oracle Message Passing Toolkit is integrated with Oracle Solaris Studio Performance Analyzer to deliver full profiling capabilities for MPI applications, including MPI States, a feature unique to Performance Analyzer. The Oracle Message Passing Toolkit also supports the popular Totalview and Allinea DDT parallel debuggers.

See the Sun HPC ClusterTools documentation set for complete information about using the Oracle Message Passing Toolkit.

Packaging Applications for the Oracle Solaris OS

Software programs must be incorporated into a package to be installed in the Oracle Solaris OS. The Application Packaging Developer’s Guide provides step-by-step instructions and relevant background information for designing, building, and verifying System V, or SVR4 packages on the Oracle Solaris OS. A chapter with case studies provides several package creation examples in a variety of situations. This document also includes descriptions of advanced techniques that you might find to be helpful during the package creation process.

For OpenSolaris releases, applications can be packaged for the Image Packaging System (IPS). See the OpenSolaris 2010.05 Image Packaging System Guide and Multi-platform Packaging for Layered Distros for more information about application packaging for IPS.

Oracle Solaris Dynamic Tracing

Oracle Solaris Dynamic Tracing (DTrace) is a comprehensive dynamic tracing framework for the Oracle Solaris OS. The DTrace facility provides a powerful infrastructure to enable administrators, developers, and service personnel to concisely answer arbitrary questions about the behavior of the operating system and user programs. DTrace can help developers identify performance issues and bugs in applications. The Oracle Solaris Dynamic Tracing Guide describes in depth how to use DTrace to observe, debug, and tune system behavior. This guide also includes a complete reference for bundled DTrace observability tools and the D programming language.

In addition to the manual, you can find links to training, articles and other resources for DTrace at the following locations:

Writing Java Programs for the Oracle Solaris OS

The Java software is optimized to deliver superior performance to server-side and client-side Java technology applications in an enterprise environment. The java.sun.com web site provides complete documentation for Java Platform, Standard Edition (Java SE). The SDN New to Java Programming Center is a good place to start learning about Java programming.

Supplying Platform-Independent Online Help

The JavaHelp system is a full-featured, platform-independent, extensible help system that enables you to incorporate online help in applets, components, applications, operating systems, and devices. You can also use the JavaHelp software to deliver online documentation for web applications. The JavaHelp System product page includes links for downloading JavaHelp software and the JavaHelp System User's Guide and other documentation. Note that the JavaHelp system is not an authoring system, but a help infrastructure. The product page also includes information about third-party help authoring tools that support the JavaHelp system. In addition, you can subscribe to the mailing list to get help from other JavaHelp users.

Programming to Specific Hardware and Configurations

This section provides information for development on specific hardware platforms and architectures, including clustered environments.

Known Oracle Solaris Compatible Hardware

The Hardware Compatibility Lists (HCL) identifies hardware that is compatible with the Oracle Solaris 10 OS and the OpenSolaris OS. Separate lists identify systems and components that are compatible with the latest commercial versions of the Oracle Solaris OS and with the latest development versions. The HCL is available in a comma-separated value (CSV) format, for searching and sorting the list in a spreadsheet or database.

The Solaris on x86 Platforms Device Support list shows drivers and the devices they support for x86 Oracle Solaris 10 and OpenSolaris systems. Select an Oracle Solaris 10 release or an OpenSolaris release and then select a device type such as Network, Storage, or Video. Drivers of that type that are bundled in that selected release are displayed.

The Oracle Device Detection Tool reports both built-in and third-party Oracle Solaris driver availability for x86 systems.

Testing x86 Hardware for Oracle Solaris Compatibility

See Solaris on x86 Platforms Device Support for the latest list of device support that comes built in to the Oracle Solaris OS.

On any x86 system, you can use the Installation Check Tool to determine quickly whether the system is likely to be able to install the Oracle Solaris OS.

The Hardware Certification Test Suite (HCTS) includes system certification tests, controller certification tests, a command-line interface , and a browser-based user interface. HCTS tests certify systems, motherboards, and various network, storage, and serial I/O controllers to work with the Oracle Solaris OS. HCTS collects log files, determines test pass or fail results, and generates a final test report. Hardware that passes HCTS certification testing is eligible to be included in the Hardware Compatibility List as Certified.

Developing in the x86 Assembly Language

The Oracle Solaris OS provides an assembly language for the x86 platform. The x86 Assembly Language Reference Manual describes the assembler that generates code for the 32-bit x86 processor architecture and translates source files that are in assembly language format into object files in linking format. This book describes the syntax of the Oracle Solaris x86 assembly language. The book also maps the instruction mnemonics of the Oracle Solaris x86 assembly language to the native x86 instruction set.

Developing in the SPARC Assembly Language

The Oracle Solaris OS provides an assembly language for the SPARC platform. The SPARC Assembly Language Reference Manual describes the assembler that runs on the SPARC architecture. The assembler translates source files that are in assembly language format into object files in linking format. The book describes the assembler syntax, and the executable and linking format. The relationship between hardware instructions of the SPARC architecture and the assembly language instruction set is discussed. The book also contains a description of the SPARC-V9 instruction set. Appendixes list the pseudo-operations that the SPARC assembler supports, with examples of their use. Other appendixes describe the available assembler command-line options and an example of the correspondence between the assembly code and the C code.

Developing 64-bit Applications for the Oracle Solaris OS

The Oracle Solaris OS provides a 64-bit computing environment along with backward compatibility for 32-bit applications. The Solaris 64-bit Developer’s Guide is written primarily for the application developer. The book provides guidance for choosing whether to use the 32-bit Oracle Solaris application development environment or the 64-bit environment. The manual explains the similarities and differences between the two environments, and explains how to write code that is portable between the two environments. This book also describes some of the tools provided by the operating system for developing 64-bit applications.

Developing for a Cluster Environment

The Oracle Solaris OS can be configured into a cluster environment to improve availability. The Sun Cluster Data Services Developer’s Guide for Solaris OS describes the Sun Cluster data service API. Developers can use this API to turn a standard user application such as a web browser or database into a highly available data service that can run in the Oracle Solaris Cluster environment. For high availability in virtualized environments, see the Oracle Solaris Containers feature and Oracle VM Server for SPARC.

In addition, you can parallelize applications to enable them to reap the benefits of running in a clustered environment. Oracle Message Passing Toolkit, formerly Sun HPC ClusterTools, is a set of parallel development tools for high-end distributed memory applications. See Using Oracle Message Passing Toolkit for more information.

Network Programming in the Oracle Solaris OS

This section provides information on making remote procedure calls, programming a system management agent, and developing web-based enterprise management applications.

Making Remote Procedure Calls

The Oracle Solaris OS provides ONC+ distributed services for making remote procedure calls (RPC). The ONC+ Developer’s Guide describes the ONC+ distributed services that were developed at Sun.

ONC+ technologies consist of a family of technologies, services, and tools:

The book contains information on the rpcgen tool and the portmap utility. The book also contains code examples on the use of RPC.

Adding Device Management Information to the System Management Agent

The System Management Agent (SMA) is based on the open source Net-SNMP agent. The Solaris System Management Agent Developer’s Guide provides information for developers who want to extend the functionality of the agent. The manual provides information on the creation of Management Information Base (MIB) modules for SMA, and the interfaces that MIB modules use. Modules enable a specific application, device, system, or network to be managed through an SNMP management application. An appendix provides information about migrating an SEA subagent from the Solstice Enterprise Agents software for use in the System Management Agent.

Developing Web-Based Enterprise Management Applications

The Solaris WBEM Developer’s Guide describes the components of the Oracle Solaris Web-Based Enterprise Management (WBEM) Software Development Kit (SDK). The manual explains how to use these components to develop WBEM-based applications.

The book describes the following subjects:

Programming with Oracle Solaris Interfaces and Frameworks

This section provides information on interfaces and frameworks that are unique to the Oracle Solaris OS.

Multithreaded Programming in the Oracle Solaris OS

The Oracle Solaris OS provides the ability to develop applications with separate, parallel threads to improve application performance. The Multithreaded Programming Guide covers the POSIX and Oracle Solaris threads APIs, programming with synchronization objects, and compiling multithreaded programs. This guide is for developers who want to use multithreading to separate a process into independent execution threads, improving application performance and structure. Appendixes contain examples of code for both POSIX and Oracle Solaris threads.

If you are new to multithreaded or parallel programming, see the article Making Sense of Parallel Programming Terms. The article explains terminology and contains links to additional sources of information about parallel programming.

For a more comprehensive understanding of programming with POSIX threads, consider reading the following retail books:

Programming Interfaces

The Programming Interfaces Guide describes programming interfaces that are specific to the Oracle Solaris environment.

The Programming Interfaces Guide has information on the following subjects:

The Oracle Solaris OS includes two utilities that enable application developers to verify an application's compliance with the Oracle Solaris Application Binary Interface (ABI). Compliance with the Oracle Solaris ABI ensures that your code is portable across releases of the Oracle Solaris OS. The Oracle Solaris ABI defines the interfaces that are available for the use of application developers.

The appcert(1) utility statically examines the Oracle Solaris library interfaces used by ELF binaries for instances of private interface usage. The apptrace(1) tool uses the link-auditing capability of the run time linker to dynamically trace library routine calls as the application runs.

Developing Custom Storage Modules for the DHCP Service

The Oracle Solaris OS provides Dynamic Host Configuration Protocol (DHCP) services. The Oracle Solaris DHCP service provides a framework that enables the development and use of custom databases for storing DHCP data. The Solaris DHCP Service Developer’s Guide describes how to enable the DHCP service to use additional data storage facilities. The manual enables developers to write a module to store DHCP data in a database that is not currently supported by the Oracle Solaris DHCP service. The manual gives an overview of the data access framework used by Oracle Solaris DHCP and general guidelines for developers. The book also provides sample code templates.

Developing Security Applications and Services in the Oracle Solaris OS

The Oracle Solaris Security for Developers Guide is for developers of applications that consume security services as well as developers of applications that provide security services. Programming interfaces are documented for the following services: PAM, SASL, GSS-API, the Oracle Solaris cryptographic framework, and process privileges. The book provides examples of use for the Generic Security Standard API and the Simple Authentication Security Layer.

Developing Device Drivers

The Oracle Solaris OS includes a set of standard interfaces for developing device drivers. The interfaces are known as the DDI/DKI, or Device Driver Interface/Driver-Kernel Interface. The DDI/DKI interfaces enable you to upgrade to a new Oracle Solaris release or migrate to a new platform without recompiling your driver. These interfaces are documented in man page section 9, described in Map to the Oracle Solaris OS Man Page Collection.

The Device Driver Tutorial provides hands-on information about how to develop device drivers for the Oracle Solaris OS. This book includes step-by-step descriptions for writing, building, installing, loading, and testing simple device drivers. This book also gives an overview of the driver development environment and the tools available to develop drivers. Links to driver development resources and techniques for avoiding some driver development problems are also provided.

The Writing Device Drivers manual provides much more complete information about developing drivers for character-oriented devices and block-oriented devices. Specific devices such as network devices, USB devices, and SCSI target and HBA devices are covered as well.

The Writing Device Drivers manual includes the following additional topics:

For more driver development resources, see the Device Drivers section of Software Developer Information Resources and the OpenSolaris Device Drivers Community.

Writing System Resource Management Applications

The Solaris Containers: Resource Management and Solaris Zones Developer’s Guide describes how to write applications that partition and manage system resources such as processor sets and thread scheduling classes. This book references the programming APIs provided to partition, schedule, and set bounds on the consumption of system resources. This book provides programming examples and a discussion of programming issues to consider when writing an application. This book also includes a brief overview of Oracle Solaris Zones technology and discusses design considerations for applications that run in zones.

Developing Software for International Audiences

The Oracle Solaris OS provides an internationalization architecture to assist in the development, deployment, and management of applications and language services from around the world. A single multilingual product provides support for 39 different languages and 162 locales. In addition, support is available for the complex text layout that is required for Thai and Hindi scripts. Bidirectional text capability is also supported for languages such as Arabic and Hebrew. The International Language Environments Guide describes how to use the current Oracle Solaris release to build global software products that support a variety of languages and cultural conventions.