RTOS Design - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

RTOS Design

Description:

... set of s is taken from the documentation existing on the FreeRTOS website ... the set of processes that can be run if given access to the CPU. Blocked queue ... – PowerPoint PPT presentation

Number of Views:394
Avg rating:3.0/5.0
Slides: 12
Provided by: jun89
Category:

less

Transcript and Presenter's Notes

Title: RTOS Design


1
RTOS Design
  • Some of the content of this set of slides is
    taken from the documentation existing on the
    FreeRTOS website
  • www.freertos.org

2
RTOS Design
  • Review states of a process
  • Introduce queues that are used to keep track of
    processes
  • Introduce the concepts of scheduler and
    dispatcher

3
RTOS Design
4
Process Suspension
  • A process can be suspended in two ways
  • involuntarily by the RTOS kernel
  • Higher priority process preempts a low priority
    process
  • a process can choose to suspend itself
  • Wants to delay (sleep) for a fixed period of time
  • Wait (block) for a resource to become available
    (e.g. serial port)
  • A blocked or sleeping process is not able to
    execute, and will not be allocated any processing
    time.

5
Queues
  • Queues are used to keep track of processes.
  • Ready queue
  • the set of processes that can be run if given
    access to the CPU.
  • Blocked queue
  • the set of processes that are waiting on some
    particular I/O device to become ready or on some
    event

6
Scheduler
7
Context Switch
  • When the CPU has to execute a new process and the
    old one has not finished, the system must
  • save the state of the old process
  • then load the saved state for the new process.
  • This is called a context switch.
  • Context switch time is overhead and no useful
    work is done while the switch takes place.
  • Context switching time depends upon hardware
    support.

8
Scheduler
  • The scheduler is the part of the kernel
    responsible for deciding which process should be
    executing at any particular time. The kernel can
    suspend and later resume a process many times
    during the process lifetime.
  • The scheduling policy is the algorithm used by
    the scheduler to decide which process to execute
    at any point in time.

9
Scheduling Decisions
  • The scheduler selects from among the processes in
    memory that are ready to execute and allocates
    the CPU to one of them.
  • Scheduling decisions may take place when a
    process
  • switches from running to blocked state
  • switches from running to ready state
  • switches from blocked to ready state
  • terminates

10
Dispatcher
  • The dispatcher gives control of the CPU to the
    process selected by the scheduler, this involves
  • switching context
  • switching to user mode
  • jumping to the proper location in the user
    program to restart that program
  • It takes time to stop one process and start
    another. This is called dispatch latency.
  • The dispatcher and scheduler are often referred
    to as the scheduler.

11
Summary
  • Involuntary(by RTOS kernel) and voluntary
    suspension of process (by itself).
  • Described ready and blocked queues.
  • Reviewed context switch and introduced context
    switching time
  • Described scheduler, scheduling policy, events
    for scheduling decisions, dispatcher and dispatch
    latency.
Write a Comment
User Comments (0)
About PowerShow.com