GeMRTOS data structures use a network of linked control blocks to track and manage every event, task, and resource in a GeMRTOS multiprocessor RTOS running on Altera FPGA platforms with Nios V processors. Rather than relying on static arrays or polling loops, GeMRTOS maintains system state entirely through sorted linked lists that are updated in real time as events occur. This guide explains each control block type, how the linked list structures are organized, and how they work together to deliver deterministic real-time behavior.
What Are GeMRTOS Data Structures? #
GeMRTOS (Generic, eMbedded, Multiprocessor Real-Time Operating System) organizes its runtime state in a set of control blocks linked together in memory. This linked-block architecture makes the system highly flexible and adaptable to modern embedded real-time applications on Nios V FPGA platforms. GeMRTOS categorizes the events that drive these data structure changes into three types:
- Timed events — occur when the system time counter reaches a specified value.
- External events — generated by peripheral devices and typically handled by interrupt service routines (ISRs).
- Internal events — occur when certain runtime conditions are met, including system exceptions and internal signals.
The GeMRTOS Controller handles timed and external events directly in hardware, generating the corresponding processor interrupt requests (PIRQs) without software polling.
GeMRTOS Control Blocks #
The overall system state is stored in control blocks that are linked together to reflect the current runtime status. When an event occurs, the GeMRTOS kernel updates the affected control blocks and their connections. Seven control block types are defined natively:
- Kernel control block (GS_KCB) — centralizes the operating system state.
- Task control block (GS_TCB) — holds the runtime information of each system task.
- Event control block (GS_ECB) — created for each possible event during runtime.
- Scheduling list control block (GS_LCB) — used for GeMRTOS hybrid partition scheduling.
- Processor control block (GS_PCB) — tracks the current status of each system processor.
- Resource control block (GS_RCB) — implements system resources such as semaphores and message queues.
- Signal control block (GS_SCB) — defines internal exceptions and signals.
Each control block contains dedicated pointer fields to support the specific linked lists it participates in, allowing a single control block to be a member of multiple lists simultaneously.
How Are Linked Lists Structured in GeMRTOS? #
GeMRTOS stores and retrieves system information through linked lists built from control blocks. Every linked list consists of two components:
- Root block — the list head, containing a first element pointer field pointing to the first node. The root block may be a different data structure from the list nodes. An empty list has only the root block with a NULL first-element pointer.
- List element — a control block node containing a next element pointer field and optionally a previous element pointer field for doubly-linked traversal.

Figure 1: GeMRTOS linked list structure — root block with first-element pointer and chained list elements.
List elements can be sorted according to a sorting value field stored within each node, enabling the kernel to efficiently locate the next event, highest-priority task, or earliest deadline without scanning the entire list.
Event Time Linked List (ECBTL) #
The event time linked list (ECBTL) manages all timed events in GeMRTOS. Each event control block (ECB) in this list stores an occurrence time value (ECBValue) used to sort events in ascending order of scheduled time. The GeMRTOS Controller compares the current system time counter to the ECBValue of the first (earliest) element in the ECBTL. When system time reaches or exceeds that value, the controller generates a processor interrupt — eliminating the need for a dedicated timer peripheral.
Timed interrupts are created by inserting an ECB into the ECBTL. The ISR then processes the event based on its type, which may include periodic task releases, task deadlines, or timeouts.
Resource Linked Lists (RCBs) #
Each resource control block (RCB) manages a system resource such as a semaphore or message queue through two linked lists:
- Resource waiting event list (RCBWEL) — holds ECBs sorted by the requesting task’s priority. Waiting events may represent semaphore requests, message sends, or producer requests depending on the resource type.
- Resource granted event list (RCBGEL) — holds ECBs for granted semaphores, message receives, or consumer grants, depending on the resource type.
Any number of resource control blocks can be created. The resource type determines the actions executed each time an event occurs on that resource.
Scheduling Linked Lists (LCBs) #
The scheduling list control blocks (LCBs) manage task scheduling across processors through two linked lists:
- Task ready list (TCBRDYL) — sorts task control blocks (TCBs) by ready priority, highest first.
- Task running list (TCBRUNL) — sorts TCBs by execution priority across all processors.
Task preemption occurs automatically when the lowest execution priority in TCBRUNL is lower than the highest ready priority in TCBRDYL. TCBs for tasks that are neither ready nor running are linked to a task waiting list based on their current event status. A running task’s TCB may simultaneously be linked to an ECB — for example, a periodic task that has granted a resource with an associated timeout.
GeMRTOS modifies these linked lists in response to every runtime event, making system behavior fully deterministic: the kernel’s response to any event is defined entirely by the resulting change to the linked-list topology. GeMRTOS callbacks allow extending this mechanism to support new task types, resource types, signals, and custom scheduling strategies.
Key Takeaways #
- GeMRTOS data structures are built entirely from linked control blocks, enabling runtime-adaptive behavior on Nios V FPGA platforms without static arrays or polling.
- Seven native control block types (GS_KCB, GS_TCB, GS_ECB, GS_LCB, GS_PCB, GS_RCB, GS_SCB) each participate in one or more sorted linked lists.
- The ECBTL eliminates the need for a separate timer peripheral by letting the GeMRTOS Controller compare system time directly against the sorted list of pending timed events.
- Resource linked lists (RCBWEL/RCBGEL) provide priority-ordered queuing for all semaphore, message queue, and producer/consumer resources.
- Scheduling lists (TCBRDYL/TCBRUNL) drive automatic task preemption: when the highest ready priority exceeds the lowest running priority, the kernel immediately schedules the higher-priority task.