Notes - MIECT
Sistemas Operativos E De Tempo-real
Notes - MIECT
Sistemas Operativos E De Tempo-real
  • Sistemas Operativos e de Tempo-real
  • Basic Concepts About Real-Time Systems
    • Preliminaries
    • Definitions
    • Objective of the Study of RTS
    • Requirements of Real-Time Systems
  • Real Time Model
    • Real Time Model
    • Temporal Control
    • Task states and execution
    • Kernel/RTOS Architecture
      • Time Management Functions
    • Examples of RTOS
  • Practical Class 01
    • Real-Time Services in Linux
    • Using the Linux real-time services
  • Scheduling Basics
    • Basic concepts
    • Scheduling Algorithms
      • Basic algorithms
    • Static Cyclic Scheduling
    • Exercise
  • Fixed Priority Scheduling
    • Online scheduling with fixed priorities
    • Schedulability tests based on utilization
      • Deadline Monotonic Scheduling DM
    • Response-time analysis
  • Practical Class 2
    • Xenomai brief introduction
    • API
    • Developing an application
  • Dynamic Priority Scheduling
    • On-line scheduling with dynamic priorities
    • Analysis: CPU utilization bound
    • Analysis: CPU Load Analysis
    • Other deadline assignment criteria
  • Exclusive Access to Shared Resources
    • The priority inversion problem
    • Techniques for allowing exclusive access
    • Priority Inheritance Protocol
    • Priority Ceiling Protocol
    • Stack Resource Policy
    • Notes
  • Aperiodic Servers
    • Joint scheduling of periodic and aperiodic tasks
    • Aperiodic Servers
    • Fixed Priority Servers
    • Dynamic Priority Servers
  • Limited preemption, release jitter and overheads
    • Non-preemptive scheduling
    • Impact of Release Jitter
    • Accounting for overheads
    • Considerations about the WCET
  • Profiling and Code Optimization
    • Code optimization techniques
      • CPU independent optimization techniques
      • Cache impact
      • Optimization techniques dependent on memory architecture
      • Architecture-dependent optimization techniques
    • Profiling
  • Multiprocessor Scheduling, V1.2
    • Introduction
    • Definitions, Assumptions and Scheduling Model
    • Scheduling for Multicore Platforms
    • Task allocation
Powered by GitBook
On this page
  • Tick-based Systems
  • Measurement of time intervals
  • Management functions
  • Scheduler
  • Dispatcher
  1. Real Time Model
  2. Kernel/RTOS Architecture

Time Management Functions

PreviousKernel/RTOS ArchitectureNextExamples of RTOS

Last updated 2 years ago

Time management is another critical activity on kernels. It is required to:

  • Activate periodic tasks.

  • Check if temporal constraints are met (e.g. deadline violations).

  • Measure time intervals (e.g. self-suspension).

It is based on a system timer. There are two common modes:

  • Periodic tick: generates periodic interrupts (system ticks). The respective ISR handles the time management. All temporal attributes (e.g. period, deadline, waiting times) must be integer multiples of the clock tick.

  • Single-shot/tickless: the timer is configured for generating interrupts only when there are periodic task activations or other similar events (e.g. the termination of a task self-suspension interval).

Tick-based Systems

The tick defines the system’s temporal resolution.

  • Smaller ticks corresponds to better resolutions.

  • E.g. if tick=10 ms and task periods are: T1=20ms, T2=1290ms, T3=25ms,

The tick handler is code that is executed periodically, thus it consumes CPU time .

A bigger tick lowers the overhead; compromise!

  • tick = GCD(Ti), i = 1..N

  • E.g. T1=20 ms, T2=1290 ms, T3=25 ms, then GCD(20,1290,25)=5 ms

  • Works but Utick doubles!

Measurement of time intervals

In tick-based systems, the kernel keeps a variable that counts the number of ticks since the system boot.

  • In FreeRTOS the system call xTaskGetTickCount() returns the number of ticks since the scheduler was initiated (via vTaskStartScheduler()).

  • The constant portTICK RATE MS can be used to calculate the (real) time from the tick rate with the resolution of one tick period.

  • Better resolutions require e.g. the use of HW timers.

Be careful with overflows.

E.g. in Pentium CPUs, with a 1GHz clock, the TSC wraps around after 486 years !!!

Management functions

Scheduler

The scheduler selects which task to execute among the (eventually) several ready tasks.

In real-time systems must be based on deterministic criteria, which must allow computing an upper bound for the time that a given task may have to wait on the ready queue.

Dispatcher

Puts in execution the task selected by the scheduler.

For preemptive systems, it may be needed to preempt (suspend the execution) of a running task. In these cases, the dispatch mechanism must also manipulate the stack.