This chapter describes the development environment for ChorusOS application programming. It provides the basic information required to approach the ChorusOS development environment and tools in an effective manner. It is written for application developers who have not yet developed applications for ChorusOS systems, but who have application development experience involving POSIX-compliant systems such as the Solaris operating environment.
Although designed for the ChorusOS novice, this chapter will also be helpful to experienced ChorusOS developers transitioning from an earlier version of the product to the current version.
Before reading this chapter, you may choose to review the description of the ChorusOS product provided in the ChorusOS 5.0 Features and Architecture Overview. This contains a complete overview of the ChorusOS operating system, including its advantages and peculiarities.
After reading this chapter, you will know how to begin developing applications on ChorusOS systems. This chapter does not, however, include examples that demonstrate actual development. Subsequent chapters show how to use the tools to create ChorusOS applications. Debugging of applications and systems is covered in the ChorusOS 5.0 Debugging Guide.
If you are transitioning from an earlier version of the ChorusOS operating system, it is suggested that you read the ChorusOS 5.0 Transition Guide.
The Sun Embedded Workshop development environment provides an environment for applications running on a network of target machines, controlled by a remote host.
The target system runs the ChorusOS operating system and provides the execution environment.
The host machine provides the development and debugging environment. You can develop applications on the host and execute and debug the applications running on the targets, from the host.
This environment is illustrated in the graphic below:
The host system is used as a platform on which the operating system is configured and applications are developed. The resultant code is then loaded and executed on the target, which runs an instance of the ChorusOS operating system.
The development environment consists of a set of host tools that enable you to produce a runtime image. This runtime image includes the system image, configuration files, system commands, and customer applications. The image can be executed on the target with varying degrees of host cooperation.
The development environment has been designed for a host and target that use different hardware. This means you can develop applications for one or more targets with different architectures on a specific platform host. Developing applications in this manner is called cross development.
For more information on the development environment refer to the section on "Multi-Platform Development Environment" in ChorusOS 5.0 Features and Architecture Overview.
Applications written in high-level programming languages (such as C and C++) are compiled and linked for the target platform using the ChorusOS host tools. Although the resultant executable files are initially placed on the host file system, they can only be executed on the target platform.
In the context of the ChorusOS target software architecture, tools denotes a program (or a set of programs) which execute on the host. The term applications denotes a program (or set of programs) which execute on the target. Some applications are provided as built-in system commands or utilities. Others may be developed by the user.
Although applications are initially developed and stored on the host file system, they may also be located:
In the system image (embedded applications).
On local target storage (disk, flash or memory bank).
You can execute an application on the target platform in different ways, depending on the location of the application executable file.
Communication between the host and target is achieved using the rsh
(remote shell) protocol. The remote shell protocol is used to execute commands
remotely on the target from the host. In particular, this feature allows applications
to be loaded dynamically. If the RSH
feature is set
to true, the rshd
daemon enables the command interpreter
to be run in an infinite loop to read input from the remote system, using
the remote shell protocol. For more information on the rshd
daemon, refer to the rshd(1M) man page.
It is also possible to communicate with the host using the telnet protocol.
In addition, ChorusOS systems provide support for TCP and UDP (User Datagram Protocol) over IP. TCP is a high-level, reliable, connection-oriented protocol that verifies that messages sent arrive at their destinations. Messages that do not reach their destination are automatically resent. This feature of TCP relies on connections between the sender and the receiver. UDP is also a high-level protocol protocol, however, it is not as reliable as TCP because UDP sends messages without verifying that they arrive. UDP is faster and not as resource-hungry as TCP.
Both TCP and UDP sit above the lower-level IP transport protocol.
For details about the ChorusOS implementations of these protocols, see the IP(7P), TCP(7P), and UDP(7P) man pages.
Two additional communication protocols are supported on ChorusOS systems, although they are not used for communicating between the host and target.
Support for remote inter-process communication (remote IPC) is provided, by enabling you to create an IPC stack in the C_OS system actor and attach the stack to an Ethernet device. For details, see the ethIpcStackAttach(2K), IPC(5FEA), and IPC_REMOTE(5FEA) man pages.
Support for Open Systems Interconnect (OSI) is provided since you are able to attach an OSI stack to an Ethernet device. For details, see the ethOsiStackAttach(2K) man page.
The Sun Embedded Workshop provides a complete development environment for creating applications or systems that use the ChorusOS operating system (or an embedded system based on the ChorusOS operating system). The Sun Embedded Workshop contains the ChorusOS operating system and development environment. For a comprehensive overview of The Sun Embedded Workshop software, refer to "Multi-Platform Development Environment" in ChorusOS 5.0 Features and Architecture Overview.
The development environment provided by the Sun Embedded Workshop includes the following major components:
C and C++ Development Toolchain, including the GNU gcc and g++ cross-compilers.
A debugging framework and a C and C++ reference debugger, GNU GDB debugger for ChorusOS systems. The current version of GDB includes the Insight graphical user interface. For more information on the ChorusOS debugging tools, refer to the ChorusOS 5.0 Debugging Guide.
A set of configuration tools.
A set of libraries, described in "ChorusOS APIs".
The ChorusOS operating system consists of modules that can be configured by providing a list of the required components. The configuration tools manage any hidden dependencies or incompatibilities.
The configuration tools are designed to be flexible enough to configure system components and application actors that are part of the ChorusOS operating system image.
You can use the Ews graphical user interface or a command-line interface (configurator) to view or modify characteristics of a ChorusOS operating system image. In addition to selecting the components required for the operating system, Sun Embedded Workshop supports three other levels of system configuration:
Resources. For the list of selected components, you can fix the amount of resources to be managed and set the values of tunable parameters, for example, the amount of memory reserved for network buffers.
Boot actors. Additional actors can be included in the memory image loaded at boot time.
Environment. System-wide configuration parameters can be fixed by setting environment strings, which are similar to the environment variables used in UNIX systems. The operating system and actors retrieve these environment strings when they are initialized.