Difference between revisions of "OCEOS/oceos kernel/initialisation"

From wiki
Jump to navigation Jump to search
Line 36: Line 36:
===<span style="color:#0000ff">oceos_init()</span>===
===<span style="color:#0000ff">oceos_init()</span>===


<span style="color:#0000ff">'''Header'''</span><br>
<span style="color:#1b7ac2">'''Header'''</span><br>


<span style="color:#0000ff">'''Description'''</span><br>
<span style="color:#1b7ac2">'''Description'''</span><br>


<span style="color:#0000ff">'''Prototype'''</span><br>
<span style="color:#1b7ac2">'''Prototype'''</span><br>


<span style="color:#0000ff">'''Parameters'''</span><br>
<span style="color:#1b7ac2">'''Parameters'''</span><br>


<span style="color:#0000ff">'''Returns'''</span><br>
<span style="color:#1b7ac2">'''Returns'''</span><br>


<span style="color:#0000ff">'''Example Usage'''</span><br>
<span style="color:#1b7ac2">'''Example Usage'''</span><br>


===<span style="color:#0000ff">oceos_init_finish()</span>===
===<span style="color:#0000ff">oceos_init_finish()</span>===

Revision as of 16:59, 11 March 2022

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. oceos_init - Uses oceos_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, data queues 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

API Functions
Directive Description main task IRQ handler
oceos_init() Initialize fixed data *
oceos_init_finish() Complete and check fixed data area *
oceos_start() Start the scheduler *

oceos_init()

Header

Description

Prototype

Parameters

Returns

Example Usage

oceos_init_finish()

oceos_start()