Port for Windows (WIN32)

This port allows to port the Sirius RTOS and the other products to run on WIN32 platform under Microsoft Windows. It was developed to allow testing and debugging the product and applications.

Source files

All port files of this architecture are specified in the table below:

File nameExtensionDescription
AR_TypesHType declarations
AR_WIN32CPort source file
AR_WinIntfC, HWindows interface files

General description

Each task is created as Windows thread. Only one task can run at the given time. An additional thread is created during initialization. On every millisecond (or other specified time) interrupts a current task execution (by suspending a task thread). It executes an operating system scheduler and the scheduler chooses the new task that should be continued and its thread is resumed.

The arLock/arRestore performs the preemption disabling/re-enabling by using a windows mutexes and event objects for synchronization.

The value returned by arGetTickCount function is a value of Windows GetTickCount function that returns time in milliseconds, since Windows startup.

All created threads belong to one process. When no one task is executing, the idle task execution will start. It calls an arSavePower function that suspends task execution. The process now voluntarily yields its execution. It will be continued when the thread that performs preemption is renewed to run the scheduler.

Additional configuration

The AR_WIN32_CTX_SWITCH_INTERVAL constant allow defining the interval for generating a operating system scheduler. This value is specified in milliseconds and it is set to 1 by default. It must be equal to 1 or greater.

SpaceShadow documentation