Lec20RTOS

Lec20RTOS - Foreground/background systems Small systems are...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 471 20-RTOS-1 Lecture 20 Real-time Operating Systems Outline Foreground/background systems Task states Scheduler Semaphores/messages OS Calls Porting a RTOS
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ECE 471 20-RTOS-2 Foreground/background systems Small systems are very often designed as foreground/background processing schemes. Foreground is the interrupt level. Background is the task level. Multitasking is similar to foreground/background with multiple backgrounds. Multitasking allows the application programmer to manage complexity inherent in real-time applications. An RTOS kernel can simplify the design of systems, but will require more system resources.
Background image of page 2
ECE 471 20-RTOS-3 Task States A task is called a thread, a simple program that thinks it has the CPU all to itself. Tasks can be in any of four states: DORMANT: Not available to the kernel. READY: Can execute but priority is less than a task currently running. RUNNING: Has control of the CPU. WAITING: Requires the occurrence of an event to continue execution.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ECE 471 20-RTOS-4 Scheduler Scheduler determines which task will run next. Each task has an assigned priority based on its importance. Control of the CPU is always given to the highest priority task that is ready to run. Two types of kernels: Non-preemptive: A non-preemptive kernel requires that a task explicitly give up control of the CPU. Preemptive: The highest priority task ready to run is always given control of the CPU.
Background image of page 4
ECE 471 20-RTOS-5 Clock Tick A clock tick is an interrupt that occurs periodically allowing the kernel to obtain control of the CPU. Tasks can be suspended for an integer number of clock ticks. Depending on other interrupt service routines (ISR) that may be executing on the processor, the time between clock ticks may vary. The clock tick interval should be chosen wisely. Too short an interval will add excess overhead to the system, while too long of an interval provides inadequate resolution.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ECE 471 20-RTOS-6 Task priority A priority is assigned to each task. Tasks that need quicker response times are assigned higher priorities. A task priority that is assigned at compile time and cannot change during execution is considered static. Dynamic priorities can change during execution time.
Background image of page 6
ECE 471 20-RTOS-7 Priority inversion A priority inversion occurs when a task (say task 1) is waiting for a resource (e.g., an output device) controlled by another task (say task 2). In addition task 1 has a higher priority than task 2, so it preempts task 2. Therefore, task 1 than waits for the resource, owned by lower priority level task 2, but does not let task to run.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/31/2008 for the course ECE 471 taught by Professor Chien during the Spring '08 term at IUPUI.

Page1 / 35

Lec20RTOS - Foreground/background systems Small systems are...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online