OCEOS/oceos kernel/initialisation

From wiki
Jump to navigation Jump to search

OCEOS Initialization

Introduction

This section describes the OCEOS directives used to in most applications.
The application code (starting at main()) will typically carry out various system self test and initialization routines and set up interrupt/trap handlers, and then use OCEOS

The calls to get OCEOS running are:

  1. application_init - Uses oceoc_init to Initialize fixed data and start system time and log
  2. oceos_task_create - Create task setting priority, maximum number of jobs, start function, etc.
  3. oceos_init_finish - Complete and check fixed data area
  4. oceos_start - Start the scheduler - will start optional initial task or put CPU in sleep mode waiting for interrupt.

The functions that implement the operations of each task are defined in the application. The start function for each task and optional task tidy up kill function are specified when a task is created.

If mutexes, semaphores, dataqs and/or timed actions are required they also are created at step 2.

Note

It is mandatory to create the number of tasks, mutexes, semaphores, and data queues declared in oceos_config.h otherwise oceos_init_finish() will return an error.

In OCEOS all task, mutex and other names are unsigned integers and it is strongly recommended that enumerated types are used for this purpose, so as to provide user friendly names.

It is suggested that these names be defined in the application header that is also used for application function declarations. To avoid possible confusion between names, it is suggested also that all task names start with 't_', all mutex names with 'm_', etc.

API Functions