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.
The following table lists the port files associated with this architecture:
| File name | Extension | Description |
|---|---|---|
| AR_API | H | Port API File |
| AR_Types | H | Type declarations |
| AR_WIN32 | C | Port source file |
| AR_WinIntf | C, H | Windows interface files |
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.
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.