This port facilitates the deployment of Sirius RTOS and other products on all compatible processors and microcontrollers within the 80x86 family.
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 for 16-bit x86 architectures |
| AR_x86RM | C | Port source file |
| AR_x86RMa | ASM | Port assembly file |
The Programmable Interval Timer (PIT) is utilized to implement preemption. It is configured for a one-millisecond interval by default. This port uses the user timer interrupt (0x1C) for the operating system scheduler. The default interrupt service routine is hooked during the arInit function call and restored by arDeinit.
The arLock and arRestore functions manage preemption disabling and re-enabling by modifying the interrupt enable flag within the flags register.
The arYield function performs a context switch without utilizing an additional software interrupt.
The arGetTickCount function utilizes the BIOS tick counter located at memory address 0040:006C to provide system time, configured for a one-millisecond resolution.
When the operating system invokes the port-specific arSetPreemptiveHandler function, a new stack and task context are allocated for the operating system scheduler.
Most early 80x86 processors do not support specific power-saving modes; consequently, the body of the arSavePower function is empty. Power-saving modes are available in succeeding processor generations (e.g., i386).
The task context contains all information required to resume the execution of an interrupted task. The table below details the 26-byte task context structure for 80x86 processors:
| Offset | Size | Description |
|---|---|---|
| 0000 | 2 | Flags register |
| 0002 | 4 | Task startup procedure (CS:IP registers) |
| 0006 | 2 | AX register |
| 0008 | 2 | CX register |
| 000A | 2 | DX register |
| 000C | 2 | BX register |
| 000E | 2 | SP register |
| 0010 | 2 | BP register |
| 0012 | 2 | SI register |
| 0014 | 2 | DI register |
| 0016 | 2 | DS register |
| 0018 | 2 | ES register |