Getting Started with TiROS

Description of files in TiROS distribution

The distributed directory tree is as shown below. You can move things around as needed and reflect the changes in your Makefile or other build tool.

  <root>
    +-- inc 
    |   +-- tiros
    |   |   |-- tiros.h
    |   |   |-- tr_types.h
    |   |   |-- tr_util.h
    |   |   `-- tr_time.h
    |   |
    |   `-- util.h
    |
    |
    +-- src
        +-- tiros
        |   |-- tiros.c
        |   |-- tr_ll.h
        |   |-- tr_int.h
        |   |-- tr_util.c
        |   |-- tr_llmgr.h
        |   |-- tr_debug.h
        |   |-- tr_debug.c
        |   |
        |   +-- port
        |       +-- template
        |       |       |-- porttime.h
        |       |       `-- tr_port.h
        |       |
        |       +-- msp430_gcc
        |       |       |-- porttime.h
        |       |       |-- tr_port.h
        |       |       `-- tr_port.c
        |       | 
        |       +-- msp430_iar
        |       |       |-- porttime.h
        |       |       |-- tr_port.h
        |       |       `-- tr_port.c
        |       | 
        |       +-- posix
        |       |       |-- porttime.h
        |       |       |-- tr_port.h
        |       |       `-- tr_port.c
        |       |
        |       `-- other_hardware_ports
        |     
        |
        |
        +-- projects
        |   |-- os_porting_help
        |   |
        |   +-- os_examples
        |   |   
        |   +-- tiros_parse
        |   |   
        |   `-- common.mk
        |
        |
        +- your project_directory
        |   |-- Makefile
        |   |-- proj_config.h
        |   `-- main.c
        |
        | 
        `-- util 

   
A typical build session will use the inc/tiros directory, the src/tiros directory and ONE (and only one at a time) of the ports as needed. The files relevant to the user are listed below.
tiros.h:
This contains the application programming interface for TiROS. This file will be included via an include statement within your "c" files. This is the only file that needs to be included from your user files for normal use.
tr_types.h:
This contains definitions of the data types used by TiROS. It also contains defaults for certain TiROS values. The defaults can be overridden.
tiros.c:
This contains the entire implementation of the rtos. This will be compiled and linked with your project.
tr_util.h, tiros_util.c:
These provide some utility functions that may be used for debugging. These are not normally needed.
tr_time.h:
This contains the declaration of time addition and subtraction routines. This is included through tiros.h and thus does not have to be included through your program.
tr_int.h:
This provides definitions of internal data structures used by TiROS and declarations of TiROS functions that can be called from the hardware specific port.
tr_debug.h:
Internal state information can be obtained from TiROS using this debug interface. This is only needed for detail debugging. This has to be explicitly included. It is not automatically included by tiros.h
tr_debug.c:
This contains the implementation of the debug interface.
tr_ll.h:
Inline implementation of a static memory list used by TiROS for queue management.
tr_llmgr.h:
Abstraction layer for accessing the ready and wait queues.
tr_port.h:
This contains the platform specific definitions for the hardware abstraction layer. This does not need to be included explicitly as tiros.h already includes this.
tr_port.c:
There may be one or more files in the port directory that have to be compiled and linked with your project. The port instructions provide details for your specific port.
porttime.[ch]:
The port will implement the time addition and subtraction routines that have been declared in tr_time.h. The location of this code may be port specific.
proj_config.h:
This is your per project configuration file. TiROS configuration directives can be placed here. These will override the TiROS defaults. This way, no change has to be made to the TiROS source itself.
projects/os_porting_help:
This directory contains two projects that can be aid in betting your own custom hardware port working.
projects/os_examples:
This directory contains several examples that demonstrate the use of TiROS.
projects/common.mk:
Common component of the makefiles used by all the examples.
projects/tiros_parse:
This is a program that can decode and display the debug output from TiROS. This runs on the host, not the embedded target. It can take the debug input stream from a file (or serial port) or standard input.
inc/util :
Definitions for some utility functions that are used by the examples (not essential to TiROS).
src/util :
Implementation of utility functions (not essential to TiROS).

The order of header file inclusion is given in the following figure.

file_include_hierarchy.png

Include File Hierarchy

The example projects provided have Makefiles setup the directories to be included. That can be used as a template to set it up for your directory tree. Some build tools/compilers have trouble referencing include files from different directories. In this case, you can copy all the relevant files (src/tiros/*, inc/tiros/* , src/tiros/port/port_xxx/*) to a single directory.

Running Examples

The easiest way to experiment with TiROS is to run it on a desktop host running Linux or running Cygwin in a Windows environment. The Posix hardware port supplied with TiROS allows you to run TiROS within a posix process.

The provided examples in src/projects/os_examples can be compiled using the default Makefiles. The target compilation platform can be set in common.mk (look for DEFAULT_PLATFORM=xxx and set that to posix). Alternatively, set PLATFORM=posix in the Makefile in each individual directory.

There are several examples provided in the os_examples directory. Go to any one of them using a command shell and type make clean; make. This should create a subdirectory called "objects-release" and the executable should be found there. Here is a sequence of steps to run the example in os_sleep_example:

  
  {prompt:} cd src/projects/os_examples/os_sleep_example;
  {prompt:} make clean;
  {prompt:} make;
  {prompt:} ./objects-release/os
 
This example should now run.
TiROS User Manual: Last Updated on Fri Jul 20 10:52:24 2007