Skip to content

Porting

balazsracz edited this page Jun 14, 2014 · 1 revision

Porting guide

This document describes the process of porting OpenMRN to new targets.

Porting to a new OS

All the OS-specific abstraction is collected in src/os/os.h' and src/os/os.c'. In order to compile OpenMRN on a new operating system, you need to provide an implementation to all (or at least most) of the types and functions presented there. In particular you need to implement

  • os_thread_t, thread: os_task_create;
  • os_mutex_t, mutex: creation, locking, unlocking;
  • os_sem_t, semaphore: creation, post, wait, wait with timeouts, post from isr;
  • os_mq_t, message queues: queue creation, get, put, get from isr, put from isr;
  • os_time_get_monotonic;
  • os_timer_* for periodic/timed callbacks.

Of these functions a few can be omitted if only limited applications are needed:

  • isr routines and message queues are needed if the file abstraction / device driver library will be used.
  • os_timer_* routines are not in use by the OpenLCB stack at the moment. The stack relies on the semaphore API's wait with timeout and os_time_get_monotonic.

If you OS is POSIX-compatible and pthreads is available, then the linux port should function well as a baseline.

Clone this wiki locally