21.01.2015 Views

INtime® 3.1 Software - tenAsys

INtime® 3.1 Software - tenAsys

INtime® 3.1 Software - tenAsys

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 2: Understanding INtime software architecture<br />

About the Windows HAL<br />

INtime software uses the Windows HAL, but intercepts certain functions to perform<br />

the following actions:<br />

• Traps attempts to modify the system clock rate so that the RT kernel can control<br />

the system time base.<br />

• Traps attempts to assign interrupt handlers to interrupts reserved for RT kernel use.<br />

• Ensures that interrupts reserved for RT kernel use are never masked by<br />

Windows software.<br />

INtime software is compatible with all HAL files shipped with the standard Windows<br />

products.<br />

About thread scheduling<br />

Priority-based scheduling<br />

The RT kernel switches between threads and makes sure the processor always executes<br />

the appropriate thread. The kernel’s scheduling policy is that the highest priority<br />

thread that is ready to run is/becomes the running thread. The kernel maintains an<br />

execution state and a priority for each thread and enforces its scheduling policy on<br />

every interrupt or system call.<br />

A priority is an integer value from 0 (the highest priority) through 255.<br />

Range<br />

Usage<br />

0–127 Used by the OS for servicing external interrupts. Creating a thread that<br />

handles internal events here masks numerically higher interrupt levels.<br />

128–130 Used for some system threads.<br />

131–252 Used for application threads.<br />

Execution state<br />

Interrupt threads mask lower-priority (numerically higher) interrupt levels. When you<br />

assign interrupt levels, give a higher-priority (numerically lower) level to interrupts<br />

that can’t wait, such as serial input, and a lower priority (numerically higher) to<br />

interrupts that can wait, such as cached input.<br />

The execution state for each thread is, at any given time, either running, ready, asleep,<br />

suspended, or asleep-suspended. The RT kernel enforces the scheduling policy in<br />

which the highest priority ready thread is always the running thread.<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!