Windows Port (WIN32)

This port enables the deployment of Sirius RTOS and other products on the WIN32 platform under Microsoft Windows. It was developed to facilitate product testing and application debugging.

Source files

The following table lists the port files associated with this architecture:

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

General description

Each task is instantiated as a Windows thread. Only one task executes at any given time. An additional thread is created during initialization to generate periodic interrupts. Every millisecond (or other specified interval), the currently executing task is interrupted (by suspending its thread). The operating system scheduler is then invoked to select the next task for execution, after which the corresponding thread is resumed.

The arLock and arRestore functions manage preemption disabling and re-enabling by utilizing Windows mutexes and event objects for synchronization.

The arGetTickCount function returns the value obtained from the Windows API function GetTickCount, representing the time in milliseconds since system startup.

All created threads execute within a single process context. When no tasks are active, the idle task begins execution. It invokes the arSavePower function, which suspends execution. The process voluntarily yields the CPU until the preemption thread wakes to execute the scheduler.

Additional configuration

The AR_WIN32_CTX_SWITCH_INTERVAL constant defines the interval for invoking the operating system scheduler. This value is specified in milliseconds and defaults to 1. It must be set to 1 or greater.

SpaceShadow documentation