ChorusOS 5.0 Application Developer's Guide

Creating a Basic "Hello" Application

Create a src subdirectory on your host.

To create the basic "hello" application,

  1. Create the following files in the src directory:

    • hello.c, this source file will say "hello" and is written as follows:

      #include <stdio.h>
      
      int main()
      {
            /* Print the message */
        printf("Hello World\n");
        
        return 0;
      }

    • Imakefile. This file provides the rules to build the application and contains the following:

      UserActorTarget(hello_u,hello.o,)
      SupActorTarget(hello_s, hello.o,)

      The Imakefile declares:

      • The source files to be compiled (implicitly).

      • The libraries to be used (only standard libraries are used).

      • That you want to build both a user and a supervisor application called hello.

  2. Use the ChorusOSMkMf command to create a make file that will build your application:

    % ChorusOSMkMf build_dir
    

    The ChorusOSMkMf command should be located in your PATH. See "Setting Environment Variables" in the ChorusOS 5.0 Installation Guide for information on how to modify your PATH.

  3. Build your application:

    % make